diff options
author | 2017-06-27 09:58:56 -0400 | |
---|---|---|
committer | 2017-06-27 15:33:35 +0000 | |
commit | b964238f0bded00bae59c26c5f366a7780a0ef5f (patch) | |
tree | ce1869a71baf1bd518b8edafe00507af0deafb67 /src/gpu | |
parent | ca0b43803b45d6e24c13edb118cc3862bb00f7ae (diff) |
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 <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 8 | ||||
-rw-r--r-- | src/gpu/SkGpuDevice.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index 301adc12e4..08a3daea59 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -819,8 +819,10 @@ bool SkGpuDevice::shouldTileImage(const SkImage* image, const SkRect* srcRectPtr } void SkGpuDevice::drawBitmap(const SkBitmap& bitmap, - const SkMatrix& m, + SkScalar x, + SkScalar y, const SkPaint& paint) { + SkMatrix m = SkMatrix::MakeTrans(x, y); ASSERT_SINGLE_OWNER CHECK_SHOULD_DRAW(); SkMatrix viewMatrix; @@ -1346,14 +1348,14 @@ void SkGpuDevice::drawImage(const SkImage* image, SkScalar x, SkScalar y, if (!as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) { return; } - this->drawBitmap(bm, SkMatrix::MakeTrans(x, y), paint); + this->drawBitmap(bm, x, y, paint); } else if (image->isLazyGenerated()) { CHECK_SHOULD_DRAW(); GrImageTextureMaker maker(fContext.get(), image, SkImage::kAllow_CachingHint); this->drawTextureProducer(&maker, nullptr, nullptr, SkCanvas::kFast_SrcRectConstraint, viewMatrix, this->clip(), paint); } else if (as_IB(image)->getROPixels(&bm, fRenderTargetContext->getColorSpace())) { - this->drawBitmap(bm, SkMatrix::MakeTrans(x, y), paint); + this->drawBitmap(bm, x, y, paint); } } } diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h index b5133f4859..3f69153355 100644 --- a/src/gpu/SkGpuDevice.h +++ b/src/gpu/SkGpuDevice.h @@ -79,7 +79,7 @@ public: bool useCenter, const SkPaint& paint) override; void drawPath(const SkPath& path, const SkPaint& paint, const SkMatrix* prePathMatrix, bool pathIsMutable) override; - void drawBitmap(const SkBitmap& bitmap, const SkMatrix&, + void drawBitmap(const SkBitmap&, SkScalar x, SkScalar y, const SkPaint&) override; void drawBitmapRect(const SkBitmap&, const SkRect* srcOrNull, const SkRect& dst, const SkPaint& paint, SkCanvas::SrcRectConstraint) override; |