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

Unified Diff: ui/ozone/platform/dri/dri_cursor.cc

Issue 527293002: ozone: Remove CursorFactoryOzone::SetCursor, GetCursorWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_cursor.h ('k') | ui/ozone/platform/dri/dri_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/dri_cursor.cc
diff --git a/ui/ozone/platform/dri/cursor_factory_evdev_dri.cc b/ui/ozone/platform/dri/dri_cursor.cc
similarity index 62%
rename from ui/ozone/platform/dri/cursor_factory_evdev_dri.cc
rename to ui/ozone/platform/dri/dri_cursor.cc
index fccd53ea4cd33e12e62c89fda64755be17ecc738..f2f71c2e758a618ac7e3c7d350248ce51b1b5a4e 100644
--- a/ui/ozone/platform/dri/cursor_factory_evdev_dri.cc
+++ b/ui/ozone/platform/dri/dri_cursor.cc
@@ -2,27 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h"
+#include "ui/ozone/platform/dri/dri_cursor.h"
+#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
+#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_conversions.h"
+#include "ui/gfx/geometry/point_f.h"
#include "ui/ozone/platform/dri/dri_surface_factory.h"
#include "ui/ozone/platform/dri/hardware_cursor_delegate.h"
namespace ui {
-CursorFactoryEvdevDri::CursorFactoryEvdevDri(HardwareCursorDelegate* hardware)
- : hardware_(hardware) {
+DriCursor::DriCursor(HardwareCursorDelegate* hardware) : hardware_(hardware) {
// TODO(dnicoara) Assume the first widget since at this point there are no
// widgets initialized.
cursor_window_ = DriSurfaceFactory::kDefaultWidgetHandle;
cursor_location_ = gfx::PointF(2560 / 2, 1700 / 2); // TODO(spang): Argh!
}
-CursorFactoryEvdevDri::~CursorFactoryEvdevDri() {}
+DriCursor::~DriCursor() {
+}
-void CursorFactoryEvdevDri::SetBitmapCursor(
- gfx::AcceleratedWidget widget,
- scoped_refptr<BitmapCursorOzone> cursor) {
+void DriCursor::SetCursor(gfx::AcceleratedWidget widget,
+ PlatformCursor platform_cursor) {
+ scoped_refptr<BitmapCursorOzone> cursor =
+ BitmapCursorFactoryOzone::GetBitmapCursor(platform_cursor);
if (cursor_ == cursor)
return;
@@ -34,8 +38,8 @@ void CursorFactoryEvdevDri::SetBitmapCursor(
hardware_->SetHardwareCursor(cursor_window_, SkBitmap(), gfx::Point());
}
-void CursorFactoryEvdevDri::MoveCursorTo(gfx::AcceleratedWidget widget,
- const gfx::PointF& location) {
+void DriCursor::MoveCursorTo(gfx::AcceleratedWidget widget,
+ const gfx::PointF& location) {
if (widget != cursor_window_)
hardware_->SetHardwareCursor(cursor_window_, SkBitmap(), gfx::Point());
@@ -50,19 +54,23 @@ void CursorFactoryEvdevDri::MoveCursorTo(gfx::AcceleratedWidget widget,
hardware_->MoveHardwareCursor(cursor_window_, bitmap_location());
}
-void CursorFactoryEvdevDri::MoveCursor(const gfx::Vector2dF& delta) {
+void DriCursor::MoveCursor(const gfx::Vector2dF& delta) {
MoveCursorTo(cursor_window_, cursor_location_ + delta);
}
-gfx::AcceleratedWidget CursorFactoryEvdevDri::GetCursorWindow() {
+gfx::AcceleratedWidget DriCursor::GetCursorWindow() {
return cursor_window_;
}
-bool CursorFactoryEvdevDri::IsCursorVisible() { return cursor_; }
+bool DriCursor::IsCursorVisible() {
+ return cursor_;
+}
-gfx::PointF CursorFactoryEvdevDri::location() { return cursor_location_; }
+gfx::PointF DriCursor::location() {
+ return cursor_location_;
+}
-gfx::Point CursorFactoryEvdevDri::bitmap_location() {
+gfx::Point DriCursor::bitmap_location() {
return gfx::ToFlooredPoint(cursor_location_) -
cursor_->hotspot().OffsetFromOrigin();
}
« no previous file with comments | « ui/ozone/platform/dri/dri_cursor.h ('k') | ui/ozone/platform/dri/dri_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698