gdiplus: Implement path to region conversion without gdi32.
11 unresolved threads
11 unresolved threads
This will later allow for optimization by limiting the area we consider to the region's bounding rectangle.
Merge request reports
Activity
requested review from @nsivov
Would also request review from @gang65 if I could.
1132 1133 scans = (RECT*)&(*rgndata)->Buffer; 1134 1135 /* translate edges into scans based on winding mode */ 1136 for (i=0; i < edges->length; i++) 1025 1137 { 1026 graphics->hdc = hdc = new_hdc = CreateCompatibleDC(0); 1027 if (!new_hdc) 1028 return OutOfMemory; 1138 BOOL new_in_shape; 1139 1140 winding_count += edges->edges[i].rising ? 1 : -1; 1141 1142 /* check all edges at this point before starting/ending a scan */ 1143 if (i + 1 < edges->length && 1144 edges->edges[i+1].x == edges->edges[i].x && edges->edges[i+1].y == edges->edges[i].y) It would be great to use the same formatting in whole PR
There are more places with inconsistent formatting.
104 104 short Y; 105 105 } packed_point; 106 106 107 struct edge 108 { 109 /* Represents an intersection of a path segment with a scanline */ 110 int x; 111 int y; 1070 int rounded_x = rgn_round(x); 1071 1072 edges->edges[edges->length].x = rounded_x; 1073 edges->edges[edges->length].y = y; 1074 edges->edges[edges->length].rising = rising; 1075 edges->length++; 1002 1076 } 1003 1077 1004 if (!graphics) 1078 return stat; 1079 } 1080 1081 static GpStatus flat_path_to_edge_list(GpPath *path, struct edge_list *edges) 1082 { 1083 GpStatus stat=Ok; 1084 int i, subpath_start=0; 1084 int i, subpath_start=0; 1085 1086 for (i=1; i < path->pathdata.Count && stat == Ok; i++) 1005 1087 { 1006 hdc = new_hdc = CreateCompatibleDC(0); 1007 if (!new_hdc) 1008 return OutOfMemory; 1088 BYTE type = path->pathdata.Types[i]; 1089 1090 if ((type&PathPointTypePathTypeMask) == PathPointTypeStart) 1091 subpath_start = i; 1009 1092 1010 stat = GdipCreateFromHDC(new_hdc, &new_graphics); 1011 graphics = new_graphics; 1012 if (stat != Ok) 1093 if ((type&PathPointTypePathTypeMask) == PathPointTypeLine) 1109 1110 if (edge1->y != edge2->y) 1019 1111 { 1020 stat = gdi_dc_acquire(graphics, &hdc); 1021 if (stat != Ok) 1022 return stat; 1112 return (edge1->y > edge2->y) - (edge1->y < edge2->y); 1023 1113 } 1024 else 1114 1115 return (edge1->x > edge2->x) - (edge1->x < edge2->x); 1116 } 1117 1118 static GpStatus edge_list_to_rgndata(struct edge_list *edges, FillMode fill_mode, RGNDATA **rgndata) 1119 { 1120 int i, start_x = 0, winding_count = 0; 2570 2570 } 2571 2571 } 2572 2572 2573 static void test_rounding(void) 2574 { 2575 GpRegion *region; 2576 GpMatrix *matrix; 2577 GpBitmap *bitmap; 2578 GpGraphics *graphics; 2579 GpBrush *brush; 2580 GpStatus status; 2581 UINT count=80085; 2582 INT icount; 2583 GpRectF scans[2]; 2584 HRGN hrgn; 2585 int i, x, y, min_x, min_y, max_x, max_y; 2664 expect(Ok, status); 2665 2666 min_x = min_y = 10; 2667 max_x = max_y = -1; 2668 2669 for (x = 0; x < 10; x++) 2670 for (y = 0; y < 10; y++) 2671 { 2672 status = GdipBitmapGetPixel(bitmap, x, y, &color); 2673 expect(Ok, status); 2674 2675 if (color) { 2676 min_x = min(min_x, x); 2677 min_y = min(min_y, y); 2678 max_x = max(min_x, x); 2679 max_y = max(min_y, y); 2570 2570 } 2571 2571 } 2572 2572 2573 static void test_rounding(void) 2574 { 2575 GpRegion *region; 2576 GpMatrix *matrix; 2577 GpBitmap *bitmap; 2578 GpGraphics *graphics; 2579 GpBrush *brush; 2580 GpStatus status; 2581 UINT count=80085; 1113 1280 { 1114 1281 case CombineModeIntersect: 1115 1282 return get_region_hrgn(element->elementdata.combine.right, graphics, hrgn); 1116 1283 case CombineModeXor: case CombineModeExclude: Thanks, it does here too. Marking it static makes sense to me (even if it's not clear to me why it would cause this), so I rebased with that change.
Edited by Esme Povirk
added 310 commits
-
083d40d9...856efc7a - 308 commits from branch
wine:master
- 70a06301 - gdiplus: Implement path to region conversion without gdi32.
- 924e0313 - gdiplus/tests: Test rounding of region rectangles.
-
083d40d9...856efc7a - 308 commits from branch
Please register or sign in to reply