Changeset 82549 in webkit
- Timestamp:
- Mar 30, 2011 11:04:10 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r82548 r82549 1 2011-03-30 Brent Fulgham <bfulgham@webkit.org> 2 3 Unreviewed build correction after r82496. (Part 3) 4 5 Revise DragImageCairoWin to address new PlatformGraphicsContext 6 and object lifecycle. 7 8 * platform/win/DragImageCairoWin.cpp: 9 (WebCore::deallocContext): 10 (WebCore::allocImage): 11 (WebCore::scaleDragImage): 12 (WebCore::createDragImageFromImage): 13 1 14 2011-03-30 Brent Fulgham <bfulgham@webkit.org> 2 15 -
trunk/Source/WebCore/platform/win/DragImageCairoWin.cpp
r82548 r82549 47 47 { 48 48 if (target) 49 delete *target;49 delete target; 50 50 } 51 51 … … 85 85 cairo_matrix_t matrix; 86 86 cairo_matrix_init(&matrix, 1.0, 0.0, 0.0, -1.0, 0.0, size.height()); 87 cairo_set_matrix( *targetRef, &matrix);87 cairo_set_matrix((*targetRef)->cr(), &matrix); 88 88 89 89 return hbmp; … … 123 123 goto exit; 124 124 125 CairoContextRef targetContext;125 PlatformContextCairo* targetContext = 0; 126 126 hbmp = allocImage(dstDC, dstSize, &targetContext); 127 127 if (!hbmp) 128 128 goto exit; 129 130 if (!targetContext) { 131 ::DeleteObject(hbmp); 132 hbmp = 0; 133 goto exit; 134 } 129 135 130 136 cairo_surface_t* srcImage = createCairoContextFromBitmap(image); … … 133 139 // so that when we set the srcImage as the surface it will draw 134 140 // right-side-up. 135 cairo_translate(targetContext , 0, dstSize.height());136 cairo_scale(targetContext , scale.width(), -scale.height());137 cairo_set_source_surface (targetContext , srcImage, 0.0, 0.0);141 cairo_translate(targetContext->cr(), 0, dstSize.height()); 142 cairo_scale(targetContext->cr(), scale.width(), -scale.height()); 143 cairo_set_source_surface (targetContext->cr(), srcImage, 0.0, 0.0); 138 144 139 145 // Now we can paint and get the correct result 140 cairo_paint(targetContext );146 cairo_paint(targetContext->cr()); 141 147 142 148 cairo_surface_destroy (srcImage); 143 cairo_destroy(targetContext);149 delete targetContext; 144 150 ::DeleteObject(image); 145 151 image = 0; … … 162 168 goto exit; 163 169 164 CairoContextRefdrawContext = 0;170 PlatformGraphicsContext* drawContext = 0; 165 171 hbmp = allocImage(workingDC, img->size(), &drawContext); 166 172 if (!hbmp) … … 172 178 } 173 179 174 cairo_set_source_rgb (drawContext , 1.0, 0.0, 1.0);175 cairo_fill_preserve (drawContext );180 cairo_set_source_rgb (drawContext->cr(), 1.0, 0.0, 1.0); 181 cairo_fill_preserve (drawContext->cr()); 176 182 177 183 cairo_surface_t* srcImage = img->nativeImageForCurrentFrame(); 178 184 179 185 // Draw the image. 180 cairo_set_source_surface(drawContext , srcImage, 0.0, 0.0);181 cairo_paint(drawContext );186 cairo_set_source_surface(drawContext->cr(), srcImage, 0.0, 0.0); 187 cairo_paint(drawContext->cr()); 182 188 183 cairo_destroy (drawContext);189 delete drawContext; 184 190 185 191 exit:
Note: See TracChangeset
for help on using the changeset viewer.