From bf74a460814a7912ed3d2e1af000afd2c45cd318 Mon Sep 17 00:00:00 2001 From: Yuqian Li Date: Thu, 22 Mar 2018 15:00:01 -0400 Subject: 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 Commit-Queue: Yuqian Li --- src/core/SkBitmapDevice.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/core/SkBitmapDevice.cpp') 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; } } -- cgit v1.2.3