Commit 77654fd1 authored by fsamuel's avatar fsamuel Committed by Commit bot

Aura-Mus: Avoid creating StubSurfaceReferenceFactory's on every surface ID change

BUG=none

Review-Url: https://codereview.chromium.org/2848273002
Cr-Commit-Position: refs/heads/master@{#468411}
parent fab67980
...@@ -46,14 +46,14 @@ ClientSurfaceEmbedder::ClientSurfaceEmbedder( ...@@ -46,14 +46,14 @@ ClientSurfaceEmbedder::ClientSurfaceEmbedder(
// this is the case with window decorations provided by Window Manager. // this is the case with window decorations provided by Window Manager.
// This content should appear underneath the content of the embedded client. // This content should appear underneath the content of the embedded client.
window_->layer()->StackAtTop(surface_layer_.get()); window_->layer()->StackAtTop(surface_layer_.get());
ref_factory_ = new StubSurfaceReferenceFactory();
} }
ClientSurfaceEmbedder::~ClientSurfaceEmbedder() = default; ClientSurfaceEmbedder::~ClientSurfaceEmbedder() = default;
void ClientSurfaceEmbedder::SetPrimarySurfaceInfo( void ClientSurfaceEmbedder::SetPrimarySurfaceInfo(
const cc::SurfaceInfo& surface_info) { const cc::SurfaceInfo& surface_info) {
surface_layer_->SetShowPrimarySurface( surface_layer_->SetShowPrimarySurface(surface_info, ref_factory_);
surface_info, make_scoped_refptr(new StubSurfaceReferenceFactory));
surface_layer_->SetBounds(gfx::Rect(window_->bounds().size())); surface_layer_->SetBounds(gfx::Rect(window_->bounds().size()));
} }
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
#include <memory> #include <memory>
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "cc/surfaces/surface_reference_factory.h"
#include "ui/gfx/geometry/insets.h" #include "ui/gfx/geometry/insets.h"
namespace cc { namespace cc {
...@@ -62,6 +64,8 @@ class ClientSurfaceEmbedder { ...@@ -62,6 +64,8 @@ class ClientSurfaceEmbedder {
gfx::Insets client_area_insets_; gfx::Insets client_area_insets_;
scoped_refptr<cc::SurfaceReferenceFactory> ref_factory_;
DISALLOW_COPY_AND_ASSIGN(ClientSurfaceEmbedder); DISALLOW_COPY_AND_ASSIGN(ClientSurfaceEmbedder);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment