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

Unified Diff: ui/aura/window.cc

Issue 15001027: [Aura] Added Support for rendering software compositor frames as cc::TextureLayers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More changes from the notes. Created 7 years, 7 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: ui/aura/window.cc
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index c1f7487309be081a743a3e1696c245d952f05976..bbb1ccd8901255934f59c488cd3b76801ed16ff9 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -145,6 +145,9 @@ ui::Layer* Window::RecreateLayer() {
return NULL;
old_layer->set_delegate(NULL);
+ float mailbox_scale_factor;
+ cc::TextureMailbox mailbox =
+ old_layer->GetTextureMailbox(&mailbox_scale_factor);
scoped_refptr<ui::Texture> old_texture = old_layer->external_texture();
if (delegate_ && old_texture)
old_layer->SetExternalTexture(delegate_->CopyTexture());
@@ -160,6 +163,8 @@ ui::Layer* Window::RecreateLayer() {
// crbug.com/175211.
if (delegate_ && old_texture)
layer_->SetExternalTexture(old_texture);
+ else if (mailbox.IsValid())
+ layer_->SetTextureMailbox(mailbox, mailbox_scale_factor);
UpdateLayerName(name_);
layer_->SetFillsBoundsOpaquely(!transparent_);
@@ -313,10 +318,6 @@ void Window::SchedulePaintInRect(const gfx::Rect& rect) {
}
}
-void Window::SetExternalTexture(ui::Texture* texture) {
- layer_->SetExternalTexture(texture);
-}
-
void Window::SetDefaultParentByRootWindow(RootWindow* root_window,
const gfx::Rect& bounds_in_screen) {
DCHECK(root_window);
« cc/resources/texture_mailbox.cc ('K') | « ui/aura/window.h ('k') | ui/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698