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

Unified Diff: content/common/cursors/webcursor_aurawin.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_aurawin.cc
diff --git a/content/common/cursors/webcursor_aurawin.cc b/content/common/cursors/webcursor_aurawin.cc
index 23aec8f19a07d5d518fdcce559092b7e784cfd49..03509b87828716d58e1612dd978f22ae359695c0 100644
--- a/content/common/cursors/webcursor_aurawin.cc
+++ b/content/common/cursors/webcursor_aurawin.cc
@@ -18,19 +18,22 @@ ui::PlatformCursor WebCursor::GetPlatformCursor() {
if (custom_cursor_)
return custom_cursor_;
- custom_cursor_ =
- IconUtil::CreateCursorFromDIB(
- custom_size_,
- hotspot_,
- !custom_data_.empty() ? &custom_data_[0] : NULL,
- custom_data_.size());
+ SkBitmap bitmap;
+ gfx::Point hotspot;
+ CreateScaledBitmapAndHotspotFromCustomData(&bitmap, &hotspot);
+
+ gfx::Size custom_size;
+ std::vector<char> custom_data;
+ CreateCustomData(bitmap, &custom_data, &custom_size);
+
+ custom_cursor_ = IconUtil::CreateCursorFromDIB(
+ custom_size,
+ hotspot,
+ !custom_data.empty() ? &custom_data[0] : NULL,
+ custom_data.size());
return custom_cursor_;
}
-void WebCursor::SetDisplayInfo(const gfx::Display& display) {
- // TODO(winguru): Add support for scaling the cursor.
-}
-
void WebCursor::InitPlatformData() {
custom_cursor_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698