Bug 74893 - [chromium] Make sure rootDamageRect gets passed to renderer
Summary: [chromium] Make sure rootDamageRect gets passed to renderer
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shawn Singh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-19 15:24 PST by Shawn Singh
Modified: 2012-01-03 16:34 PST (History)
5 users (show)

See Also:


Attachments
Patch (11.90 KB, patch)
2011-12-19 18:59 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
addressed nits and added one more case to unit test (13.38 KB, patch)
2011-12-19 20:35 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
updated to close to tip of tree (13.62 KB, patch)
2012-01-03 11:00 PST, Shawn Singh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Singh 2011-12-19 15:24:06 PST
In the process of refactoring, the root damage rect got "disconnected" from where it is used to perform the partial swap.  The fix is very straightforward, and works fine.  However, I would like to add a unit test to make sure this does not happen again.  An effective unit test needs to mock the "getExtensions()" accessor, so we can pretend that partial swap is supported.  Currently getExtensions() is implemented as non-virtual in un-mockable GraphicsContext3DPrivate.

Is it OK to move the implementation of getExtensions() from GraphicsContext3DPrivate into WebGraphicsContext3D, where we can make it virtual and mock-able?  or is there some reason not to do this?
Comment 1 James Robinson 2011-12-19 15:54:54 PST
Extensions3DChromium simply thunks to WebGraphicsContext3D for all of its operations and WebGraphicsContext3D is fully virtual and easy to mock. I don't understand why you would need more. Is there some scenario that you can't mock out today?
Comment 2 Shawn Singh 2011-12-19 18:29:59 PST
Thanks, it works exactly as you suggested.  Will post a patch soon.
Comment 3 James Robinson 2011-12-19 18:39:35 PST
OK cool, glad that worked.

If it helps shuffling around all of the Platform headers should make it pretty easy for us to cut out at least one layer of indirection in our GraphicsContext3D->WebGraphicsContext3D mappings.
Comment 4 Shawn Singh 2011-12-19 18:59:11 PST
Created attachment 119972 [details]
Patch

This patch has (1) the fix itself (2) appropriate unit test (3) drive-by style fix on ordering of include files.
Comment 5 James Robinson 2011-12-19 19:07:08 PST
Comment on attachment 119972 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=119972&action=review

haven't looked through full patch, just some drive by nits for now. will try to look at this later

> Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h:108
> +    void swapBuffers(IntRect subBuffer);

we typically pass IntRects by const ref, can we do that here?

> Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:311
> +    FakeDrawableCCLayerImpl(int id) : CCLayerImpl(id) { }

nit: explicit

> Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp:337
> +class PartialSwapTrackerContext: public MockWebGraphicsContext3D {

nit: space between PartialSwapTrackerContext and the :
Comment 6 Shawn Singh 2011-12-19 20:35:32 PST
Created attachment 119981 [details]
addressed nits and added one more case to unit test
Comment 7 Shawn Singh 2012-01-03 11:00:59 PST
Created attachment 120960 [details]
updated to close to tip of tree
Comment 8 James Robinson 2012-01-03 11:06:54 PST
Comment on attachment 120960 [details]
updated to close to tip of tree

R=me
Comment 9 WebKit Review Bot 2012-01-03 16:34:21 PST
Comment on attachment 120960 [details]
updated to close to tip of tree

Clearing flags on attachment: 120960

Committed r103988: <http://trac.webkit.org/changeset/103988>
Comment 10 WebKit Review Bot 2012-01-03 16:34:26 PST
All reviewed patches have been landed.  Closing bug.