| Index: content/common/cursors/webcursor.cc
|
| diff --git a/content/common/cursors/webcursor.cc b/content/common/cursors/webcursor.cc
|
| index d610ceb45d36a817a8e74b1320a96c92c23ecb52..57c0e392038cf5412c3e2afec1d79ccf37b5027d 100644
|
| --- a/content/common/cursors/webcursor.cc
|
| +++ b/content/common/cursors/webcursor.cc
|
| @@ -20,16 +20,10 @@ WebCursor::WebCursor()
|
| #if defined(OS_WIN)
|
| external_cursor_ = NULL;
|
| #endif
|
| - InitPlatformData();
|
| -}
|
| -
|
| -WebCursor::WebCursor(const CursorInfo& cursor_info)
|
| - : type_(WebCursorInfo::TypePointer) {
|
| -#if defined(OS_WIN)
|
| - external_cursor_ = NULL;
|
| +#if defined(USE_AURA)
|
| + device_scale_factor_ = 1.0f;
|
| #endif
|
| InitPlatformData();
|
| - InitFromCursorInfo(cursor_info);
|
| }
|
|
|
| WebCursor::~WebCursor() {
|
| @@ -231,18 +225,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 {
|
|
|