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

Unified Diff: src/core/SkDevice.cpp

Issue 920513003: Make filters use SkImage instead of SkBitmap Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 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: src/core/SkDevice.cpp
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index bc6c892079622f956f00441d7b153c644974dd25..88f718b69c0d9070436dc8e3767a02d08ecd2d0a 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -12,9 +12,11 @@
#include "SkPatchUtils.h"
#include "SkShader.h"
#include "SkTextBlob.h"
+#include "SkImage_Base.h"
SkBaseDevice::SkBaseDevice()
: fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (SkDeviceProperties::kLegacyLCD_InitType)))
+ , fSurfaceBase(NULL)
#ifdef SK_DEBUG
, fAttachedToCanvas(false)
#endif
@@ -25,6 +27,7 @@ SkBaseDevice::SkBaseDevice()
SkBaseDevice::SkBaseDevice(const SkDeviceProperties& dp)
: fLeakyProperties(SkNEW_ARGS(SkDeviceProperties, (dp)))
+ , fSurfaceBase(NULL)
#ifdef SK_DEBUG
, fAttachedToCanvas(false)
#endif
@@ -102,6 +105,16 @@ void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
this->drawPath(draw, path, paint, preMatrix, pathIsMutable);
}
+void SkBaseDevice::drawImage(const SkDraw& draw, const SkImage& image,
+ int x, int y, const SkPaint& paint) {
+ SkBitmap bitmap;
+ if (!as_IB(&image)->getROPixels(&bitmap)) {
+ return;
+ }
+ this->drawSprite(draw, bitmap, x, y, paint);
+}
+
+
void SkBaseDevice::drawPatch(const SkDraw& draw, const SkPoint cubics[12], const SkColor colors[4],
const SkPoint texCoords[4], SkXfermode* xmode, const SkPaint& paint) {
SkPatchUtils::VertexData data;

Powered by Google App Engine
This is Rietveld 408576698