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

Unified Diff: content/common/cursors/webcursor.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.cc
diff --git a/content/common/cursors/webcursor.cc b/content/common/cursors/webcursor.cc
index d610ceb45d36a817a8e74b1320a96c92c23ecb52..a408b37b396c3c330658a9a8d63e9e08c2b27487 100644
--- a/content/common/cursors/webcursor.cc
+++ b/content/common/cursors/webcursor.cc
@@ -23,15 +23,6 @@ WebCursor::WebCursor()
InitPlatformData();
}
-WebCursor::WebCursor(const CursorInfo& cursor_info)
- : type_(WebCursorInfo::TypePointer) {
-#if defined(OS_WIN)
- external_cursor_ = NULL;
-#endif
- InitPlatformData();
- InitFromCursorInfo(cursor_info);
-}
-
WebCursor::~WebCursor() {
Clear();
}
@@ -231,18 +222,24 @@ void WebCursor::Copy(const WebCursor& other) {
}
void WebCursor::SetCustomData(const SkBitmap& bitmap) {
+ CreateCustomData(bitmap, custom_data_, custom_size_);
+}
+
+void WebCursor::CreateCustomData(const SkBitmap& bitmap,
+ std::vector<char>& custom_data,
ananta 2015/12/15 23:28:17 Fix alignment for the remaining parameters to be o
Bret 2015/12/16 19:03:58 Done.
+ gfx::Size& custom_size) {
if (bitmap.empty())
return;
- // Fill custom_data_ directly with the NativeImage pixels.
- custom_data_.resize(bitmap.getSize());
- if (!custom_data_.empty()) {
+ // Fill custom_data directly with the NativeImage pixels.
+ custom_data.resize(bitmap.getSize());
+ if (!custom_data.empty()) {
//This will divide color values by alpha (un-premultiply) if necessary
SkImageInfo dstInfo = bitmap.info().makeAlphaType(kUnpremul_SkAlphaType);
- bitmap.readPixels(dstInfo, &custom_data_[0], dstInfo.minRowBytes(), 0, 0);
+ bitmap.readPixels(dstInfo, &custom_data[0], dstInfo.minRowBytes(), 0, 0);
}
- custom_size_.set_width(bitmap.width());
- custom_size_.set_height(bitmap.height());
+ custom_size.set_width(bitmap.width());
+ custom_size.set_height(bitmap.height());
}
void WebCursor::ImageFromCustomData(SkBitmap* image) const {

Powered by Google App Engine
This is Rietveld 408576698