Index: cc/layers/picture_layer_impl.cc |
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc |
index 6d37b7f4db2f449caaa7a444ad12b904782c7e22..f3c2af1edd7e5f40ede34da66942e8e96687bb74 100644 |
--- a/cc/layers/picture_layer_impl.cc |
+++ b/cc/layers/picture_layer_impl.cc |
@@ -64,13 +64,12 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, int id) |
was_animating_transform_to_screen_(false), |
is_using_lcd_text_(tree_impl->settings().can_use_lcd_text), |
needs_post_commit_initialization_(true), |
- should_update_tile_priorities_(false), |
- layer_needs_to_register_itself_(true) { |
+ should_update_tile_priorities_(false) { |
+ layer_tree_impl()->RegisterPictureLayerImpl(this); |
} |
PictureLayerImpl::~PictureLayerImpl() { |
- if (!layer_needs_to_register_itself_) |
- layer_tree_impl()->tile_manager()->UnregisterPictureLayerImpl(this); |
+ layer_tree_impl()->UnregisterPictureLayerImpl(this); |
} |
const char* PictureLayerImpl::LayerTypeAsString() const { |
@@ -373,23 +372,12 @@ void PictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
CleanUpTilingsOnActiveLayer(seen_tilings); |
} |
-void PictureLayerImpl::DidUnregisterLayer() { |
- TRACE_EVENT0("cc", "PictureLayerImpl::DidUnregisterLayer"); |
- |
- layer_needs_to_register_itself_ = true; |
-} |
- |
void PictureLayerImpl::UpdateTilePriorities() { |
TRACE_EVENT0("cc", "PictureLayerImpl::UpdateTilePriorities"); |
DCHECK(!needs_post_commit_initialization_); |
CHECK(should_update_tile_priorities_); |
- if (layer_needs_to_register_itself_) { |
- layer_tree_impl()->tile_manager()->RegisterPictureLayerImpl(this); |
- layer_needs_to_register_itself_ = false; |
- } |
- |
if (layer_tree_impl()->device_viewport_valid_for_tile_management()) { |
visible_rect_for_tile_priority_ = visible_content_rect(); |
viewport_size_for_tile_priority_ = layer_tree_impl()->DrawViewportSize(); |
@@ -1392,8 +1380,12 @@ bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
return !layer_tree_impl()->IsRecycleTree(); |
} |
+bool PictureLayerImpl::HasValidTilePriorities() const { |
+ return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
+} |
+ |
bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
- if (!layer_tree_impl()->IsPendingTree()) |
vmpstr
2014/06/11 19:00:35
As an optimization, it might still be worth to kee
reveman
2014/06/11 20:09:00
Done.
|
+ if (!HasValidTilePriorities()) |
return true; |
if (!tilings_) |