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

Side by Side Diff: ui/aura/local/window_port_local.cc

Issue 2875753002: Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: Fix build problem Created 3 years, 6 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 | « services/ui/ws/window_tree_client_unittest.cc ('k') | ui/aura/mus/window_mus.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 void WindowPortLocal::OnWillRemoveWindowFromRootWindow() { 123 void WindowPortLocal::OnWillRemoveWindowFromRootWindow() {
124 if (frame_sink_id_.is_valid()) 124 if (frame_sink_id_.is_valid())
125 window_->layer()->GetCompositor()->RemoveFrameSink(frame_sink_id_); 125 window_->layer()->GetCompositor()->RemoveFrameSink(frame_sink_id_);
126 } 126 }
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
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.
135 window_->layer()->SetBounds(
136 gfx::Rect(window_->layer()->bounds().origin(), surface_size));
137 cc::SurfaceInfo surface_info(surface_id, 1.0f, surface_size); 132 cc::SurfaceInfo surface_info(surface_id, 1.0f, surface_size);
138 scoped_refptr<cc::SurfaceReferenceFactory> reference_factory = 133 scoped_refptr<cc::SurfaceReferenceFactory> reference_factory =
139 aura::Env::GetInstance() 134 aura::Env::GetInstance()
140 ->context_factory_private() 135 ->context_factory_private()
141 ->GetSurfaceManager() 136 ->GetSurfaceManager()
142 ->reference_factory(); 137 ->reference_factory();
143 window_->layer()->SetShowPrimarySurface(surface_info, reference_factory); 138 window_->layer()->SetShowPrimarySurface(surface_info, reference_factory);
144 window_->layer()->SetFallbackSurface(surface_info); 139 window_->layer()->SetFallbackSurface(surface_info);
145 } 140 }
146 141
147 } // namespace aura 142 } // namespace aura
OLDNEW
« no previous file with comments | « services/ui/ws/window_tree_client_unittest.cc ('k') | ui/aura/mus/window_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698