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

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') | components/exo/surface.h » ('J')
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 232
233 void Pointer::OnScrollEvent(ui::ScrollEvent* event) { 233 void Pointer::OnScrollEvent(ui::ScrollEvent* event) {
234 OnMouseEvent(event); 234 OnMouseEvent(event);
235 } 235 }
236 236
237 //////////////////////////////////////////////////////////////////////////////// 237 ////////////////////////////////////////////////////////////////////////////////
238 // SurfaceDelegate overrides: 238 // SurfaceDelegate overrides:
239 239
240 void Pointer::OnSurfaceCommit() { 240 void Pointer::OnSurfaceCommit() {
241 surface_->CheckForCommittingToNewSurface();
241 surface_->CommitSurfaceHierarchy(); 242 surface_->CommitSurfaceHierarchy();
242 surface_->SetBounds(gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(), 243 surface_->SetBounds(gfx::Rect(gfx::Point() - hotspot_.OffsetFromOrigin(),
243 surface_->layer()->size())); 244 surface_->layer()->size()));
244 } 245 }
245 246
246 bool Pointer::IsSurfaceSynchronized() const { 247 bool Pointer::IsSurfaceSynchronized() const {
247 // A pointer surface is always desynchronized. 248 // A pointer surface is always desynchronized.
248 return false; 249 return false;
249 } 250 }
250 251
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const { 285 Surface* Pointer::GetEffectiveTargetForEvent(ui::Event* event) const {
285 Surface* target = 286 Surface* target =
286 Surface::AsSurface(static_cast<aura::Window*>(event->target())); 287 Surface::AsSurface(static_cast<aura::Window*>(event->target()));
287 if (!target) 288 if (!target)
288 return nullptr; 289 return nullptr;
289 290
290 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr; 291 return delegate_->CanAcceptPointerEventsForSurface(target) ? target : nullptr;
291 } 292 }
292 293
293 } // namespace exo 294 } // namespace exo
OLDNEW
« no previous file with comments | « no previous file | components/exo/shell_surface.cc » ('j') | components/exo/surface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698