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

Unified Diff: ui/ozone/platform/dri/cursor_factory_evdev_dri.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/cursor_factory_evdev_dri.h ('k') | ui/ozone/platform/dri/dri.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/dri/cursor_factory_evdev_dri.cc
diff --git a/ui/ozone/platform/dri/cursor_factory_evdev_dri.cc b/ui/ozone/platform/dri/cursor_factory_evdev_dri.cc
deleted file mode 100644
index fccd53ea4cd33e12e62c89fda64755be17ecc738..0000000000000000000000000000000000000000
--- a/ui/ozone/platform/dri/cursor_factory_evdev_dri.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// 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/gfx/geometry/point_conversions.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) {
- // 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() {}
-
-void CursorFactoryEvdevDri::SetBitmapCursor(
- gfx::AcceleratedWidget widget,
- scoped_refptr<BitmapCursorOzone> cursor) {
- if (cursor_ == cursor)
- return;
-
- cursor_ = cursor;
- if (cursor_)
- hardware_->SetHardwareCursor(
- cursor_window_, cursor_->bitmap(), bitmap_location());
- else
- hardware_->SetHardwareCursor(cursor_window_, SkBitmap(), gfx::Point());
-}
-
-void CursorFactoryEvdevDri::MoveCursorTo(gfx::AcceleratedWidget widget,
- const gfx::PointF& location) {
- if (widget != cursor_window_)
- hardware_->SetHardwareCursor(cursor_window_, SkBitmap(), gfx::Point());
-
- cursor_window_ = widget;
- cursor_location_ = location;
-
- gfx::Size size = gfx::Size(2560, 1700); // TODO(spang): Fix.
- cursor_location_.SetToMax(gfx::PointF(0, 0));
- cursor_location_.SetToMin(gfx::PointF(size.width(), size.height()));
-
- if (cursor_)
- hardware_->MoveHardwareCursor(cursor_window_, bitmap_location());
-}
-
-void CursorFactoryEvdevDri::MoveCursor(const gfx::Vector2dF& delta) {
- MoveCursorTo(cursor_window_, cursor_location_ + delta);
-}
-
-gfx::AcceleratedWidget CursorFactoryEvdevDri::GetCursorWindow() {
- return cursor_window_;
-}
-
-bool CursorFactoryEvdevDri::IsCursorVisible() { return cursor_; }
-
-gfx::PointF CursorFactoryEvdevDri::location() { return cursor_location_; }
-
-gfx::Point CursorFactoryEvdevDri::bitmap_location() {
- return gfx::ToFlooredPoint(cursor_location_) -
- cursor_->hotspot().OffsetFromOrigin();
-}
-
-} // namespace ui
« no previous file with comments | « ui/ozone/platform/dri/cursor_factory_evdev_dri.h ('k') | ui/ozone/platform/dri/dri.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698