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

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..8877d45774d13d80f554f04bc256cc839e9c0806 100644
--- a/content/common/cursors/webcursor_aurawin.cc
+++ b/content/common/cursors/webcursor_aurawin.cc
@@ -18,17 +18,23 @@ 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());
- return custom_cursor_;
-}
+ if (custom_data_.size() == 0)
ananta 2015/12/15 23:28:17 should this be an error condition? and hence a dch
Bret 2015/12/16 19:03:59 Done.
+ return 0;
+
+ SkBitmap bitmap;
+ gfx::Point hotspot;
+ CreateScaledBitmapAndHotspotFromCustomData(&bitmap, &hotspot);
-void WebCursor::SetDisplayInfo(const gfx::Display& display) {
- // TODO(winguru): Add support for scaling the cursor.
+ 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::InitPlatformData() {

Powered by Google App Engine
This is Rietveld 408576698