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

Unified Diff: cc/layers/ui_resource_layer.cc

Issue 373113003: Keeping track of descendants that draw content instead of recalcualting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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/ui_resource_layer.cc
diff --git a/cc/layers/ui_resource_layer.cc b/cc/layers/ui_resource_layer.cc
index b26ebaa6cceb71fb2c43b53fcbeaf7c289057b56..fca9a14844b0176e18afe502700588b08a8108f9 100644
--- a/cc/layers/ui_resource_layer.cc
+++ b/cc/layers/ui_resource_layer.cc
@@ -113,11 +113,14 @@ void UIResourceLayer::SetLayerTreeHost(LayerTreeHost* host) {
void UIResourceLayer::RecreateUIResourceHolder() {
ui_resource_holder_.reset();
- if (!layer_tree_host() || bitmap_.empty())
+ if (!layer_tree_host() || bitmap_.empty()) {
danakj 2014/07/17 17:21:25 can you invert this and drop teh early out so we o
awoloszyn 2014/07/17 20:45:00 Done.
+ UpdateDrawsContent(HasDrawableContent());
return;
+ }
ui_resource_holder_ =
ScopedUIResourceHolder::Create(layer_tree_host(), bitmap_);
+ UpdateDrawsContent(HasDrawableContent());
}
void UIResourceLayer::SetBitmap(const SkBitmap& skbitmap) {
@@ -137,12 +140,13 @@ void UIResourceLayer::SetUIResourceId(UIResourceId resource_id) {
ui_resource_holder_.reset();
}
+ UpdateDrawsContent(HasDrawableContent());
SetNeedsCommit();
}
-bool UIResourceLayer::DrawsContent() const {
+bool UIResourceLayer::HasDrawableContent() const {
return ui_resource_holder_ && ui_resource_holder_->id() &&
- Layer::DrawsContent();
+ Layer::HasDrawableContent();
}
void UIResourceLayer::PushPropertiesTo(LayerImpl* layer) {

Powered by Google App Engine
This is Rietveld 408576698