diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-02 23:47:59 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-02 23:47:59 +0000 |
commit | ffbb221c8dc7acd0dbe202d569c3d4b9a62fafb0 (patch) | |
tree | 4ba55c15fbd05cb32da487e4647610f9cf2c96ad /cc/layers/tiled_layer_impl.cc | |
parent | ff875be5f3f3db4cdc5bbfe4a014580867c7a044 (diff) | |
download | chromium_src-ffbb221c8dc7acd0dbe202d569c3d4b9a62fafb0.zip chromium_src-ffbb221c8dc7acd0dbe202d569c3d4b9a62fafb0.tar.gz chromium_src-ffbb221c8dc7acd0dbe202d569c3d4b9a62fafb0.tar.bz2 |
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
Review URL: https://chromiumcodereview.appspot.com/16211002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203637 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/tiled_layer_impl.cc')
-rw-r--r-- | cc/layers/tiled_layer_impl.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/cc/layers/tiled_layer_impl.cc b/cc/layers/tiled_layer_impl.cc index 4489d85..9aa5251 100644 --- a/cc/layers/tiled_layer_impl.cc +++ b/cc/layers/tiled_layer_impl.cc @@ -155,13 +155,22 @@ void TiledLayerImpl::PushPropertiesTo(LayerImpl* layer) { } } +bool TiledLayerImpl::WillDraw(DrawMode draw_mode, + ResourceProvider* resource_provider) { + if (!tiler_ || tiler_->has_empty_bounds() || + visible_content_rect().IsEmpty() || + draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) + return false; + return LayerImpl::WillDraw(draw_mode, resource_provider); +} + void TiledLayerImpl::AppendQuads(QuadSink* quad_sink, AppendQuadsData* append_quads_data) { - gfx::Rect content_rect = visible_content_rect(); - - if (!tiler_ || tiler_->has_empty_bounds() || content_rect.IsEmpty()) - return; + DCHECK(tiler_); + DCHECK(!tiler_->has_empty_bounds()); + DCHECK(!visible_content_rect().IsEmpty()); + gfx::Rect content_rect = visible_content_rect(); SharedQuadState* shared_quad_state = quad_sink->UseSharedQuadState(CreateSharedQuadState()); AppendDebugBorderQuad(quad_sink, shared_quad_state, append_quads_data); |