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

Side by Side Diff: ui/aura/mus/client_surface_embedder.cc

Issue 2848273002: Aura-Mus: Avoid creating StubSurfaceReferenceFactory's on every surface ID change (Closed)
Patch Set: Created 3 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 unified diff | Download patch
« no previous file with comments | « ui/aura/mus/client_surface_embedder.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/aura/mus/client_surface_embedder.h" 5 #include "ui/aura/mus/client_surface_embedder.h"
6 6
7 #include "cc/surfaces/surface_reference_factory.h" 7 #include "cc/surfaces/surface_reference_factory.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 9
10 namespace aura { 10 namespace aura {
(...skipping 28 matching lines...) Expand all
39 // The frame provided by the parent window->layer() needs to show through 39 // The frame provided by the parent window->layer() needs to show through
40 // the surface layer. 40 // the surface layer.
41 surface_layer_->SetFillsBoundsOpaquely(false); 41 surface_layer_->SetFillsBoundsOpaquely(false);
42 42
43 window_->layer()->Add(surface_layer_.get()); 43 window_->layer()->Add(surface_layer_.get());
44 44
45 // Window's layer may contain content from this client (the embedder), e.g. 45 // Window's layer may contain content from this client (the embedder), e.g.
46 // this is the case with window decorations provided by Window Manager. 46 // this is the case with window decorations provided by Window Manager.
47 // This content should appear underneath the content of the embedded client. 47 // This content should appear underneath the content of the embedded client.
48 window_->layer()->StackAtTop(surface_layer_.get()); 48 window_->layer()->StackAtTop(surface_layer_.get());
49 ref_factory_ = new StubSurfaceReferenceFactory();
49 } 50 }
50 51
51 ClientSurfaceEmbedder::~ClientSurfaceEmbedder() = default; 52 ClientSurfaceEmbedder::~ClientSurfaceEmbedder() = default;
52 53
53 void ClientSurfaceEmbedder::SetPrimarySurfaceInfo( 54 void ClientSurfaceEmbedder::SetPrimarySurfaceInfo(
54 const cc::SurfaceInfo& surface_info) { 55 const cc::SurfaceInfo& surface_info) {
55 surface_layer_->SetShowPrimarySurface( 56 surface_layer_->SetShowPrimarySurface(surface_info, ref_factory_);
56 surface_info, make_scoped_refptr(new StubSurfaceReferenceFactory));
57 surface_layer_->SetBounds(gfx::Rect(window_->bounds().size())); 57 surface_layer_->SetBounds(gfx::Rect(window_->bounds().size()));
58 } 58 }
59 59
60 void ClientSurfaceEmbedder::SetFallbackSurfaceInfo( 60 void ClientSurfaceEmbedder::SetFallbackSurfaceInfo(
61 const cc::SurfaceInfo& surface_info) { 61 const cc::SurfaceInfo& surface_info) {
62 surface_layer_->SetFallbackSurface(surface_info); 62 surface_layer_->SetFallbackSurface(surface_info);
63 UpdateSizeAndGutters(); 63 UpdateSizeAndGutters();
64 } 64 }
65 65
66 void ClientSurfaceEmbedder::UpdateSizeAndGutters() { 66 void ClientSurfaceEmbedder::UpdateSizeAndGutters() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 bottom_gutter_->SetBounds( 98 bottom_gutter_->SetBounds(
99 gfx::Rect(0, fallback_surface_size.height(), width, height)); 99 gfx::Rect(0, fallback_surface_size.height(), width, height));
100 window_->layer()->Add(bottom_gutter_.get()); 100 window_->layer()->Add(bottom_gutter_.get());
101 } else { 101 } else {
102 bottom_gutter_.reset(); 102 bottom_gutter_.reset();
103 } 103 }
104 window_->layer()->StackAtTop(surface_layer_.get()); 104 window_->layer()->StackAtTop(surface_layer_.get());
105 } 105 }
106 106
107 } // namespace aura 107 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/client_surface_embedder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698