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

Issue 16211002: Skip drawing unsupported layers in forced software mode (Closed)

Created:
7 years, 6 months ago by boliu
Modified:
7 years, 6 months ago
CC:
chromium-reviews, cc-bugs_chromium.org
Visibility:
Public.

Description

Skip drawing unsupported layers in forced software mode Only draw PictureLayer, SolidColorLayer, and ScrollbarLayer if using solid color scrollbars. Changes contract of LayerImpl WillDraw/AppendQuads/DidDraw. Now WillDraw returns a bool, and AppendQuads/DidDraw will be skipped if it returns false. BUG=245047 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203637

Patch Set 1 #

Total comments: 2

Patch Set 2 : Address comments. Add test. #

Total comments: 2

Patch Set 3 : Address nits #

Total comments: 2

Patch Set 4 : bool WillDraw(DrawMode) #

Total comments: 2

Patch Set 5 : fix layers, cc_unittests compiles #

Patch Set 6 : Fix cc_unittests #

Total comments: 2

Patch Set 7 : Fix TextureLayerImpl. Add some tests. #

Patch Set 8 : Minor cleanups #

Patch Set 9 : Fix up GetDrawMode #

Patch Set 10 : rebase on r203584 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+312 lines, -80 lines) Patch
M cc/layers/append_quads_data.h View 1 2 3 1 chunk +2 lines, -6 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/layers/delegated_renderer_layer_impl.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M cc/layers/heads_up_display_layer_impl.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/heads_up_display_layer_impl.cc View 1 2 3 2 chunks +6 lines, -2 lines 0 comments Download
M cc/layers/io_surface_layer_impl.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/io_surface_layer_impl.cc View 1 2 3 2 chunks +7 lines, -3 lines 0 comments Download
M cc/layers/layer_impl.h View 1 2 3 4 5 6 7 3 chunks +16 lines, -6 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 3 chunks +10 lines, -15 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/layers/nine_patch_layer_impl.cc View 1 2 3 4 1 chunk +8 lines, -2 lines 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/picture_layer_impl_unittest.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/scrollbar_layer_impl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/layers/scrollbar_layer_impl.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 1 comment Download
M cc/layers/texture_layer_impl.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/texture_layer_impl.cc View 1 2 3 4 5 6 2 chunks +16 lines, -10 lines 0 comments Download
M cc/layers/texture_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +67 lines, -1 line 0 comments Download
M cc/layers/tiled_layer_impl.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M cc/layers/tiled_layer_impl.cc View 1 2 3 4 1 chunk +13 lines, -4 lines 0 comments Download
M cc/layers/tiled_layer_impl_unittest.cc View 1 2 3 4 5 3 chunks +5 lines, -3 lines 0 comments Download
M cc/layers/video_layer_impl.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/video_layer_impl.cc View 1 2 3 4 5 6 7 8 9 5 chunks +13 lines, -9 lines 1 comment Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 4 chunks +15 lines, -4 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 3 chunks +100 lines, -9 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
boliu
Alex for first pass. Test forthcoming
7 years, 6 months ago (2013-05-29 22:02:12 UTC) #1
aelias_OOO_until_Jul13
Also, let's add it to ScrollbarLayerImpl and there return "return layer_tree_impl()->settings().solid_color_scrollbars;". https://codereview.chromium.org/16211002/diff/1/cc/trees/layer_tree_host_impl.cc File cc/trees/layer_tree_host_impl.cc (right): ...
7 years, 6 months ago (2013-05-29 22:30:47 UTC) #2
boliu
Added test. ScrollbarLayerImpl change done. https://codereview.chromium.org/16211002/diff/1/cc/trees/layer_tree_host_impl.cc File cc/trees/layer_tree_host_impl.cc (right): https://codereview.chromium.org/16211002/diff/1/cc/trees/layer_tree_host_impl.cc#newcode642 cc/trees/layer_tree_host_impl.cc:642: } else if (!output_surface_->ForcedDrawToSoftwareDevice() ...
7 years, 6 months ago (2013-05-30 00:01:28 UTC) #3
aelias_OOO_until_Jul13
Looks fine to me, adding enne@ for OWNERS. https://codereview.chromium.org/16211002/diff/5001/cc/trees/layer_tree_host_impl.cc File cc/trees/layer_tree_host_impl.cc (right): https://codereview.chromium.org/16211002/diff/5001/cc/trees/layer_tree_host_impl.cc#newcode616 cc/trees/layer_tree_host_impl.cc:616: append_quads_data.allow_tile_draw_quads ...
7 years, 6 months ago (2013-05-30 00:46:51 UTC) #4
enne (OOO)
https://codereview.chromium.org/16211002/diff/11001/cc/layers/layer_impl.h File cc/layers/layer_impl.h (right): https://codereview.chromium.org/16211002/diff/11001/cc/layers/layer_impl.h#newcode422 cc/layers/layer_impl.h:422: virtual bool CanDrawInTilelessSoftwareMode() const; I am generally averse to ...
7 years, 6 months ago (2013-05-30 17:04:37 UTC) #5
boliu
First cut. WillDraw takes a DrawMode enum and returns a bool. If it returns false, ...
7 years, 6 months ago (2013-05-30 20:32:51 UTC) #6
enne (OOO)
Thanks. It's a bit more verbose, but I like this direction a lot better. Those ...
7 years, 6 months ago (2013-05-30 22:09:09 UTC) #7
piman
https://codereview.chromium.org/16211002/diff/16001/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/16211002/diff/16001/cc/layers/texture_layer_impl.cc#newcode70 cc/layers/texture_layer_impl.cc:70: return false; if uses_mailbox_ and we're not in DRAW_MODE_RESOURCELESS_SOFTWARE ...
7 years, 6 months ago (2013-05-30 22:18:17 UTC) #8
boliu
Went through all the layers and tried to move early outs in AppendQuads into WillDraw ...
7 years, 6 months ago (2013-05-31 00:09:07 UTC) #9
enne (OOO)
On 2013/05/31 00:09:07, boliu wrote: > Went through all the layers and tried to move ...
7 years, 6 months ago (2013-05-31 00:24:37 UTC) #10
piman
https://codereview.chromium.org/16211002/diff/25001/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/16211002/diff/25001/cc/layers/texture_layer_impl.cc#newcode70 cc/layers/texture_layer_impl.cc:70: return false; still nak, because if uses_mailbox_, then texture_id_ ...
7 years, 6 months ago (2013-05-31 00:48:14 UTC) #11
boliu
Added tests. Ready for more thorough review now. https://codereview.chromium.org/16211002/diff/25001/cc/layers/texture_layer_impl.cc File cc/layers/texture_layer_impl.cc (right): https://codereview.chromium.org/16211002/diff/25001/cc/layers/texture_layer_impl.cc#newcode70 cc/layers/texture_layer_impl.cc:70: return ...
7 years, 6 months ago (2013-05-31 02:50:07 UTC) #12
enne (OOO)
lgtm
7 years, 6 months ago (2013-05-31 16:58:08 UTC) #13
boliu
piman: Could you take a look at texture layer again?
7 years, 6 months ago (2013-05-31 17:55:41 UTC) #14
piman
LGTM, thanks for the extra tests!
7 years, 6 months ago (2013-05-31 18:08:41 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/16211002/33001
7 years, 6 months ago (2013-05-31 18:18:15 UTC) #16
boliu
Alex pointed out that GetDraw had a mistake. ForcedDrawToSoftwareDevice() need to override context3d() and software_device(). ...
7 years, 6 months ago (2013-05-31 23:34:47 UTC) #17
aelias_OOO_until_Jul13
New GetDrawMode() logic LGTM.
7 years, 6 months ago (2013-05-31 23:37:21 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/16211002/61001
7 years, 6 months ago (2013-05-31 23:37:39 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/16211002/74001
7 years, 6 months ago (2013-06-02 19:54:30 UTC) #20
commit-bot: I haz the power
Change committed as 203637
7 years, 6 months ago (2013-06-02 23:48:00 UTC) #21
danakj
Nice change! I think a couple layers got missed in the later refactors of the ...
7 years, 6 months ago (2013-06-04 15:30:43 UTC) #22
boliu
On 2013/06/04 15:30:43, danakj wrote: > Nice change! I think a couple layers got missed ...
7 years, 6 months ago (2013-06-04 15:39:08 UTC) #23
danakj
7 years, 6 months ago (2013-06-04 15:45:04 UTC) #24
On Tue, Jun 4, 2013 at 11:39 AM, <boliu@chromium.org> wrote:

> On 2013/06/04 15:30:43, danakj wrote:
>
>> Nice change! I think a couple layers got missed in the later refactors of
>> the
>>
> CL
>
>> though?
>>
>
>
> https://codereview.chromium.**org/16211002/diff/74001/cc/**
>
layers/scrollbar_layer_impl.cc<https://codereview.chromium.org/16211002/diff/74001/cc/layers/scrollbar_layer_impl.cc>
>
>> File cc/layers/scrollbar_layer_**impl.cc (right):
>>
>
>
> https://codereview.chromium.**org/16211002/diff/74001/cc/**
>
layers/scrollbar_layer_impl.**cc#newcode79<https://codereview.chromium.org/16211002/diff/74001/cc/layers/scrollbar_layer_impl.cc#newcode79>
>
>> cc/layers/scrollbar_layer_**impl.cc:79: LayerImpl::WillDraw(draw_mode,
>> resource_provider);
>> This call should only be made when returning true right? And it should
>>
> early-out
>
>> before it when the return will be false?
>>
>
>
> https://codereview.chromium.**org/16211002/diff/74001/cc/**
>
layers/video_layer_impl.cc<https://codereview.chromium.org/16211002/diff/74001/cc/layers/video_layer_impl.cc>
>
>> File cc/layers/video_layer_impl.cc (right):
>>
>
>
> https://codereview.chromium.**org/16211002/diff/74001/cc/**
>
layers/video_layer_impl.cc#**newcode94<https://codereview.chromium.org/16211002/diff/74001/cc/layers/video_layer_impl.cc#newcode94>
>
>> cc/layers/video_layer_impl.cc:**94: LayerImpl::WillDraw(draw_mode,
>> resource_provider);
>> In other layers we always return this value. Should we return false here
>> if
>>
> this
>
>> returns false?
>>
>
> These two are semi-sketchy dependency on the fact that LayerImpl::WillDraw
> is
> essentially no-op and always returns true. I thought about make it a
> protected
> helper method and make WillDraw pure virtual in LayerImpl, but LayerImpl
> is a
> concrete class.
>

Yeh. I'm just thinking about the fact that it could now return false one
day for some reason we don't forsee, and then these would break.


>
> I can send a fix up to remove this dependency.
>
>
https://codereview.chromium.**org/16211002/<https://codereview.chromium.org/1...
>

Powered by Google App Engine
This is Rietveld 408576698