Bug 82071

Summary: [chromium] Improved composited debug borders
Product: WebKit Reporter: Dana Jansens <danakj>
Component: New BugsAssignee: Dana Jansens <danakj>
Status: RESOLVED FIXED    
Severity: Normal CC: backer, cc-bugs, enne, jamesr, piman, reveman, vangelis, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Dana Jansens
Reported 2012-03-23 11:20:47 PDT
[chromium] Improved composited debug borders
Attachments
Patch (9.62 KB, patch)
2012-03-23 11:31 PDT, Dana Jansens
no flags
Patch (9.39 KB, patch)
2012-03-23 12:47 PDT, Dana Jansens
no flags
Patch (9.75 KB, patch)
2012-03-23 13:11 PDT, Dana Jansens
no flags
Dana Jansens
Comment 1 2012-03-23 11:31:32 PDT
Dana Jansens
Comment 2 2012-03-23 11:35:01 PDT
Adrienne Walker
Comment 3 2012-03-23 12:01:37 PDT
Comment on attachment 133521 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=133521&action=review > Source/WebCore/ChangeLog:13 > + of its debug quad. Reverse the ordering when appening to fix this > + . s/appening to fix this\n./appending to fix it./ Nice comment justification. ;) > Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp:67 > - layer->appendQuads(quadCuller, sharedQuadState.get(), usedCheckerboard); > layer->appendDebugBorderQuad(quadCuller, sharedQuadState.get()); > + layer->appendQuads(quadCuller, sharedQuadState.get(), usedCheckerboard); See! Things implicitly being in reverse order is confusing. ;) > Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:159 > + if (hasDebugBorders()) { > + Color color(debugTileBorderMissingTileRed, debugTileBorderMissingTileGreen, debugTileBorderMissingTileBlue, debugTileBorderAlpha); > + quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState, tileRect, color, debugTileBorderWidth)); > + } This doesn't seem right. This will interleave missing texture debug quads with normal quads, drawing over some of them. Change line 154 from "if (!tile || !tile->textureId()) {" to "if (!tile || !tile->textureId() || ((i + j) % 2) {" or "if (true) {" and you'll see what I mean.
Vangelis Kokkevis
Comment 4 2012-03-23 12:14:12 PDT
Comment on attachment 133521 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=133521&action=review It would also be nice if tile boundaries have different colors from layer borders. Some times it's hard to tell apart tiles from 256x256 layers (e.g. in maps). > Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp:39 > +static const int debugSurfaceBorderWidth = 2; Couldn't these be initialized directly as WebCore::Color's ?
Dana Jansens
Comment 5 2012-03-23 12:46:02 PDT
(In reply to comment #3) > (From update of attachment 133521 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=133521&action=review > > > Source/WebCore/ChangeLog:13 > > + of its debug quad. Reverse the ordering when appening to fix this > > + . > > s/appening to fix this\n./appending to fix it./ +1 > See! Things implicitly being in reverse order is confusing. ;) Indeed :/ > > Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:159 > > + if (hasDebugBorders()) { > > + Color color(debugTileBorderMissingTileRed, debugTileBorderMissingTileGreen, debugTileBorderMissingTileBlue, debugTileBorderAlpha); > > + quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState, tileRect, color, debugTileBorderWidth)); > > + } > > This doesn't seem right. This will interleave missing texture debug quads with normal quads, drawing over some of them. Yeh, you're right, the left edge would get erased by the tile beside it. I moved the debug borders stuff up to the top so all borders are appended, then content tiles. (In reply to comment #4) > (From update of attachment 133521 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=133521&action=review > > It would also be nice if tile boundaries have different colors from layer borders. Some times it's hard to tell apart tiles from 256x256 layers (e.g. in maps). Cyan! :) > > Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp:39 > > +static const int debugSurfaceBorderWidth = 2; > > Couldn't these be initialized directly as WebCore::Color's ? Yeh, I was trying to avoid the ire of reviewers for using static structs. I'll switch em to Colors.
Dana Jansens
Comment 6 2012-03-23 12:47:40 PDT
James Robinson
Comment 7 2012-03-23 12:48:53 PDT
Comment on attachment 133539 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=133539&action=review > Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp:42 > +static const Color debugSurfaceBorderColor(0, 0, 255); > +static const Color debugReplicaBorderColor(160, 0, 255); I believe these generate static initializers, so I'm going to go ahead and yell at you not to do this (or alternately confirm with the C++ standard that no static initializer is generated for this code)
Dana Jansens
Comment 8 2012-03-23 13:00:58 PDT
Interesting..It seems like the Color class can be staticly initialized? http://en.wikipedia.org/wiki/C%2B%2B11#Modification_to_the_definition_of_plain_old_data
Dana Jansens
Comment 9 2012-03-23 13:11:12 PDT
Created attachment 133545 [details] Patch Without static Color objects.
Dana Jansens
Comment 10 2012-03-23 13:27:00 PDT
For posterity, I spoke with James. Color seems to fit the definition of POD in C++11, but not in C++03, so no go on static instances. And it is safer anyhow to not treat it like POD, since anyone could change the Color class and break our assumptions.
Adrienne Walker
Comment 11 2012-03-23 13:53:39 PDT
Comment on attachment 133545 [details] Patch Excellent. Thanks for fixing this!
WebKit Review Bot
Comment 12 2012-03-23 14:46:15 PDT
Comment on attachment 133545 [details] Patch Clearing flags on attachment: 133545 Committed r111909: <http://trac.webkit.org/changeset/111909>
WebKit Review Bot
Comment 13 2012-03-23 14:46:20 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.