Chromium Code Reviews| Index: src/core/SkDevice.cpp |
| diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp |
| index 59408dc64abe0074b36842ff106632985285441d..5fd1b9fc1427d5b402a75d913819b364e62a6ae0 100644 |
| --- a/src/core/SkDevice.cpp |
| +++ b/src/core/SkDevice.cpp |
| @@ -12,6 +12,7 @@ |
| #include "SkImage_Base.h" |
| #include "SkImageFilter.h" |
| #include "SkImageFilterCache.h" |
| +#include "SkImagePriv.h" |
| #include "SkLatticeIter.h" |
| #include "SkMetaData.h" |
| #include "SkPatchUtils.h" |
| @@ -152,17 +153,6 @@ void SkBaseDevice::drawImage(const SkDraw& draw, const SkImage* image, SkScalar |
| } |
| } |
| -void SkBaseDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, |
| - const SkCanvas::Lattice& lattice, const SkRect& dst, |
| - const SkPaint& paint) { |
| - SkLatticeIter iter(image->width(), image->height(), lattice, dst); |
| - |
| - SkRect srcR, dstR; |
| - while (iter.next(&srcR, &dstR)) { |
| - this->drawImageRect(draw, image, &srcR, dstR, paint, SkCanvas::kStrict_SrcRectConstraint); |
| - } |
| -} |
| - |
| void SkBaseDevice::drawImageRect(const SkDraw& draw, const SkImage* image, const SkRect* src, |
| const SkRect& dst, const SkPaint& paint, |
| SkCanvas::SrcRectConstraint constraint) { |
| @@ -193,6 +183,24 @@ void SkBaseDevice::drawBitmapNine(const SkDraw& draw, const SkBitmap& bitmap, co |
| } |
| } |
| +void SkBaseDevice::drawImageLattice(const SkDraw& draw, const SkImage* image, |
| + const SkCanvas::Lattice& lattice, const SkRect& dst, |
| + const SkPaint& paint) { |
| + SkLatticeIter iter(image->width(), image->height(), lattice, dst); |
| + |
| + SkRect srcR, dstR; |
| + while (iter.next(&srcR, &dstR)) { |
| + this->drawImageRect(draw, image, &srcR, dstR, paint, SkCanvas::kStrict_SrcRectConstraint); |
| + } |
| +} |
| + |
| +void SkBaseDevice::drawBitmapLattice(const SkDraw& draw, const SkBitmap& bitmap, |
| + const SkCanvas::Lattice& lattice, const SkRect& dst, |
| + const SkPaint& paint) { |
| + sk_sp<SkImage> image = SkMakeImageFromRasterBitmap(bitmap, kNever_ForceCopyMode); |
|
msarett
2016/08/03 15:49:23
So now we convert image->bitmap here. No need to
reed1
2016/08/15 20:34:43
Since this trick with kNever is only safe for Rast
msarett
2016/08/15 20:43:03
sgtm, that seems like the right think to do.
I'm
|
| + this->drawImageLattice(draw, image.get(), lattice, dst, paint); |
| +} |
| + |
| void SkBaseDevice::drawAtlas(const SkDraw& draw, const SkImage* atlas, const SkRSXform xform[], |
| const SkRect tex[], const SkColor colors[], int count, |
| SkXfermode::Mode mode, const SkPaint& paint) { |