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 { |