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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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_gpu_platform_support.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/dri_cursor.cc b/ui/ozone/platform/dri/dri_cursor.cc
deleted file mode 100644
index 308541b4464758361430a2c38b00d44d43d60502..0000000000000000000000000000000000000000
--- a/ui/ozone/platform/dri/dri_cursor.cc
+++ /dev/null
@@ -1,99 +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/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/dri_window.h"
-#include "ui/ozone/platform/dri/dri_window_manager.h"
-#include "ui/ozone/platform/dri/hardware_cursor_delegate.h"
-
-namespace ui {
-
-DriCursor::DriCursor(HardwareCursorDelegate* hardware,
- DriWindowManager* window_manager)
- : hardware_(hardware),
- window_manager_(window_manager),
- cursor_window_(gfx::kNullAcceleratedWidget) {
-}
-
-DriCursor::~DriCursor() {
-}
-
-void DriCursor::SetCursor(gfx::AcceleratedWidget widget,
- PlatformCursor platform_cursor) {
- DCHECK_NE(widget, gfx::kNullAcceleratedWidget);
- scoped_refptr<BitmapCursorOzone> cursor =
- BitmapCursorFactoryOzone::GetBitmapCursor(platform_cursor);
- if (cursor_ == cursor || cursor_window_ != widget)
- return;
-
- cursor_ = cursor;
- ShowCursor();
-}
-
-void DriCursor::ShowCursor() {
- DCHECK_NE(cursor_window_, gfx::kNullAcceleratedWidget);
- if (cursor_.get())
- hardware_->SetHardwareCursor(cursor_window_,
- cursor_->bitmaps(),
- bitmap_location(),
- cursor_->frame_delay_ms());
- else
- HideCursor();
-}
-
-void DriCursor::HideCursor() {
- DCHECK_NE(cursor_window_, gfx::kNullAcceleratedWidget);
- hardware_->SetHardwareCursor(
- cursor_window_, std::vector<SkBitmap>(), gfx::Point(), 0);
-}
-
-void DriCursor::MoveCursorTo(gfx::AcceleratedWidget widget,
- const gfx::PointF& location) {
- if (widget != cursor_window_ && cursor_window_ != gfx::kNullAcceleratedWidget)
- HideCursor();
-
- cursor_window_ = widget;
- cursor_location_ = location;
-
- if (cursor_window_ == gfx::kNullAcceleratedWidget)
- return;
-
- DriWindow* window = window_manager_->GetWindow(cursor_window_);
- const gfx::Size& size = window->GetBounds().size();
- cursor_location_.SetToMax(gfx::PointF(0, 0));
- // Right and bottom edges are exclusive.
- cursor_location_.SetToMin(gfx::PointF(size.width() - 1, size.height() - 1));
-
- if (cursor_.get())
- hardware_->MoveHardwareCursor(cursor_window_, bitmap_location());
-}
-
-void DriCursor::MoveCursor(const gfx::Vector2dF& delta) {
- MoveCursorTo(cursor_window_, cursor_location_ + delta);
-}
-
-gfx::AcceleratedWidget DriCursor::GetCursorWindow() {
- return cursor_window_;
-}
-
-bool DriCursor::IsCursorVisible() {
- return cursor_.get();
-}
-
-gfx::PointF DriCursor::location() {
- return cursor_location_;
-}
-
-gfx::Point DriCursor::bitmap_location() {
- return gfx::ToFlooredPoint(cursor_location_) -
- cursor_->hotspot().OffsetFromOrigin();
-}
-
-} // namespace ui
« no previous file with comments | « ui/ozone/platform/dri/dri_cursor.h ('k') | ui/ozone/platform/dri/dri_gpu_platform_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698