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

Unified Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month 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/effects/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrBlurUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkXfermodeImageFilter.cpp
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 1b3cf8197c91e597c6203b6a36f4ef2b948fd136..7452f9f8e5236d769d4aea408aeb3ace857f5c9d 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -18,6 +18,7 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrRenderTargetContext.h"
+#include "GrTextureProxy.h"
#include "effects/GrConstColorProcessor.h"
#include "effects/GrTextureDomain.h"
#include "effects/GrSimpleTextureEffect.h"
@@ -253,7 +254,8 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
-SkIntToScalar(backgroundOffset.fY));
bgFP = GrTextureDomainEffect::Make(
backgroundTex.get(), nullptr, backgroundMatrix,
- GrTextureDomain::MakeTexelDomain(backgroundTex.get(),
+ GrTextureDomain::MakeTexelDomain(backgroundTex->width(),
+ backgroundTex->height(),
background->subset()),
GrTextureDomain::kDecal_Mode,
GrTextureParams::kNone_FilterMode);
@@ -272,7 +274,8 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
foregroundFP = GrTextureDomainEffect::Make(
foregroundTex.get(), nullptr, foregroundMatrix,
- GrTextureDomain::MakeTexelDomain(foregroundTex.get(),
+ GrTextureDomain::MakeTexelDomain(foregroundTex->width(),
+ foregroundTex->height(),
foreground->subset()),
GrTextureDomain::kDecal_Mode,
GrTextureParams::kNone_FilterMode);
@@ -291,7 +294,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContext(
+ sk_sp<GrRenderTargetContext> renderTargetContext(context->makeDeferredRenderTargetContext(
SkBackingFit::kApprox, bounds.width(), bounds.height(),
GrRenderableConfigForColorSpace(outputProperties.colorSpace()),
sk_ref_sp(outputProperties.colorSpace())));
@@ -304,10 +307,10 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
matrix.setTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
renderTargetContext->drawRect(GrNoClip(), paint, matrix, SkRect::Make(bounds));
- return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()),
- kNeedNewImageUniqueID_SpecialImage,
- renderTargetContext->asTexture(),
- sk_ref_sp(renderTargetContext->getColorSpace()));
+ return SkSpecialImage::MakeDeferredFromGpu(SkIRect::MakeWH(bounds.width(), bounds.height()),
+ kNeedNewImageUniqueID_SpecialImage,
+ renderTargetContext->asDeferredTexture(),
+ sk_ref_sp(renderTargetContext->getColorSpace()));
}
sk_sp<GrFragmentProcessor>
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698