| Index: third_party/WebKit/Source/platform/DragImage.cpp
|
| diff --git a/third_party/WebKit/Source/platform/DragImage.cpp b/third_party/WebKit/Source/platform/DragImage.cpp
|
| index bb2049ed8fb49676a7ca6e682c9adc9ed6f9b621..bd5a3cbcd6383cffb4af4021723ae047c2b94a28 100644
|
| --- a/third_party/WebKit/Source/platform/DragImage.cpp
|
| +++ b/third_party/WebKit/Source/platform/DragImage.cpp
|
| @@ -36,6 +36,7 @@
|
| #include "platform/graphics/BitmapImage.h"
|
| #include "platform/graphics/Color.h"
|
| #include "platform/graphics/GraphicsContext.h"
|
| +#include "platform/graphics/GraphicsScreen.h"
|
| #include "platform/graphics/Image.h"
|
| #include "platform/graphics/ImageBuffer.h"
|
| #include "platform/graphics/paint/DrawingRecorder.h"
|
| @@ -136,24 +137,26 @@ PassOwnPtr<DragImage> DragImage::create(Image* image,
|
| RespectImageOrientationEnum shouldRespectImageOrientation, float deviceScaleFactor,
|
| InterpolationQuality interpolationQuality, float opacity, FloatSize imageScale)
|
| {
|
| - if (!image)
|
| - return nullptr;
|
| + RefPtr<SkImage> skImage = image ? image->imageForCurrentFrame() : nullptr;
|
|
|
| - RefPtr<SkImage> skImage = image->imageForCurrentFrame();
|
| - if (!skImage)
|
| - return nullptr;
|
| + RELEASE_ASSERT(currentScreenId()); // There should be an active graphics screen.
|
| +
|
| + if (skImage && imageColorProfilesEnabled() && image->isBitmapImage() && toBitmapImage(image)->hasColorProfile())
|
| + skImage = toBitmapImage(image)->pictureForCurrentFrame();
|
|
|
| ImageOrientation orientation;
|
| - if (shouldRespectImageOrientation == RespectImageOrientation && image->isBitmapImage())
|
| + if (skImage && shouldRespectImageOrientation == RespectImageOrientation && image->isBitmapImage())
|
| orientation = toBitmapImage(image)->currentFrameOrientation();
|
|
|
| - SkBitmap bm;
|
| - RefPtr<SkImage> resizedImage =
|
| - resizeAndOrientImage(skImage.release(), orientation, imageScale, opacity, interpolationQuality);
|
| - if (!resizedImage || !resizedImage->asLegacyBitmap(&bm, SkImage::kRO_LegacyBitmapMode))
|
| + RefPtr<SkImage> dragImage;
|
| + if (skImage)
|
| + dragImage = resizeAndOrientImage(skImage.release(), orientation, imageScale, opacity, interpolationQuality);
|
| +
|
| + SkBitmap bitmap;
|
| + if (!dragImage || !dragImage->asLegacyBitmap(&bitmap, SkImage::kRO_LegacyBitmapMode))
|
| return nullptr;
|
|
|
| - return adoptPtr(new DragImage(bm, deviceScaleFactor, interpolationQuality));
|
| + return adoptPtr(new DragImage(bitmap, deviceScaleFactor, interpolationQuality));
|
| }
|
|
|
| static Font deriveDragLabelFont(int size, FontWeight fontWeight, const FontDescription& systemFont)
|
|
|