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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1172693002: remove subclassing from ImageFilter::Proxy (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 6 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/SkDeviceImageFilterProxy.h ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkImageFilter.cpp
diff --git a/src/core/SkImageFilter.cpp b/src/core/SkImageFilter.cpp
index 91b3bc3d4afad1efc7da7a6e95ded8cf3752a82b..f5122040e951025261dec832a1016d3048429588 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -523,3 +523,26 @@ SkImageFilter::Cache* SkImageFilter::Cache::Get() {
void SkImageFilter::PurgeCache() {
cache.get()->purge();
}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include "SkBitmapDevice.h"
Stephen White 2015/06/09 15:17:04 Nit: move this to top-of-file?
+
+SkBaseDevice* SkImageFilter::Proxy::createDevice(int w, int h) {
+ SkBaseDevice::CreateInfo cinfo(SkImageInfo::MakeN32Premul(w, h),
robertphillips 2015/06/09 17:07:29 What about the SkTileImageFilter?
Stephen White 2015/06/10 14:42:45 SkTileImageFilter always does an extractSubset() o
+ SkBaseDevice::kNever_TileUsage,
+ kUnknown_SkPixelGeometry,
+ true /*forImageFilter*/);
+ SkBaseDevice* dev = fDevice->onCreateDevice(cinfo, NULL);
robertphillips 2015/06/09 17:07:29 !dev ?
+ if (NULL == dev) {
+ dev = SkBitmapDevice::Create(cinfo.fInfo);
+ }
+ return dev;
+}
+
+bool SkImageFilter::Proxy::filterImage(const SkImageFilter* filter, const SkBitmap& src,
+ const SkImageFilter::Context& ctx,
+ SkBitmap* result, SkIPoint* offset) {
+ return fDevice->filterImage(filter, src, ctx, result, offset);
+}
+
« no previous file with comments | « src/core/SkDeviceImageFilterProxy.h ('k') | src/effects/SkPictureImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698