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

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
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..f793e3defa24b999127ff717671bac026943cd10 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,6 +1380,10 @@ bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
return !layer_tree_impl()->IsRecycleTree();
}
+bool PictureLayerImpl::IsViableSourceOfRasterAndEvictionTiles() const {
reveman 2014/06/05 22:15:18 What else is needed here? Does UpdateTilePrioritie
vmpstr 2014/06/05 22:38:01 IsDrawnRenderSurfaceLayerListMember being true imp
reveman 2014/06/06 17:27:24 We'll handle that as discussed. Renamed this funct
+ return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
+}
+
bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const {
if (!layer_tree_impl()->IsPendingTree())
return true;

Powered by Google App Engine
This is Rietveld 408576698