Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Issue 11079012: Refactor CCLayerTreeHostCommon - merge visible rect computation into calc draw transforms. (Closed)

Created:
8 years, 2 months ago by shawnsingh
Modified:
8 years, 2 months ago
Reviewers:
epenner, enne (OOO)
CC:
chromium-reviews, cc-bugs_chromium.org, danakj, epenner
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Refactor CCLayerTreeHostCommon - merge visible rect computation into calc draw transforms. To aid the design of intelligent prepainting, and to clean up the code anyway, it's appropriate to do this. Unit tests are already in place that cover this refactoring. BUG=154442 R=enne@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=160676

Patch Set 1 #

Patch Set 2 : Removed unnecessary comment #

Patch Set 3 : fixed one more comment #

Patch Set 4 : Same patch without renaming calculateVisibleRect() #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -80 lines) Patch
M cc/CCDamageTrackerTest.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M cc/CCLayerIteratorTest.cpp View 3 chunks +0 lines, -3 lines 0 comments Download
M cc/CCLayerTreeHost.cpp View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M cc/CCLayerTreeHostCommon.h View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M cc/CCLayerTreeHostCommon.cpp View 1 2 3 5 chunks +33 lines, -49 lines 9 comments Download
M cc/CCLayerTreeHostCommonTest.cpp View 1 2 3 19 chunks +0 lines, -20 lines 0 comments Download
M cc/CCLayerTreeHostImpl.cpp View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M cc/CCOcclusionTrackerTest.cpp View 2 chunks +0 lines, -2 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
shawnsingh
This is a reboot of the patch from a few weeks ago. The old thread ...
8 years, 2 months ago (2012-10-06 02:23:27 UTC) #1
shawnsingh
8 years, 2 months ago (2012-10-06 02:29:27 UTC) #2
enne (OOO)
I like this cleanup in general, other than the rename.
8 years, 2 months ago (2012-10-08 00:15:57 UTC) #3
shawnsingh
On 2012/10/08 00:15:57, enne wrote: > I like this cleanup in general, other than the ...
8 years, 2 months ago (2012-10-08 16:53:33 UTC) #4
enne (OOO)
lgtm
8 years, 2 months ago (2012-10-08 17:06:02 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shawnsingh@chromium.org/11079012/11001
8 years, 2 months ago (2012-10-08 17:07:43 UTC) #6
commit-bot: I haz the power
Change committed as 160676
8 years, 2 months ago (2012-10-08 19:11:59 UTC) #7
epenner
Sorry for the lateness. https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp File cc/CCLayerTreeHostCommon.cpp (left): https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp#oldcode677 cc/CCLayerTreeHostCommon.cpp:677: if (ancestorClipsSubtree) It looks like ...
8 years, 2 months ago (2012-10-10 18:35:59 UTC) #8
shawnsingh
https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp File cc/CCLayerTreeHostCommon.cpp (left): https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp#oldcode677 cc/CCLayerTreeHostCommon.cpp:677: if (ancestorClipsSubtree) On 2012/10/10 18:35:59, epenner wrote: > It ...
8 years, 2 months ago (2012-10-10 19:54:56 UTC) #9
epenner
https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp File cc/CCLayerTreeHostCommon.cpp (left): https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp#oldcode677 cc/CCLayerTreeHostCommon.cpp:677: if (ancestorClipsSubtree) It looks like line 124 checks clipRect().isEmpty() ...
8 years, 2 months ago (2012-10-10 21:13:58 UTC) #10
shawnsingh
8 years, 2 months ago (2012-10-10 22:35:42 UTC) #11
https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp
File cc/CCLayerTreeHostCommon.cpp (left):

https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon....
cc/CCLayerTreeHostCommon.cpp:677: if (ancestorClipsSubtree)
On 2012/10/10 21:13:59, epenner wrote:
> It looks like line 124 checks clipRect().isEmpty() but there are two
conditions
> when it could be empty.
> 
> It seems to me like it should only ignore clipping if !ancestorClipsSubtree,
but
> return an empty visible rect if ancestorClipsSubtree.

I see what you are saying now - thanks for catching this!  By fluke, this would
still be technically "correct" because an empty rendersurface would have been
seen and accounted for later in calcDrawTransforms, but clearly this is a kink
that needs to be ironed out somehow.  Created crbug.com/155151 to continue with
this issue.

https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon.cpp
File cc/CCLayerTreeHostCommon.cpp (right):

https://codereview.chromium.org/11079012/diff/11001/cc/CCLayerTreeHostCommon....
cc/CCLayerTreeHostCommon.cpp:125: targetSurfaceClipRect =
layer->drawableContentRect();
On 2012/10/10 21:13:59, epenner wrote:
> IIUC The max texture size will limit the size of a render surface, but it will
> not limit the size of content that renders into that surface. So I'm worried
> that the visible content could be arbitrarily large.

Looks like the root of the problem is that we are not propagating clipRects
across surfaces.  However, originally Enne had a very strong reason not to do so
- because it will regularly change renderSurface sizes, causing things to be
less cacheable.  I'm guessing cache-ability (i.e. avoiding work entirely) takes
priority over intelligently being able to pre-paint (i.e. doing more work in
idle time)... so maybe we need to find another way to get the visibility
information here?

One option I can think of at this spontaneous moment - make another visibleRect
that does include propagating the clipRect across surfaces.  But I think you've
already considered that and we didn't go for that, right?

Powered by Google App Engine
This is Rietveld 408576698