Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Unified Diff: src/core/SkDevice.cpp

Issue 1888243003: Remove deprecated paths from image filter infrastructure. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove some spurious printfs Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDevice.cpp
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 1b228565283cc1cc8cf36ed4a79d4b361591ee9f..4c53ad4189a4ca758b8de18dc99afef05afe6e54 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -409,33 +409,29 @@ void SkBaseDevice::drawSpriteWithFilter(const SkDraw& draw, const SkBitmap& bitm
SkImageFilter* filter = paint.getImageFilter();
SkASSERT(filter);
- if (!this->canHandleImageFilter(filter)) {
- SkImageFilter::DeviceProxy proxy(this);
- SkIPoint offset = SkIPoint::Make(0, 0);
- SkMatrix matrix = *draw.fMatrix;
- matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
- const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y);
- SkAutoTUnref<SkImageFilter::Cache> cache(this->getImageFilterCache());
- SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
-
- sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy, bitmap,
- &this->surfaceProps()));
- if (!srcImg) {
- return; // something disastrous happened
- }
+ SkImageFilter::DeviceProxy proxy(this);
+ SkIPoint offset = SkIPoint::Make(0, 0);
+ SkMatrix matrix = *draw.fMatrix;
+ matrix.postTranslate(SkIntToScalar(-x), SkIntToScalar(-y));
+ const SkIRect clipBounds = draw.fClip->getBounds().makeOffset(-x, -y);
+ SkAutoTUnref<SkImageFilter::Cache> cache(this->getImageFilterCache());
+ SkImageFilter::Context ctx(matrix, clipBounds, cache.get());
+
+ sk_sp<SkSpecialImage> srcImg(SkSpecialImage::internal_fromBM(&proxy, bitmap,
+ &this->surfaceProps()));
+ if (!srcImg) {
+ return; // something disastrous happened
+ }
- sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offset));
- if (resultImg) {
- SkPaint tmpUnfiltered(paint);
- tmpUnfiltered.setImageFilter(nullptr);
- SkBitmap resultBM;
- if (resultImg->internal_getBM(&resultBM)) {
- // TODO: add drawSprite(SkSpecialImage) to SkDevice? (see skbug.com/5073)
- this->drawSprite(draw, resultBM, x + offset.x(), y + offset.y(), tmpUnfiltered);
- }
+ sk_sp<SkSpecialImage> resultImg(filter->filterImage(srcImg.get(), ctx, &offset));
+ if (resultImg) {
+ SkPaint tmpUnfiltered(paint);
+ tmpUnfiltered.setImageFilter(nullptr);
+ SkBitmap resultBM;
+ if (resultImg->internal_getBM(&resultBM)) {
+ // TODO: add drawSprite(SkSpecialImage) to SkDevice? (see skbug.com/5073)
+ this->drawSprite(draw, resultBM, x + offset.x(), y + offset.y(), tmpUnfiltered);
}
- } else {
- this->drawSprite(draw, bitmap, x, y, paint);
}
}
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698