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

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: fix tile manager perf tests 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 4cdabdab7f998a20815db78f9e59bb48dd36cd1e..d45b562397fbe3a4112d5eb30170f1e13f242cc6 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();
@@ -1405,10 +1393,17 @@ 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())
return true;
+ if (!HasValidTilePriorities())
+ return true;
+
if (!tilings_)
return true;
« 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