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

Unified Diff: cc/layers/picture_layer_impl.cc

Issue 322443002: cc: Refactor how picture layers are exposed to the tile manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_)
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/picture_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698