Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index 03c6301c4903bcc8bb8f18f21d97f9955d1a215d..bc9f59c2279525f8a10626c28232ce295628de6b 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -182,13 +182,8 @@ std::unique_ptr<Layer> Layer::Clone() const { |
| // cc::Layer state. |
| if (surface_layer_ && surface_layer_->surface_id().is_valid()) { |
| - clone->SetShowSurface( |
| - surface_layer_->surface_id(), |
| - surface_layer_->satisfy_callback(), |
| - surface_layer_->require_callback(), |
| - surface_layer_->surface_size(), |
| - surface_layer_->surface_scale(), |
| - frame_size_in_dip_); |
| + clone->SetShowSurface(surface_layer_->surface_emb()->Clone(), |
|
Fady Samuel
2016/12/07 23:29:05
This is wrong I think. You want to create a new re
|
| + frame_size_in_dip_); |
| } else if (type_ == LAYER_SOLID_COLOR) { |
| clone->SetColor(GetTargetColor()); |
| } |
| @@ -657,18 +652,12 @@ bool Layer::TextureFlipped() const { |
| return texture_layer_->flipped(); |
| } |
| -void Layer::SetShowSurface( |
| - const cc::SurfaceId& surface_id, |
| - const cc::SurfaceLayer::SatisfyCallback& satisfy_callback, |
| - const cc::SurfaceLayer::RequireCallback& require_callback, |
| - gfx::Size surface_size, |
| - float scale, |
| - gfx::Size frame_size_in_dip) { |
| +void Layer::SetShowSurface(cc::SurfaceEmbeddingPtr surface_ref, |
| + gfx::Size frame_size_in_dip) { |
| DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); |
| scoped_refptr<cc::SurfaceLayer> new_layer = |
| - cc::SurfaceLayer::Create(satisfy_callback, require_callback); |
| - new_layer->SetSurfaceId(surface_id, scale, surface_size); |
| + cc::SurfaceLayer::Create(surface_ref->Clone()); |
|
Fady Samuel
2016/12/07 23:29:05
Why are you cloning here?
|
| SwitchToLayer(new_layer); |
| surface_layer_ = new_layer; |
| @@ -676,9 +665,7 @@ void Layer::SetShowSurface( |
| RecomputeDrawsContentAndUVRect(); |
| for (const auto& mirror : mirrors_) { |
| - mirror->dest()->SetShowSurface( |
| - surface_id, satisfy_callback, require_callback, |
| - surface_size, scale, frame_size_in_dip); |
| + mirror->dest()->SetShowSurface(surface_ref->Clone(), frame_size_in_dip); |
| } |
| } |