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

Unified Diff: Source/platform/DragImage.cpp

Issue 1001703003: Take NativeImageSkia out behind the woodshed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make bitmapForCurrentFrame() return SkBitmap by value. Created 5 years, 9 months 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: Source/platform/DragImage.cpp
diff --git a/Source/platform/DragImage.cpp b/Source/platform/DragImage.cpp
index 24631487d3e8b0ae4c906b7d20d153a817e2a2e5..b24d886537a742b709e7de9aa25c031c6bf09176 100644
--- a/Source/platform/DragImage.cpp
+++ b/Source/platform/DragImage.cpp
@@ -41,7 +41,6 @@
#include "platform/graphics/ImageBuffer.h"
#include "platform/graphics/paint/DisplayItemList.h"
#include "platform/graphics/paint/DrawingRecorder.h"
-#include "platform/graphics/skia/NativeImageSkia.h"
#include "platform/text/BidiTextRun.h"
#include "platform/text/StringTruncator.h"
#include "platform/text/TextRun.h"
@@ -75,8 +74,8 @@ PassOwnPtr<DragImage> DragImage::create(Image* image, RespectImageOrientationEnu
if (!image)
return nullptr;
- RefPtr<NativeImageSkia> bitmap = image->nativeImageForCurrentFrame();
- if (!bitmap)
+ SkBitmap bitmap = image->bitmapForCurrentFrame();
+ if (bitmap.isNull())
return nullptr;
if (image->isBitmapImage()) {
@@ -99,14 +98,14 @@ PassOwnPtr<DragImage> DragImage::create(Image* image, RespectImageOrientationEnu
skBitmap.eraseColor(SK_ColorTRANSPARENT);
SkCanvas canvas(skBitmap);
canvas.concat(affineTransformToSkMatrix(orientation.transformFromDefault(sizeRespectingOrientation)));
- canvas.drawBitmapRect(bitmap->bitmap(), 0, destRect);
+ canvas.drawBitmapRect(bitmap, 0, destRect);
return adoptPtr(new DragImage(skBitmap, deviceScaleFactor, interpolationQuality));
}
}
SkBitmap skBitmap;
- if (!bitmap->bitmap().copyTo(&skBitmap, kN32_SkColorType))
+ if (!bitmap.copyTo(&skBitmap, kN32_SkColorType))
return nullptr;
return adoptPtr(new DragImage(skBitmap, deviceScaleFactor, interpolationQuality));
}

Powered by Google App Engine
This is Rietveld 408576698