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

Unified Diff: ui/aura/window.cc

Issue 12211121: Set the original external texture to new layer when it's copied to the old layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 84251126124a73826eba0e2902705ad7cd20139a..f43f0e0f3de19bd53bf84c386b400c2ea8342d4c 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -144,14 +144,22 @@ ui::Layer* Window::RecreateLayer() {
return NULL;
old_layer->set_delegate(NULL);
- if (delegate_ && old_layer->external_texture())
+ scoped_refptr<ui::Texture> old_texture = old_layer->external_texture();
+ if (delegate_ && old_texture)
old_layer->SetExternalTexture(delegate_->CopyTexture());
+
layer_ = new ui::Layer(old_layer->type());
layer_owner_.reset(layer_);
layer_->SetVisible(old_layer->visible());
layer_->set_scale_content(old_layer->scale_content());
layer_->set_delegate(this);
layer_->SetMasksToBounds(old_layer->GetMasksToBounds());
+ // Move the original texture to the new layer if the old layer has a
+ // texture and we could copy it into the old layer,
+ // crbug.com/175211.
+ if (delegate_ && old_texture)
sky 2013/02/12 03:31:54 This code is also hit when maximizing. Does settin
oshima 2013/02/12 04:03:23 I tested (un)maximizing as well and it looks fine.
sky 2013/02/12 17:01:24 When you maximize/restore we change the size immed
+ layer_->SetExternalTexture(old_texture);
+
UpdateLayerName(name_);
layer_->SetFillsBoundsOpaquely(!transparent_);
// Install new layer as a sibling of the old layer, stacked on top of it.
« 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