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

Unified Diff: ui/compositor/layer.cc

Issue 2873593002: Force use of and cache render surface. (Closed)
Patch Set: Rebased to resolve conflict. Created 3 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
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 9d00f20fa754873b6df2c552c09e5b85c97eac9f..6f2ac6c5b6a06c625c14d91316b7f104d99d4cf6 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -626,6 +626,7 @@ void Layer::SwitchToLayer(scoped_refptr<cc::Layer> new_layer) {
new_layer->SetTransform(cc_layer_->transform());
new_layer->SetPosition(cc_layer_->position());
new_layer->SetBackgroundColor(cc_layer_->background_color());
+ new_layer->SetCacheRenderSurface(cc_layer_->cache_render_surface());
cc_layer_ = new_layer.get();
content_layer_ = NULL;
@@ -654,6 +655,15 @@ void Layer::SwitchCCLayerForTest() {
content_layer_ = new_layer;
}
+// Note: The code that sets this flag would be responsible to unset it on that
+// ui::Layer. We do not want to clone this flag to a cloned layer by accident,
+// which could be a supprise. But we want to preserve it after switching to a
+// new cc::Layer. There could be a whole subtree and the root changed, but does
+// not mean we want to treat the cache all different.
+void Layer::SetCacheRenderSurface(bool cache_render_surface) {
+ cc_layer_->SetCacheRenderSurface(cache_render_surface);
+}
+
void Layer::SetTextureMailbox(
const viz::TextureMailbox& mailbox,
std::unique_ptr<viz::SingleReleaseCallback> release_callback,
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698