From b964238f0bded00bae59c26c5f366a7780a0ef5f Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Tue, 27 Jun 2017 09:58:56 -0400 Subject: SkDevice::drawBitmap takes x,y, not matrix Motivation: a simpler call should make it easier for SkPDF to learn how to do drawBitmap with A8 bitmap and a maskfilter. Change-Id: I1a5d190b40b0e9e08fa8876d265a9835a3e9987d Reviewed-on: https://skia-review.googlesource.com/20961 Reviewed-by: Mike Reed Commit-Queue: Hal Canary --- src/svg/SkSVGDevice.cpp | 6 +++--- src/svg/SkSVGDevice.h | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/svg') diff --git a/src/svg/SkSVGDevice.cpp b/src/svg/SkSVGDevice.cpp index 4c08986893..a1cb38ec29 100644 --- a/src/svg/SkSVGDevice.cpp +++ b/src/svg/SkSVGDevice.cpp @@ -704,11 +704,11 @@ void SkSVGDevice::drawBitmapCommon(const MxCp& mc, const SkBitmap& bm, const SkP } } -void SkSVGDevice::drawBitmap(const SkBitmap& bitmap, - const SkMatrix& matrix, const SkPaint& paint) { +void SkSVGDevice::drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, + const SkPaint& paint) { MxCp mc(this); SkMatrix adjustedMatrix = *mc.fMatrix; - adjustedMatrix.preConcat(matrix); + adjustedMatrix.preTranslate(x, y); mc.fMatrix = &adjustedMatrix; drawBitmapCommon(mc, bitmap, paint); diff --git a/src/svg/SkSVGDevice.h b/src/svg/SkSVGDevice.h index e05dc9283e..0e22910412 100644 --- a/src/svg/SkSVGDevice.h +++ b/src/svg/SkSVGDevice.h @@ -29,8 +29,7 @@ protected: const SkMatrix* prePathMatrix = nullptr, bool pathIsMutable = false) override; - void drawBitmap(const SkBitmap& bitmap, - const SkMatrix& matrix, const SkPaint& paint) override; + void drawBitmap(const SkBitmap& bitmap, SkScalar x, SkScalar y, const SkPaint& paint) override; void drawSprite(const SkBitmap& bitmap, int x, int y, const SkPaint& paint) override; void drawBitmapRect(const SkBitmap&, -- cgit v1.2.3