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

Side by Side Diff: ui/ozone/platform/dri/cursor_factory_evdev_dri.cc

Issue 292563002: ozone: dri: Remove default cursor set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ozone/platform/dri/cursor_factory_evdev_dri.h" 5 #include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h"
6 6
7 #include "ui/gfx/geometry/point_conversions.h" 7 #include "ui/gfx/geometry/point_conversions.h"
8 #include "ui/ozone/platform/dri/dri_surface_factory.h" 8 #include "ui/ozone/platform/dri/dri_surface_factory.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 CursorFactoryEvdevDri::CursorFactoryEvdevDri(DriSurfaceFactory* dri) 12 CursorFactoryEvdevDri::CursorFactoryEvdevDri(DriSurfaceFactory* dri)
13 : dri_(dri) { 13 : dri_(dri) {
14 // TODO(dnicoara) Assume the first widget since at this point there are no 14 // TODO(dnicoara) Assume the first widget since at this point there are no
15 // widgets initialized. 15 // widgets initialized.
16 cursor_window_ = DriSurfaceFactory::kDefaultWidgetHandle; 16 cursor_window_ = DriSurfaceFactory::kDefaultWidgetHandle;
17 cursor_location_ = gfx::PointF(2560 / 2, 1700 / 2); // TODO(spang): Argh! 17 cursor_location_ = gfx::PointF(2560 / 2, 1700 / 2); // TODO(spang): Argh!
18
19 // The DRI cursor is invisible unless explicitly set. Therefore, set the
20 // pointer cursor on initialization.
21 // TODO(spang): Move this to DRI window initialization.
22 SetCursor(cursor_window_, GetDefaultCursor(kCursorPointer));
23 } 18 }
24 19
25 CursorFactoryEvdevDri::~CursorFactoryEvdevDri() {} 20 CursorFactoryEvdevDri::~CursorFactoryEvdevDri() {}
26 21
27 void CursorFactoryEvdevDri::SetBitmapCursor( 22 void CursorFactoryEvdevDri::SetBitmapCursor(
28 gfx::AcceleratedWidget widget, 23 gfx::AcceleratedWidget widget,
29 scoped_refptr<BitmapCursorOzone> cursor) { 24 scoped_refptr<BitmapCursorOzone> cursor) {
30 if (cursor_ == cursor) 25 if (cursor_ == cursor)
31 return; 26 return;
32 27
(...skipping 30 matching lines...) Expand all
63 } 58 }
64 59
65 gfx::PointF CursorFactoryEvdevDri::location() { return cursor_location_; } 60 gfx::PointF CursorFactoryEvdevDri::location() { return cursor_location_; }
66 61
67 gfx::Point CursorFactoryEvdevDri::bitmap_location() { 62 gfx::Point CursorFactoryEvdevDri::bitmap_location() {
68 return gfx::ToFlooredPoint(cursor_location_) - 63 return gfx::ToFlooredPoint(cursor_location_) -
69 cursor_->hotspot().OffsetFromOrigin(); 64 cursor_->hotspot().OffsetFromOrigin();
70 } 65 }
71 66
72 } // namespace ui 67 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698