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

Unified Diff: cc/layers/ui_resource_layer.cc

Issue 664173002: Prevent recreation of UI resource holder when created with resource ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/ui_resource_layer.cc
diff --git a/cc/layers/ui_resource_layer.cc b/cc/layers/ui_resource_layer.cc
index 4293b09c5c10d6db58caa28a5b44052cbf9a3bb1..ebb4370b93d6d55d13076379436414b1434575cd 100644
--- a/cc/layers/ui_resource_layer.cc
+++ b/cc/layers/ui_resource_layer.cc
@@ -112,10 +112,16 @@ void UIResourceLayer::SetLayerTreeHost(LayerTreeHost* host) {
}
void UIResourceLayer::RecreateUIResourceHolder() {
+ UIResourceId ui_resource_id = 0;
awoloszyn 2014/10/21 14:29:41 If someone calls SetBitmap with an empty bitmap, w
Changwan Ryu 2014/10/21 17:28:57 Good idea. I overlooked it. Done.
+ if (ui_resource_holder_.get())
+ ui_resource_id = ui_resource_holder_->id();
+
ui_resource_holder_ = nullptr;
awoloszyn 2014/10/21 14:29:41 Something like // ui_resource_holder_ = nullptr; (
Changwan Ryu 2014/10/21 17:28:57 Done.
if (layer_tree_host() && !bitmap_.empty()) {
ui_resource_holder_ =
ScopedUIResourceHolder::Create(layer_tree_host(), bitmap_);
+ } else if (ui_resource_id != 0) {
+ ui_resource_holder_ = SharedUIResourceHolder::Create(ui_resource_id);
}
UpdateDrawsContent(HasDrawableContent());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698