Switch new SkImageFilter internal methods over to sk_sp
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1826893002
Review URL: https://codereview.chromium.org/1826893002
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index f1c1626..6a11db5 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1412,8 +1412,7 @@
continue; // something disastrous happened
}
- SkAutoTUnref<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx,
- &offset));
+ sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offset));
if (resultImg) {
SkPaint tmpUnfiltered(*paint);
tmpUnfiltered.setImageFilter(nullptr);
@@ -2265,9 +2264,9 @@
if (as_IB(image)->asBitmapForImageFilters(&bitmap)) {
SkPoint pt;
iter.fMatrix->mapXY(x, y, &pt);
- iter.fDevice->drawBitmapAsSpriteWithImageFilter(iter, bitmap,
- SkScalarRoundToInt(pt.fX),
- SkScalarRoundToInt(pt.fY), pnt);
+ iter.fDevice->drawSpriteWithFilter(iter, bitmap,
+ SkScalarRoundToInt(pt.fX),
+ SkScalarRoundToInt(pt.fY), pnt);
}
} else {
iter.fDevice->drawImage(iter, image, x, y, pnt);
@@ -2347,9 +2346,9 @@
if (drawAsSprite && pnt.getImageFilter()) {
SkPoint pt;
iter.fMatrix->mapXY(x, y, &pt);
- iter.fDevice->drawBitmapAsSpriteWithImageFilter(iter, bitmap,
- SkScalarRoundToInt(pt.fX),
- SkScalarRoundToInt(pt.fY), pnt);
+ iter.fDevice->drawSpriteWithFilter(iter, bitmap,
+ SkScalarRoundToInt(pt.fX),
+ SkScalarRoundToInt(pt.fY), pnt);
} else {
iter.fDevice->drawBitmap(iter, bitmap, matrix, looper.paint());
}
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index df0ba5f..0ff094d 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -403,9 +403,9 @@
//////////////////////////////////////////////////////////////////////////////////////////
-void SkBaseDevice::drawBitmapAsSpriteWithImageFilter(const SkDraw& draw, const SkBitmap& bitmap,
- int x, int y,
- const SkPaint& paint) {
+void SkBaseDevice::drawSpriteWithFilter(const SkDraw& draw, const SkBitmap& bitmap,
+ int x, int y,
+ const SkPaint& paint) {
SkImageFilter* filter = paint.getImageFilter();
SkASSERT(filter);
@@ -423,7 +423,7 @@
return; // something disastrous happened
}
- SkAutoTUnref<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offset));
+ sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offset));
if (resultImg) {
SkPaint tmpUnfiltered(paint);
tmpUnfiltered.setImageFilter(nullptr);
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index edaaa16..62509c5 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -214,8 +214,8 @@
buffer.writeUInt(fCropRect.flags());
}
-SkSpecialImage* SkImageFilter::filterImage(SkSpecialImage* src, const Context& context,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkImageFilter::filterImage(SkSpecialImage* src, const Context& context,
+ SkIPoint* offset) const {
SkASSERT(src && offset);
uint32_t srcGenID = fUsesSrcInput ? src->uniqueID() : 0;
@@ -224,13 +224,13 @@
if (context.cache()) {
SkSpecialImage* result = context.cache()->get(key, offset);
if (result) {
- return SkRef(result);
+ return sk_sp<SkSpecialImage>(SkRef(result));
}
}
- SkSpecialImage* result = this->onFilterImage(src, context, offset);
+ sk_sp<SkSpecialImage> result(this->onFilterImage(src, context, offset));
if (result && context.cache()) {
- context.cache()->set(key, result, *offset);
+ context.cache()->set(key, result.get(), *offset);
SkAutoMutexAcquire mutex(fMutex);
fCacheKeys.push_back(key);
}
@@ -280,9 +280,9 @@
return false;
}
- SkAutoTUnref<SkSpecialImage> tmp(input->onFilterImage(specialSrc.get(),
- this->mapContext(ctx),
- offset));
+ sk_sp<SkSpecialImage> tmp(input->onFilterImage(specialSrc.get(),
+ this->mapContext(ctx),
+ offset));
if (!tmp) {
return false;
}
@@ -341,8 +341,8 @@
// SkImageFilter-derived classes that do not yet have their own onFilterImage
// implementation convert back to calling the deprecated filterImage method
-SkSpecialImage* SkImageFilter::onFilterImage(SkSpecialImage* src, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkImageFilter::onFilterImage(SkSpecialImage* src, const Context& ctx,
+ SkIPoint* offset) const {
SkBitmap srcBM, resultBM;
if (!src->internal_getBM(&srcBM)) {
@@ -354,7 +354,7 @@
return nullptr;
}
- return SkSpecialImage::internal_fromBM(src->internal_getProxy(), resultBM).release();
+ return SkSpecialImage::internal_fromBM(src->internal_getProxy(), resultBM);
}
bool SkImageFilter::canFilterImageGPU() const {
@@ -489,10 +489,10 @@
return surf->makeImageSnapshot();
}
-SkSpecialImage* SkImageFilter::applyCropRect(const Context& ctx,
- SkSpecialImage* src,
- SkIPoint* srcOffset,
- SkIRect* bounds) const {
+sk_sp<SkSpecialImage> SkImageFilter::applyCropRect(const Context& ctx,
+ SkSpecialImage* src,
+ SkIPoint* srcOffset,
+ SkIRect* bounds) const {
SkIRect srcBounds;
srcBounds = SkIRect::MakeXYWH(srcOffset->fX, srcOffset->fY, src->width(), src->height());
@@ -503,14 +503,14 @@
}
if (srcBounds.contains(*bounds)) {
- return SkRef(src);
+ return sk_sp<SkSpecialImage>(SkRef(src));
} else {
sk_sp<SkSpecialImage> img(pad_image(src,
bounds->width(), bounds->height(),
srcOffset->x() - bounds->x(),
srcOffset->y() - bounds->y()));
*srcOffset = SkIPoint::Make(bounds->x(), bounds->y());
- return img.release();
+ return img;
}
}
@@ -563,27 +563,27 @@
return SkLocalMatrixImageFilter::Create(matrix, const_cast<SkImageFilter*>(this));
}
-SkSpecialImage* SkImageFilter::filterInput(int index,
- SkSpecialImage* src,
- const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkImageFilter::filterInput(int index,
+ SkSpecialImage* src,
+ const Context& ctx,
+ SkIPoint* offset) const {
SkImageFilter* input = this->getInput(index);
if (!input) {
- return SkRef(src);
+ return sk_sp<SkSpecialImage>(SkRef(src));
}
- SkAutoTUnref<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset));
+ sk_sp<SkSpecialImage> result(input->filterImage(src, this->mapContext(ctx), offset));
#if SK_SUPPORT_GPU
if (src->peekTexture() && result && !result->peekTexture()) {
// Keep the result on the GPU - this is still required for some
// image filters that don't support GPU in all cases
GrContext* context = src->peekTexture()->getContext();
- return result->makeTextureImage(src->internal_getProxy(), context).release();
+ return result->makeTextureImage(src->internal_getProxy(), context);
}
#endif
- return result.release();
+ return result;
}
#if SK_SUPPORT_GPU
@@ -601,9 +601,9 @@
return false;
}
- SkAutoTUnref<SkSpecialImage> tmp(input->onFilterImage(specialSrc.get(),
- this->mapContext(ctx),
- offset));
+ sk_sp<SkSpecialImage> tmp(input->onFilterImage(specialSrc.get(),
+ this->mapContext(ctx),
+ offset));
if (!tmp) {
return false;
}
diff --git a/src/core/SkLocalMatrixImageFilter.cpp b/src/core/SkLocalMatrixImageFilter.cpp
index f4ecb29..15f2f0e 100644
--- a/src/core/SkLocalMatrixImageFilter.cpp
+++ b/src/core/SkLocalMatrixImageFilter.cpp
@@ -7,6 +7,7 @@
#include "SkLocalMatrixImageFilter.h"
#include "SkReadBuffer.h"
+#include "SkSpecialImage.h"
#include "SkString.h"
SkImageFilter* SkLocalMatrixImageFilter::Create(const SkMatrix& localM, SkImageFilter* input) {
@@ -39,8 +40,9 @@
buffer.writeMatrix(fLocalM);
}
-SkSpecialImage* SkLocalMatrixImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkLocalMatrixImageFilter::onFilterImage(SkSpecialImage* source,
+ const Context& ctx,
+ SkIPoint* offset) const {
Context localCtx(SkMatrix::Concat(ctx.ctm(), fLocalM), ctx.clipBounds(), ctx.cache());
return this->filterInput(0, source, localCtx, offset);
}
diff --git a/src/core/SkLocalMatrixImageFilter.h b/src/core/SkLocalMatrixImageFilter.h
index f6bcb56..412b391 100644
--- a/src/core/SkLocalMatrixImageFilter.h
+++ b/src/core/SkLocalMatrixImageFilter.h
@@ -23,8 +23,8 @@
protected:
void flatten(SkWriteBuffer&) const override;
- SkSpecialImage* onFilterImage(SkSpecialImage* source, const Context&,
- SkIPoint* offset) const override;
+ sk_sp<SkSpecialImage> onFilterImage(SkSpecialImage* source, const Context&,
+ SkIPoint* offset) const override;
SkIRect onFilterBounds(const SkIRect& src, const SkMatrix&, MapDirection) const override;
private:
diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp
index c2cf356..692b6c9 100644
--- a/src/effects/SkBlurImageFilter.cpp
+++ b/src/effects/SkBlurImageFilter.cpp
@@ -70,11 +70,12 @@
}
}
-SkSpecialImage* SkBlurImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkBlurImageFilter::onFilterImage(SkSpecialImage* source,
+ const Context& ctx,
+ SkIPoint* offset) const {
SkIPoint inputOffset = SkIPoint::Make(0, 0);
- SkAutoTUnref<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset));
+ sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset));
if (!input) {
return nullptr;
}
@@ -98,7 +99,7 @@
offset->fX = inputBounds.x();
offset->fY = inputBounds.y();
return input->makeSubset(inputBounds.makeOffset(-inputOffset.x(),
- -inputOffset.y())).release();
+ -inputOffset.y()));
}
GrTexture* inputTexture = input->peekTexture();
@@ -122,7 +123,7 @@
return SkSpecialImage::MakeFromGpu(source->internal_getProxy(),
SkIRect::MakeWH(dstBounds.width(), dstBounds.height()),
kNeedNewImageUniqueID_SpecialImage,
- tex).release();
+ tex);
}
#endif
@@ -139,7 +140,7 @@
offset->fX = inputBounds.x();
offset->fY = inputBounds.y();
return input->makeSubset(inputBounds.makeOffset(-inputOffset.x(),
- -inputOffset.y())).release();
+ -inputOffset.y()));
}
SkPixmap inputPixmap;
@@ -214,7 +215,7 @@
return SkSpecialImage::MakeFromRaster(source->internal_getProxy(),
SkIRect::MakeWH(dstBounds.width(),
dstBounds.height()),
- dst).release();
+ dst);
}
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp
index a93997f..1e2cdac 100644
--- a/src/effects/SkColorFilterImageFilter.cpp
+++ b/src/effects/SkColorFilterImageFilter.cpp
@@ -52,10 +52,11 @@
buffer.writeFlattenable(fColorFilter.get());
}
-SkSpecialImage* SkColorFilterImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkColorFilterImageFilter::onFilterImage(SkSpecialImage* source,
+ const Context& ctx,
+ SkIPoint* offset) const {
SkIPoint inputOffset = SkIPoint::Make(0, 0);
- SkAutoTUnref<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset));
+ sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset));
if (!input) {
return nullptr;
}
@@ -91,7 +92,7 @@
offset->fX = bounds.fLeft;
offset->fY = bounds.fTop;
- return surf->makeImageSnapshot().release();
+ return surf->makeImageSnapshot();
}
bool SkColorFilterImageFilter::onIsColorFilterNode(SkColorFilter** filter) const {
diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/SkComposeImageFilter.cpp
index 86a4d50..c6722d5 100644
--- a/src/effects/SkComposeImageFilter.cpp
+++ b/src/effects/SkComposeImageFilter.cpp
@@ -19,8 +19,9 @@
return outer->computeFastBounds(inner->computeFastBounds(src));
}
-SkSpecialImage* SkComposeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkComposeImageFilter::onFilterImage(SkSpecialImage* source,
+ const Context& ctx,
+ SkIPoint* offset) const {
// The bounds passed to the inner filter must be filtered by the outer
// filter, so that the inner filter produces the pixels that the outer
// filter requires as input. This matters if the outer filter moves pixels.
@@ -28,7 +29,7 @@
innerClipBounds = getInput(0)->filterBounds(ctx.clipBounds(), ctx.ctm());
Context innerContext(ctx.ctm(), innerClipBounds, ctx.cache());
SkIPoint innerOffset = SkIPoint::Make(0, 0);
- SkAutoTUnref<SkSpecialImage> inner(this->filterInput(1, source, innerContext, &innerOffset));
+ sk_sp<SkSpecialImage> inner(this->filterInput(1, source, innerContext, &innerOffset));
if (!inner) {
return nullptr;
}
@@ -40,13 +41,13 @@
Context outerContext(outerMatrix, clipBounds, ctx.cache());
SkIPoint outerOffset = SkIPoint::Make(0, 0);
- SkAutoTUnref<SkSpecialImage> outer(this->filterInput(0, inner, outerContext, &outerOffset));
+ sk_sp<SkSpecialImage> outer(this->filterInput(0, inner.get(), outerContext, &outerOffset));
if (!outer) {
return nullptr;
}
*offset = innerOffset + outerOffset;
- return outer.release();
+ return outer;
}
SkIRect SkComposeImageFilter::onFilterBounds(const SkIRect& src, const SkMatrix& ctm,
diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/SkDropShadowImageFilter.cpp
index 2ae2a12..93c11ca 100644
--- a/src/effects/SkDropShadowImageFilter.cpp
+++ b/src/effects/SkDropShadowImageFilter.cpp
@@ -51,10 +51,11 @@
buffer.writeInt(static_cast<int>(fShadowMode));
}
-SkSpecialImage* SkDropShadowImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkDropShadowImageFilter::onFilterImage(SkSpecialImage* source,
+ const Context& ctx,
+ SkIPoint* offset) const {
SkIPoint inputOffset = SkIPoint::Make(0, 0);
- SkAutoTUnref<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset));
+ sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &inputOffset));
if (!input) {
return nullptr;
}
@@ -101,7 +102,7 @@
}
offset->fX = bounds.fLeft;
offset->fY = bounds.fTop;
- return surf->makeImageSnapshot().release();
+ return surf->makeImageSnapshot();
}
SkRect SkDropShadowImageFilter::computeFastBounds(const SkRect& src) const {
diff --git a/src/effects/SkImageSource.cpp b/src/effects/SkImageSource.cpp
index d63eda9..f095df6 100644
--- a/src/effects/SkImageSource.cpp
+++ b/src/effects/SkImageSource.cpp
@@ -65,8 +65,8 @@
buffer.writeImage(fImage.get());
}
-SkSpecialImage* SkImageSource::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkImageSource::onFilterImage(SkSpecialImage* source, const Context& ctx,
+ SkIPoint* offset) const {
SkRect dstRect;
ctx.ctm().mapRect(&dstRect, fDstRect);
@@ -76,7 +76,7 @@
offset->fX = offset->fY = 0;
return SkSpecialImage::MakeFromImage(source->internal_getProxy(),
SkIRect::MakeWH(fImage->width(), fImage->height()),
- fImage).release();
+ fImage);
}
const SkIRect dstIRect = dstRect.roundOut();
@@ -110,7 +110,7 @@
offset->fX = dstIRect.fLeft;
offset->fY = dstIRect.fTop;
- return surf->makeImageSnapshot().release();
+ return surf->makeImageSnapshot();
}
SkRect SkImageSource::computeFastBounds(const SkRect& src) const {
diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/SkMergeImageFilter.cpp
index 01373b2..e3b99c6 100755
--- a/src/effects/SkMergeImageFilter.cpp
+++ b/src/effects/SkMergeImageFilter.cpp
@@ -57,8 +57,8 @@
}
}
-SkSpecialImage* SkMergeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkMergeImageFilter::onFilterImage(SkSpecialImage* source, const Context& ctx,
+ SkIPoint* offset) const {
int inputCount = this->countInputs();
if (inputCount < 1) {
return nullptr;
@@ -67,14 +67,13 @@
SkIRect bounds;
bounds.setEmpty();
- SkAutoTDeleteArray<SkAutoTUnref<SkSpecialImage>> inputs(
- new SkAutoTUnref<SkSpecialImage>[inputCount]);
+ SkAutoTDeleteArray<sk_sp<SkSpecialImage>> inputs(new sk_sp<SkSpecialImage>[inputCount]);
SkAutoTDeleteArray<SkIPoint> offsets(new SkIPoint[inputCount]);
// Filter all of the inputs.
for (int i = 0; i < inputCount; ++i) {
offsets[i].setZero();
- inputs[i].reset(this->filterInput(i, source, ctx, &offsets[i]));
+ inputs[i] = this->filterInput(i, source, ctx, &offsets[i]);
if (!inputs[i]) {
continue;
}
@@ -126,7 +125,7 @@
offset->fX = bounds.left();
offset->fY = bounds.top();
- return surf->makeImageSnapshot().release();
+ return surf->makeImageSnapshot();
}
SkFlattenable* SkMergeImageFilter::CreateProc(SkReadBuffer& buffer) {
diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/SkOffsetImageFilter.cpp
index 8e4b878..05df229 100644
--- a/src/effects/SkOffsetImageFilter.cpp
+++ b/src/effects/SkOffsetImageFilter.cpp
@@ -15,11 +15,11 @@
#include "SkSpecialSurface.h"
#include "SkWriteBuffer.h"
-SkSpecialImage* SkOffsetImageFilter::onFilterImage(SkSpecialImage* source,
- const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkOffsetImageFilter::onFilterImage(SkSpecialImage* source,
+ const Context& ctx,
+ SkIPoint* offset) const {
SkIPoint srcOffset = SkIPoint::Make(0, 0);
- SkAutoTUnref<SkSpecialImage> input(this->filterInput(0, source, ctx, &srcOffset));
+ sk_sp<SkSpecialImage> input(this->filterInput(0, source, ctx, &srcOffset));
if (!input) {
return nullptr;
}
@@ -30,7 +30,7 @@
if (!this->cropRectIsSet()) {
offset->fX = srcOffset.fX + SkScalarRoundToInt(vec.fX);
offset->fY = srcOffset.fY + SkScalarRoundToInt(vec.fY);
- return input.release();
+ return input;
} else {
SkIRect bounds;
SkIRect srcBounds = SkIRect::MakeWH(input->width(), input->height());
@@ -61,7 +61,7 @@
offset->fX = bounds.fLeft;
offset->fY = bounds.fTop;
- return surf->makeImageSnapshot().release();
+ return surf->makeImageSnapshot();
}
}
diff --git a/src/effects/SkPaintImageFilter.cpp b/src/effects/SkPaintImageFilter.cpp
index 02387ce..7056f26 100644
--- a/src/effects/SkPaintImageFilter.cpp
+++ b/src/effects/SkPaintImageFilter.cpp
@@ -33,9 +33,9 @@
buffer.writePaint(fPaint);
}
-SkSpecialImage* SkPaintImageFilter::onFilterImage(SkSpecialImage* source,
- const Context& ctx,
- SkIPoint* offset) const {
+sk_sp<SkSpecialImage> SkPaintImageFilter::onFilterImage(SkSpecialImage* source,
+ const Context& ctx,
+ SkIPoint* offset) const {
SkIRect bounds;
const SkIRect srcBounds = SkIRect::MakeWH(source->width(), source->height());
if (!this->applyCropRect(ctx, srcBounds, &bounds)) {
@@ -67,7 +67,7 @@
offset->fX = bounds.fLeft;
offset->fY = bounds.fTop;
- return surf->makeImageSnapshot().release();
+ return surf->makeImageSnapshot();
}
bool SkPaintImageFilter::canComputeFastBounds() const {
diff --git a/src/gpu/GrLayerHoister.cpp b/src/gpu/GrLayerHoister.cpp
index f1a51a8..80ea3cd 100644
--- a/src/gpu/GrLayerHoister.cpp
+++ b/src/gpu/GrLayerHoister.cpp
@@ -309,9 +309,9 @@
layer->texture()));
SkIPoint offset = SkIPoint::Make(0, 0);
- SkAutoTUnref<SkSpecialImage> result(layer->filter()->filterImage(img.get(),
- filterContext,
- &offset));
+ sk_sp<SkSpecialImage> result(layer->filter()->filterImage(img.get(),
+ filterContext,
+ &offset));
if (!result) {
// Filtering failed. Press on with the unfiltered version.
return;
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index dc1edd4..724d77b 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -226,10 +226,10 @@
// gpu-specific paths. This mirrors SkCanvas::internalDrawDevice (the other
// use of SkImageFilter::filterImage) in that the source and dest will have
// homogenous backing (e.g., raster or gpu).
-void SkGpuDevice::drawBitmapAsSpriteWithImageFilter(const SkDraw& draw, const SkBitmap& bitmap,
- int x, int y, const SkPaint& paint) {
+void SkGpuDevice::drawSpriteWithFilter(const SkDraw& draw, const SkBitmap& bitmap,
+ int x, int y, const SkPaint& paint) {
if (bitmap.getTexture()) {
- INHERITED::drawBitmapAsSpriteWithImageFilter(draw, bitmap, x, y, paint);
+ INHERITED::drawSpriteWithFilter(draw, bitmap, x, y, paint);
return;
}
@@ -250,7 +250,7 @@
GrWrapTextureInBitmap(texture, texture->width(), texture->height(),
bitmap.isOpaque(), &newBitmap);
- INHERITED::drawBitmapAsSpriteWithImageFilter(draw, newBitmap, x, y, paint);
+ INHERITED::drawSpriteWithFilter(draw, newBitmap, x, y, paint);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 23e3d64..7f9041b 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -262,8 +262,8 @@
static GrRenderTarget* CreateRenderTarget(GrContext*, SkBudgeted, const SkImageInfo&,
int sampleCount, GrTextureStorageAllocator);
- void drawBitmapAsSpriteWithImageFilter(const SkDraw&, const SkBitmap&, int x, int y,
- const SkPaint&) override;
+ void drawSpriteWithFilter(const SkDraw&, const SkBitmap&, int x, int y,
+ const SkPaint&) override;
friend class GrAtlasTextContext;
friend class SkSurface_Gpu; // for access to surfaceProps