| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/local/window_port_local.h" | 5 #include "ui/aura/local/window_port_local.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/surface_manager.h" | 7 #include "cc/surfaces/surface_manager.h" |
| 8 #include "ui/aura/client/cursor_client.h" | 8 #include "ui/aura/client/cursor_client.h" |
| 9 #include "ui/aura/env.h" | 9 #include "ui/aura/env.h" |
| 10 #include "ui/aura/local/compositor_frame_sink_local.h" | 10 #include "ui/aura/local/compositor_frame_sink_local.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 void WindowPortLocal::OnSurfaceChanged(const cc::SurfaceId& surface_id, | 128 void WindowPortLocal::OnSurfaceChanged(const cc::SurfaceId& surface_id, |
| 129 const gfx::Size& surface_size) { | 129 const gfx::Size& surface_size) { |
| 130 DCHECK_EQ(surface_id.frame_sink_id(), frame_sink_id_); | 130 DCHECK_EQ(surface_id.frame_sink_id(), frame_sink_id_); |
| 131 local_surface_id_ = surface_id.local_surface_id(); | 131 local_surface_id_ = surface_id.local_surface_id(); |
| 132 // The bounds must be updated before switching to the new surface, because | 132 // The bounds must be updated before switching to the new surface, because |
| 133 // the layer may be mirrored, in which case a surface change causes the | 133 // the layer may be mirrored, in which case a surface change causes the |
| 134 // mirror layer to update its surface using the latest bounds. | 134 // mirror layer to update its surface using the latest bounds. |
| 135 window_->layer()->SetBounds( | 135 window_->layer()->SetBounds( |
| 136 gfx::Rect(window_->layer()->bounds().origin(), surface_size)); | 136 gfx::Rect(window_->layer()->bounds().origin(), surface_size)); |
| 137 window_->layer()->SetShowPrimarySurface( | 137 cc::SurfaceInfo surface_info(surface_id, 1.0f, surface_size); |
| 138 cc::SurfaceInfo(surface_id, 1.0f, surface_size), | 138 scoped_refptr<cc::SurfaceReferenceFactory> reference_factory = |
| 139 aura::Env::GetInstance() | 139 aura::Env::GetInstance() |
| 140 ->context_factory_private() | 140 ->context_factory_private() |
| 141 ->GetSurfaceManager() | 141 ->GetSurfaceManager() |
| 142 ->reference_factory()); | 142 ->reference_factory(); |
| 143 window_->layer()->SetShowPrimarySurface(surface_info, reference_factory); |
| 144 window_->layer()->SetFallbackSurface(surface_info); |
| 143 } | 145 } |
| 144 | 146 |
| 145 } // namespace aura | 147 } // namespace aura |
| OLD | NEW |