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

Unified Diff: src/core/SkImageFilter.cpp

Issue 1892493002: Remove asFragmentProcessor gpu-specific ImageFilter code path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove unused parameters 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 | « include/core/SkImageFilter.h ('k') | no next file » | 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 af2b278e3d8721a4aa9a477da1ebed66ce2ca773..43ea6ab6afcf1961f23b5cd05e14393ae7dbb760 100644
--- a/src/core/SkImageFilter.cpp
+++ b/src/core/SkImageFilter.cpp
@@ -393,65 +393,6 @@ sk_sp<SkSpecialImage> SkImageFilter::onFilterImage(SkSpecialImage* src, const Co
return SkSpecialImage::internal_fromBM(src->internal_getProxy(), resultBM, &src->props());
}
-bool SkImageFilter::canFilterImageGPU() const {
- return this->asFragmentProcessor(nullptr, nullptr, SkMatrix::I(), SkIRect());
-}
-
-bool SkImageFilter::filterImageGPUDeprecated(Proxy* proxy, const SkBitmap& src, const Context& ctx,
- SkBitmap* result, SkIPoint* offset) const {
-#if SK_SUPPORT_GPU
- SkBitmap input = src;
- SkASSERT(fInputCount == 1);
- SkIPoint srcOffset = SkIPoint::Make(0, 0);
- if (!this->filterInputGPUDeprecated(0, proxy, src, ctx, &input, &srcOffset)) {
- return false;
- }
- GrTexture* srcTexture = input.getTexture();
- SkIRect bounds;
- if (!this->applyCropRectDeprecated(ctx, proxy, input, &srcOffset, &bounds, &input)) {
- return false;
- }
- GrContext* context = srcTexture->getContext();
-
- GrSurfaceDesc desc;
- desc.fFlags = kRenderTarget_GrSurfaceFlag;
- desc.fWidth = bounds.width();
- desc.fHeight = bounds.height();
- desc.fConfig = kRGBA_8888_GrPixelConfig;
-
- SkAutoTUnref<GrTexture> dst(context->textureProvider()->createApproxTexture(desc));
- if (!dst) {
- return false;
- }
-
- GrFragmentProcessor* fp;
- offset->fX = bounds.left();
- offset->fY = bounds.top();
- bounds.offset(-srcOffset);
- SkMatrix matrix(ctx.ctm());
- matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- GrPaint paint;
- // SRGBTODO: Don't handle sRGB here, in anticipation of this code path being deleted.
- if (this->asFragmentProcessor(&fp, srcTexture, matrix, bounds)) {
- SkASSERT(fp);
- paint.addColorFragmentProcessor(fp)->unref();
- paint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
-
- SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(dst->asRenderTarget()));
- if (drawContext) {
- SkRect srcRect = SkRect::Make(bounds);
- SkRect dstRect = SkRect::MakeWH(srcRect.width(), srcRect.height());
- GrClip clip(dstRect);
- drawContext->fillRectToRect(clip, paint, SkMatrix::I(), dstRect, srcRect);
-
- GrWrapTextureInBitmap(dst, bounds.width(), bounds.height(), false, result);
- return true;
- }
- }
-#endif
- return false;
-}
-
#if SK_SUPPORT_GPU
sk_sp<SkSpecialImage> SkImageFilter::DrawWithFP(GrContext* context,
sk_sp<GrFragmentProcessor> fp,
@@ -620,11 +561,6 @@ SkImageFilter::Context SkImageFilter::mapContext(const Context& ctx) const {
return Context(ctx.ctm(), clipBounds, ctx.cache());
}
-bool SkImageFilter::asFragmentProcessor(GrFragmentProcessor**, GrTexture*,
- const SkMatrix&, const SkIRect&) const {
- return false;
-}
-
sk_sp<SkImageFilter> SkImageFilter::MakeMatrixFilter(const SkMatrix& matrix,
SkFilterQuality filterQuality,
sk_sp<SkImageFilter> input) {
« no previous file with comments | « include/core/SkImageFilter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698