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

Side by Side Diff: components/exo/pointer.cc

Issue 2041193006: exo: Only create new SurfaceLayer if layer properties change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | components/exo/shell_surface.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/pointer.h" 5 #include "components/exo/pointer.h"
6 6
7 #include "ash/common/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/display/display_info.h" 8 #include "ash/display/display_info.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 233 }
234 234
235 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { 235 void Pointer::OnScrollEvent(ui::ScrollEvent* event) {
236 OnMouseEvent(event); 236 OnMouseEvent(event);
237 } 237 }
238 238
239 //////////////////////////////////////////////////////////////////////////////// 239 ////////////////////////////////////////////////////////////////////////////////
240 // SurfaceDelegate overrides: 240 // SurfaceDelegate overrides:
241 241
242 void Pointer::OnSurfaceCommit() { 242 void Pointer::OnSurfaceCommit() {
243 surface_->CheckIfSurfaceHierarchyNeedsCommitToNewSurfaces();
243 surface_->CommitSurfaceHierarchy(); 244 surface_->CommitSurfaceHierarchy();
244 surface_->window()->SetBounds( 245 surface_->window()->SetBounds(
245 gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(), 246 gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(),
246 surface_->window()->layer()->size())); 247 surface_->window()->layer()->size()));
247 } 248 }
248 249
249 bool Pointer::IsSurfaceSynchronized() const { 250 bool Pointer::IsSurfaceSynchronized() const {
250 // A pointer surface is always desynchronized. 251 // A pointer surface is always desynchronized.
251 return false; 252 return false;
252 } 253 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const { 288 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const {
288 Surface* target = 289 Surface* target =
289 Surface::AsSurface(static_cast<aura::Window*>(event->target())); 290 Surface::AsSurface(static_cast<aura::Window*>(event->target()));
290 if (!target) 291 if (!target)
291 return nullptr; 292 return nullptr;
292 293
293 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr; 294 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr;
294 } 295 }
295 296
296 } // namespace exo 297 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | components/exo/shell_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698