Changeset 103091 in webkit
- Timestamp:
- Dec 16, 2011 12:20:34 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r103088 r103091 1 2011-12-16 Branimir Lambov <blambov@google.com> 2 3 [chromium] svg/clip-path/clip-in-mask.svg fails on Windows and Linux 4 https://bugs.webkit.org/show_bug.cgi?id=53378 5 6 Reviewed by Tony Chang. 7 8 Fixes a problem in Skia's clipping layer code's handling of coordinate 9 transformations that was causing all complex clipping (including text 10 and/or masks) to fail. 11 12 The method beginLayerClippedToImage was taking rectangle coordinates 13 in one local coordinate space, but it was applying them in a different 14 one because of the delay between the time it is called and the actual 15 application occurs in applyClipFromImage. The fix translates the 16 coordinates passed to beginLayerClippedToImage to absolute ones, so 17 that they are not affected by any change in the transform matrix, and 18 makes sure that applyClipFromImage clears the matrix before drawing 19 the clip layer to correctly apply the absolute coordinates. 20 21 * platform/chromium/test_expectations.txt: 22 1 23 2011-12-16 Adrienne Walker <enne@google.com> 2 24 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r103088 r103091 870 870 BUGCR52692 LINUX WIN : svg/W3C-SVG-1.1/animate-elem-80-t.svg = IMAGE+TEXT 871 871 872 // New in WK r65880, some probably just need rebaselining, others have real diffs 873 BUGWK53378 LINUX WIN : svg/clip-path/clip-in-mask.svg = IMAGE 874 BUGWK53378 LINUX WIN : svg/clip-path/deep-nested-clip-in-mask-different-unitTypes.svg = IMAGE+TEXT 875 BUGWK53378 LINUX WIN : svg/clip-path/deep-nested-clip-in-mask-panning.svg = IMAGE+TEXT 876 BUGWK53378 LINUX WIN : svg/clip-path/deep-nested-clip-in-mask.svg = IMAGE+TEXT 877 BUGWK53378 LINUX WIN : svg/clip-path/nested-clip-in-mask-image-based-clipping.svg = IMAGE 878 BUGWK53378 LINUX WIN : svg/clip-path/nested-clip-in-mask-path-and-image-based-clipping.svg = IMAGE 879 BUGWK53378 LINUX WIN : svg/clip-path/nested-clip-in-mask-path-based-clipping.svg = IMAGE 880 // Rebaselined in WK r65874, Linux has missing lines 872 // Windows needs rebaselining after 53378 patch. 873 BUGWK53378 WIN : svg/W3C-SVG-1.1/filters-example-01-b.svg = IMAGE 874 BUGWK53378 WIN : svg/batik/text/textProperties.svg = IMAGE 875 BUGWK53378 WIN : svg/clip-path/clip-in-mask.svg = IMAGE 876 BUGWK53378 WIN : svg/clip-path/deep-nested-clip-in-mask-different-unitTypes.svg = IMAGE+TEXT 877 BUGWK53378 WIN : svg/clip-path/deep-nested-clip-in-mask-panning.svg = IMAGE+TEXT 878 BUGWK53378 WIN : svg/clip-path/deep-nested-clip-in-mask.svg = IMAGE+TEXT 879 BUGWK53378 WIN : svg/clip-path/nested-clip-in-mask-image-based-clipping.svg = IMAGE 880 BUGWK53378 WIN : svg/clip-path/nested-clip-in-mask-path-and-image-based-clipping.svg = IMAGE 881 BUGWK53378 WIN : svg/clip-path/nested-clip-in-mask-path-based-clipping.svg = IMAGE 881 882 882 883 // Since r89233. May need a new baseline. -
trunk/Source/WebCore/ChangeLog
r103083 r103091 1 2011-12-16 Branimir Lambov <blambov@google.com> 2 3 [chromium] svg/clip-path/clip-in-mask.svg fails on Windows and Linux 4 https://bugs.webkit.org/show_bug.cgi?id=53378 5 6 Reviewed by Tony Chang. 7 8 Fixes a problem in Skia's clipping layer code's handling of coordinate 9 transformations that was causing all complex clipping (including text 10 and/or masks) to fail. 11 12 The method beginLayerClippedToImage was taking rectangle coordinates 13 in one local coordinate space, but it was applying them in a different 14 one because of the delay between the time it is called and the actual 15 application occurs in applyClipFromImage. The fix translates the 16 coordinates passed to beginLayerClippedToImage to absolute ones, so 17 that they are not affected by any change in the transform matrix, and 18 makes sure that applyClipFromImage clears the matrix before drawing 19 the clip layer to correctly apply the absolute coordinates. 20 21 * platform/graphics/skia/PlatformContextSkia.cpp: 22 (WebCore::PlatformContextSkia::beginLayerClippedToImage): 23 (WebCore::PlatformContextSkia::applyClipFromImage): 24 * platform/graphics/skia/PlatformContextSkia.h: 25 1 26 2011-12-16 Mark Hahnenberg <mhahnenberg@apple.com> 2 27 -
trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
r101325 r103091 97 97 SkBitmap m_imageBufferClip; 98 98 // If m_imageBufferClip is non-empty, this is the region the image is clipped to. 99 FloatRect m_clip;99 SkRect m_clip; 100 100 101 101 InterpolationQuality m_interpolationQuality; … … 232 232 // time restore is invoked the layer and |imageBuffer| are combined to 233 233 // create the resulting image. 234 m_state->m_clip = rect;235 234 SkRect bounds = { SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()), 236 235 SkFloatToScalar(rect.maxX()), SkFloatToScalar(rect.maxY()) }; 236 m_state->m_clip = bounds; 237 // Get the absolute coordinates of the stored clipping rectangle to make it 238 // independent of any transform changes. 239 canvas()->getTotalMatrix().mapRect(&m_state->m_clip); 237 240 238 241 canvas()->clipRect(bounds); 242 239 243 if (imageBuffer->size().isEmpty()) 240 244 return; … … 577 581 } 578 582 579 void PlatformContextSkia::applyClipFromImage(const FloatRect& rect, const SkBitmap& imageBuffer)583 void PlatformContextSkia::applyClipFromImage(const SkRect& rect, const SkBitmap& imageBuffer) 580 584 { 581 585 // NOTE: this assumes the image mask contains opaque black for the portions that are to be shown, as such we … … 583 587 SkPaint paint; 584 588 paint.setXfermodeMode(SkXfermode::kDstIn_Mode); 585 m_canvas->drawBitmap(imageBuffer, SkFloatToScalar(rect.x()), SkFloatToScalar(rect.y()), &paint); 589 m_canvas->save(SkCanvas::kMatrix_SaveFlag); 590 m_canvas->resetMatrix(); 591 m_canvas->drawBitmapRect(imageBuffer, 0, rect, &paint); 592 m_canvas->restore(); 586 593 } 587 594 -
trunk/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
r101325 r103091 191 191 // Used when restoring and the state has an image clip. Only shows the pixels in 192 192 // m_canvas that are also in imageBuffer. 193 void applyClipFromImage(const FloatRect&, const SkBitmap&); 193 // The clipping rectangle is given in absolute coordinates. 194 void applyClipFromImage(const SkRect&, const SkBitmap&); 194 195 195 196 // common code between setupPaintFor[Filling,Stroking]
Note: See TracChangeset
for help on using the changeset viewer.