Bug 22026 - [Transforms] Transformed element is clipped when opacity is applied
Summary: [Transforms] Transformed element is clipped when opacity is applied
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-31 19:49 PDT by Simon Fraser (smfr)
Modified: 2008-11-03 14:37 PST (History)
1 user (show)

See Also:


Attachments
Testcase (1.02 KB, text/html)
2008-10-31 19:51 PDT, Simon Fraser (smfr)
no flags Details
Reduced testcase (863 bytes, text/html)
2008-11-03 11:19 PST, Simon Fraser (smfr)
no flags Details
Patch, testcase, changelog (5.56 KB, patch)
2008-11-03 14:01 PST, Simon Fraser (smfr)
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 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.
Comment 1 Simon Fraser (smfr) 2008-10-31 19:51:53 PDT
Created attachment 24831 [details]
Testcase
Comment 2 Simon Fraser (smfr) 2008-11-03 11:19:33 PST
Created attachment 24859 [details]
Reduced testcase
Comment 3 Simon Fraser (smfr) 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;
 }
Comment 4 Simon Fraser (smfr) 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.
Comment 5 Simon Fraser (smfr) 2008-11-03 14:01:31 PST
Created attachment 24866 [details]
Patch, testcase, changelog
Comment 6 Dave Hyatt 2008-11-03 14:19:41 PST
Comment on attachment 24866 [details]
Patch, testcase, changelog

r=me
Comment 7 Simon Fraser (smfr) 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)