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

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

Issue 1525263004: hidpi support for custom cursors in windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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
Index: content/common/cursors/webcursor_aurax11.cc
diff --git a/content/common/cursors/webcursor_aurax11.cc b/content/common/cursors/webcursor_aurax11.cc
index a50a19953f27bc824148ade9f6c2c76c364c8c08..d4c9d1d0cfb456b713c70922e8dd3284a89267b5 100644
--- a/content/common/cursors/webcursor_aurax11.cc
+++ b/content/common/cursors/webcursor_aurax11.cc
@@ -12,7 +12,6 @@
#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/cursor/cursor_util.h"
#include "ui/base/x/x11_util.h"
namespace content {
@@ -21,33 +20,15 @@ ui::PlatformCursor WebCursor::GetPlatformCursor() {
if (platform_cursor_)
return platform_cursor_;
- if (custom_data_.size() == 0)
- return 0;
-
SkBitmap bitmap;
- bitmap.allocN32Pixels(custom_size_.width(), custom_size_.height());
- memcpy(bitmap.getAddr32(0, 0), custom_data_.data(), custom_data_.size());
- gfx::Point hotspot = hotspot_;
- ui::ScaleAndRotateCursorBitmapAndHotpoint(
- device_scale_factor_, gfx::Display::ROTATE_0, &bitmap, &hotspot);
+ gfx::Point hotspot;
+ CreateScaledBitmapAndHotspotFromCustomData(&bitmap, &hotspot);
XcursorImage* image = ui::SkBitmapToXcursorImage(&bitmap, hotspot);
platform_cursor_ = ui::CreateReffedCustomXCursor(image);
return platform_cursor_;
}
-void WebCursor::SetDisplayInfo(const gfx::Display& display) {
- if (device_scale_factor_ == display.device_scale_factor())
- return;
-
- device_scale_factor_ = display.device_scale_factor();
- 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;

Powered by Google App Engine
This is Rietveld 408576698