Summary: | [chromium] Enable tracking opaque region in Skia graphics context, return it from LayerTextureUpdater | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dana Jansens <danakj> | ||||||||
Component: | New Bugs | Assignee: | Dana Jansens <danakj> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | backer, cc-bugs, dglazkov, enne, jamesr, piman, reveman, webkit.review.bot | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | 74352 | ||||||||||
Bug Blocks: | 76015 | ||||||||||
Attachments: |
|
Description
Dana Jansens
2012-01-12 14:00:47 PST
Created attachment 122308 [details]
Patch
- Compute an opaque area in the Skia graphics context when the layer isn't known to be fully opaque already.
- Save the opaque area given back by Skia's graphics context in the LayerTextureUpdater.
- Pass on the opaque() flag equally to all LayerTextureUpdaters for possible optimizations.
(EWS is going to fail until CQ lands #74352.) Comment on attachment 122308 [details] Patch Attachment 122308 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/11152216 Created attachment 122314 [details]
Patch
rebased
Comment on attachment 122314 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=122314&action=review > Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h:81 > + // A subset of the layer determined to be opaque during update. Not valid when setOpaque() has been set true, > + // as the output is already known to be opaque in that case. > + const IntRect& opaqueRect() const { return m_opaqueRect; } this is a little weird. the way this works seems to be that every given call to prepareToUpdate() could potentially update this rectangle to be a part of the passed in contentRect, but the opaqueRect isn't valid for any future call to prepareToUpdate(). since we could call prepareToUpdate() many times on an updater with different content rects it seems like this would be better implemented as an output parameter to prepareToUpdate(). what would you think of that? > Source/WebKit/chromium/tests/SkPictureCanvasLayerTextureUpdaterTest.cpp:68 > + updater->prepareToUpdate(IntRect(0, 0, width, height), IntSize(width, height), 0, 1.0); \ just 1, not 1.0 > Source/WebKit/chromium/tests/SkPictureCanvasLayerTextureUpdaterTest.cpp:82 > + Color opaque(1.0f, 0.0f, 0.0f, 1.0f); WK style is (1, 0, 0, 1) or just (1, 0, 0). same goes for the rest of this file Comment on attachment 122314 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=122314&action=review >> Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h:81 >> + const IntRect& opaqueRect() const { return m_opaqueRect; } > > this is a little weird. the way this works seems to be that every given call to prepareToUpdate() could potentially update this rectangle to be a part of the passed in contentRect, but the opaqueRect isn't valid for any future call to prepareToUpdate(). since we could call prepareToUpdate() many times on an updater with different content rects it seems like this would be better implemented as an output parameter to prepareToUpdate(). what would you think of that? yes absolutely. thanks. I added a rect to pass to prepareToUpdate() then, which is not used at all, as a local variable in prepareToUpdateTiles. Next CL will remove this as stated in the FIXME, just trying to keep CLs small. >> Source/WebKit/chromium/tests/SkPictureCanvasLayerTextureUpdaterTest.cpp:68 >> + updater->prepareToUpdate(IntRect(0, 0, width, height), IntSize(width, height), 0, 1.0); \ > > just 1, not 1.0 done. >> Source/WebKit/chromium/tests/SkPictureCanvasLayerTextureUpdaterTest.cpp:82 >> + Color opaque(1.0f, 0.0f, 0.0f, 1.0f); > > WK style is (1, 0, 0, 1) or just (1, 0, 0). same goes for the rest of this file oops, i tried 1.0 but ints (255) obviously work here, thanks. Created attachment 122545 [details]
Patch
comments addressed.
- Since the opaqueRect is being returned from all texture updaters, I made BitmapCanvasLayerTextureUpdater compute the resultingOpaqueRect also.
Comment on attachment 122545 [details]
Patch
This looks great to me. :)
Comment on attachment 122545 [details]
Patch
R=me
Comment on attachment 122545 [details] Patch Clearing flags on attachment: 122545 Committed r105314: <http://trac.webkit.org/changeset/105314> All reviewed patches have been landed. Closing bug. |