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

Unified Diff: webkit/common/cursors/webcursor_aurax11.cc

Issue 201473002: Move webcursors code from webkit/ to content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gfx image include Created 6 years, 9 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 | « webkit/common/cursors/webcursor_aurawin.cc ('k') | webkit/common/cursors/webcursor_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/common/cursors/webcursor_aurax11.cc
diff --git a/webkit/common/cursors/webcursor_aurax11.cc b/webkit/common/cursors/webcursor_aurax11.cc
deleted file mode 100644
index 0389f064069b37a35c673f2b994d1af24b6a4623..0000000000000000000000000000000000000000
--- a/webkit/common/cursors/webcursor_aurax11.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2012 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 "webkit/common/cursors/webcursor.h"
-
-#include <X11/Xcursor/Xcursor.h>
-#include <X11/Xlib.h>
-#include <X11/cursorfont.h>
-
-#include "base/logging.h"
-#include "third_party/WebKit/public/platform/WebCursorInfo.h"
-#include "ui/base/cursor/cursor.h"
-#include "ui/base/cursor/cursor_loader_x11.h"
-#include "ui/base/x/x11_util.h"
-
-const ui::PlatformCursor WebCursor::GetPlatformCursor() {
- if (platform_cursor_)
- return platform_cursor_;
-
- if (custom_data_.size() == 0)
- return 0;
-
- SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config,
- custom_size_.width(), custom_size_.height());
- bitmap.allocPixels();
- memcpy(bitmap.getAddr32(0, 0), custom_data_.data(), custom_data_.size());
- gfx::Point hotspot = hotspot_;
- ui::ScaleAndRotateCursorBitmapAndHotpoint(
- device_scale_factor_, rotation_, &bitmap, &hotspot);
-
- XcursorImage* image = ui::SkBitmapToXcursorImage(&bitmap, hotspot);
- platform_cursor_ = ui::CreateReffedCustomXCursor(image);
- return platform_cursor_;
-}
-
-void WebCursor::SetDisplayInfo(const gfx::Display& display) {
- if (rotation_ == display.rotation() &&
- device_scale_factor_ == display.device_scale_factor())
- return;
-
- device_scale_factor_ = display.device_scale_factor();
- rotation_ = display.rotation();
- if (platform_cursor_)
- ui::UnrefCustomXCursor(platform_cursor_);
- platform_cursor_ = 0;
- // It is not necessary to recreate platform_cursor_ yet, since it will be
- // recreated on demand when GetPlatformCursor is called.
-}
-
-void WebCursor::InitPlatformData() {
- platform_cursor_ = 0;
- device_scale_factor_ = 1.f;
- rotation_ = gfx::Display::ROTATE_0;
-}
-
-bool WebCursor::SerializePlatformData(Pickle* pickle) const {
- return true;
-}
-
-bool WebCursor::DeserializePlatformData(PickleIterator* iter) {
- return true;
-}
-
-bool WebCursor::IsPlatformDataEqual(const WebCursor& other) const {
- return true;
-}
-
-void WebCursor::CleanupPlatformData() {
- if (platform_cursor_) {
- ui::UnrefCustomXCursor(platform_cursor_);
- platform_cursor_ = 0;
- }
-}
-
-void WebCursor::CopyPlatformData(const WebCursor& other) {
- if (platform_cursor_)
- ui::UnrefCustomXCursor(platform_cursor_);
- platform_cursor_ = other.platform_cursor_;
- if (platform_cursor_)
- ui::RefCustomXCursor(platform_cursor_);
-
- device_scale_factor_ = other.device_scale_factor_;
-}
« no previous file with comments | « webkit/common/cursors/webcursor_aurawin.cc ('k') | webkit/common/cursors/webcursor_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698