Bug 93558

Summary: [chromium] Pass mask scale and offset to shaders for correct masking
Product: WebKit Reporter: Shawn Singh <shawnsingh>
Component: Layout and RenderingAssignee: Shawn Singh <shawnsingh>
Status: RESOLVED FIXED    
Severity: Normal CC: cc-bugs, dglazkov, enne, jamesr, reveman, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Added layout test and fixed errors enne: review+

Shawn Singh
Reported 2012-08-08 17:15:01 PDT
In the current code: (1) masks force us to create a renderSurface for that layer (2) masks are drawn 1:1 with respect to the renderSurface, but they should be drawn 1:1 with respect to the layer that owns the surface. usually this isn't a problem, but if the renderSurface is clipped by something else (for example, the viewport), this causes the renderSurface to resize to the clipped area, and the mask incorrectly resizes along with the surface. The solution we have chosen at this time is to pass the scale/offset data that the mask needs to correctly compute its texture coordinates in the fragment shader.
Attachments
Patch (15.32 KB, patch)
2012-08-08 17:18 PDT, Shawn Singh
no flags
Added layout test and fixed errors (25.89 KB, patch)
2012-08-09 11:49 PDT, Shawn Singh
enne: review+
Shawn Singh
Comment 1 2012-08-08 17:18:38 PDT
WebKit Review Bot
Comment 2 2012-08-08 17:20:51 PDT
Attachment 157345 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/platform/graphics/chromium/..." exit_code: 1 Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp:697: v_maskTexCoord is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp:750: v_maskTexCoord is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] Total errors found: 2 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Shawn Singh
Comment 3 2012-08-08 17:22:30 PDT
Few points to make: (1) the style checker will complain, but this seems to fit the style we had for written shaders already. (2) I will be writing layout tests for this, but it's ready for review otherwise. I suspect you guys may have something to say about how we could group these new values into fewer args that get passed around. =)
Shawn Singh
Comment 4 2012-08-08 17:32:38 PDT
Comment on attachment 157345 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=157345&action=review >> Source/WebCore/platform/graphics/chromium/ShaderChromium.cpp:750 >> + vec2 v_maskTexCoord = vec2(maskTexCoordOffset.x + v_texCoord.x * maskTexCoordScale.x, maskTexCoordOffset.y + v_texCoord.y * maskTexCoordScale.y); > > v_maskTexCoord is incorrectly named. Don't use underscores in your identifier names. [readability/naming/underscores] [4] On second thought, I shouldn't be prefixing this with v_ anyway, so this won't be an issue on the next patch.
WebKit Review Bot
Comment 5 2012-08-08 17:43:32 PDT
Comment on attachment 157345 [details] Patch Attachment 157345 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13452834
Shawn Singh
Comment 6 2012-08-09 11:49:43 PDT
Created attachment 157504 [details] Added layout test and fixed errors
Adrienne Walker
Comment 7 2012-08-09 12:28:27 PDT
Comment on attachment 157504 [details] Added layout test and fixed errors R=me. Nice layout test! Please rebaseline this after landing.
Shawn Singh
Comment 8 2012-08-09 12:39:47 PDT
Note You need to log in before you can comment on or make changes to this bug.