aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapDevice.cpp
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2018-03-22 15:00:01 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-04 17:42:28 +0000
commitbf74a460814a7912ed3d2e1af000afd2c45cd318 (patch)
tree70d33ae06ff97a34b81c45724922b4cc7f220069 /src/core/SkBitmapDevice.cpp
parent378679cc474f56661e838a21d6341c061f408372 (diff)
Fix drawBitmapRect in the threaded backend
Previously, the threaded backend failed to drawBitmapRect (see, e.g., GM_bitmaprect_s) because it did not intercept the call to SkDraw::drawBitmap. Bug: skia: Change-Id: I7eeaae98e63d726b2b566c4d15f7ea939f59360e Reviewed-on: https://skia-review.googlesource.com/115983 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'src/core/SkBitmapDevice.cpp')
-rw-r--r--src/core/SkBitmapDevice.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 8d6ab54d58..dd01a3795e 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -331,7 +331,12 @@ void SkBitmapDevice::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y,
const SkPaint& paint) {
SkMatrix matrix = SkMatrix::MakeTrans(x, y);
LogDrawScaleFactor(SkMatrix::Concat(this->ctm(), matrix), paint.getFilterQuality());
- LOOP_TILER( drawBitmap(bitmap, matrix, nullptr, paint))
+ this->drawBitmap(bitmap, matrix, nullptr, paint);
+}
+
+void SkBitmapDevice::drawBitmap(const SkBitmap& bitmap, const SkMatrix& matrix,
+ const SkRect* dstOrNull, const SkPaint& paint) {
+ LOOP_TILER( drawBitmap(bitmap, matrix, dstOrNull, paint))
}
static inline bool CanApplyDstMatrixAsCTM(const SkMatrix& m, const SkPaint& paint) {
@@ -426,7 +431,7 @@ void SkBitmapDevice::drawBitmapRect(const SkBitmap& bitmap,
// matrix with the CTM, and try to call drawSprite if it can. If not,
// it will make a shader and call drawRect, as we do below.
if (CanApplyDstMatrixAsCTM(matrix, paint)) {
- LOOP_TILER( drawBitmap(*bitmapPtr, matrix, dstPtr, paint))
+ this->drawBitmap(*bitmapPtr, matrix, dstPtr, paint);
return;
}
}