Index: content/common/cursors/webcursor.cc |
diff --git a/content/common/cursors/webcursor.cc b/content/common/cursors/webcursor.cc |
index d610ceb45d36a817a8e74b1320a96c92c23ecb52..45ca3e700c191fa7b6a3f91a260c88601a7e6673 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, |
+ 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 { |