RESOLVED FIXED 22026
[Transforms] Transformed element is clipped when opacity is applied
https://bugs.webkit.org/show_bug.cgi?id=22026
Summary [Transforms] Transformed element is clipped when opacity is applied
Simon Fraser (smfr)
Reported 2008-10-31 19:49:41 PDT
In the attached testcase, there should be a red box, but it's getting clipped. Remove the opacity to see what it should look like. I think the transparency clip rect is ignoring transforms.
Attachments
Testcase (1.02 KB, text/html)
2008-10-31 19:51 PDT, Simon Fraser (smfr)
no flags
Reduced testcase (863 bytes, text/html)
2008-11-03 11:19 PST, Simon Fraser (smfr)
no flags
Patch, testcase, changelog (5.56 KB, patch)
2008-11-03 14:01 PST, Simon Fraser (smfr)
hyatt: review+
Simon Fraser (smfr)
Comment 1 2008-10-31 19:51:53 PDT
Created attachment 24831 [details] Testcase
Simon Fraser (smfr)
Comment 2 2008-11-03 11:19:33 PST
Created attachment 24859 [details] Reduced testcase
Simon Fraser (smfr)
Comment 3 2008-11-03 13:46:48 PST
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp index 3f0e6e7..31fcc2b 100644 --- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp +++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp @@ -651,6 +651,12 @@ void GraphicsContext::beginTransparencyLayer(float opacity) CGContextSaveGState(context); CGContextSetAlpha(context, opacity); CGContextBeginTransparencyLayer(context, 0); + + // paint a big rect so we can see how big the layer is + float red[] = { 1.0f, 0.0f, 0.0f, 0.1f }; + CGContextSetFillColor(context, red); + CGContextFillRect(context, CGRectMake(-1000.0f, -1000.0f, 2000.0f, 2000.0f)); + m_data->beginTransparencyLayer(); m_data->m_userToDeviceTransformKnownToBeIdentity = false; }
Simon Fraser (smfr)
Comment 4 2008-11-03 13:47:14 PST
That patch in the previous comment is some debugging code that will reveal how big the opacity layer is.
Simon Fraser (smfr)
Comment 5 2008-11-03 14:01:31 PST
Created attachment 24866 [details] Patch, testcase, changelog
Dave Hyatt
Comment 6 2008-11-03 14:19:41 PST
Comment on attachment 24866 [details] Patch, testcase, changelog r=me
Simon Fraser (smfr)
Comment 7 2008-11-03 14:37:20 PST
Committed r38079 M WebCore/rendering/RenderLayer.cpp M WebCore/ChangeLog A LayoutTests/platform/mac/fast/layers/opacity-transforms-expected.txt A LayoutTests/platform/mac/fast/layers/opacity-transforms-expected.png A LayoutTests/platform/mac/fast/layers/opacity-transforms-expected.checksum M LayoutTests/ChangeLog A LayoutTests/fast/layers/opacity-transforms.html r38079 = f9050b37b90e1c8a40699dc2e8c58cdda5dbbfcb (trunk)
Note You need to log in before you can comment on or make changes to this bug.