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

Unified Diff: src/effects/SkAlphaThresholdFilter.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/GrAlphaThresholdFragmentProcessor.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkAlphaThresholdFilter.cpp
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index b1c8b214609af956510482517706792a6f8ec079..092f469d12d2f7630ca589706666e1377cc679ba 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -18,6 +18,7 @@
#include "GrContext.h"
#include "GrRenderTargetContext.h"
#include "GrFixedClip.h"
+#include "GrTextureProxy.h"
#endif
class SK_API SkAlphaThresholdFilterImpl : public SkImageFilter {
@@ -37,7 +38,9 @@ protected:
SkIPoint* offset) const override;
#if SK_SUPPORT_GPU
- sk_sp<GrTexture> createMaskTexture(GrContext*, const SkMatrix&, const SkIRect& bounds) const;
+ sk_sp<GrTextureProxy> createMaskTexture(GrContext*,
+ const SkMatrix&,
+ const SkIRect& bounds) const;
#endif
private:
@@ -93,10 +96,9 @@ SkAlphaThresholdFilterImpl::SkAlphaThresholdFilterImpl(const SkRegion& region,
}
#if SK_SUPPORT_GPU
-sk_sp<GrTexture> SkAlphaThresholdFilterImpl::createMaskTexture(GrContext* context,
- const SkMatrix& inMatrix,
- const SkIRect& bounds) const {
-
+sk_sp<GrTextureProxy> SkAlphaThresholdFilterImpl::createMaskTexture(GrContext* context,
+ const SkMatrix& inMatrix,
+ const SkIRect& bounds) const {
sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContextWithFallback(
SkBackingFit::kApprox, bounds.width(), bounds.height(), kAlpha_8_GrPixelConfig, nullptr));
if (!renderTargetContext) {
@@ -115,7 +117,7 @@ sk_sp<GrTexture> SkAlphaThresholdFilterImpl::createMaskTexture(GrContext* contex
iter.next();
}
- return renderTargetContext->asTexture();
+ return renderTargetContext->asDeferredTexture();
}
#endif
@@ -147,7 +149,7 @@ sk_sp<SkSpecialImage> SkAlphaThresholdFilterImpl::onFilterImage(SkSpecialImage*
if (source->isTextureBacked()) {
GrContext* context = source->getContext();
- sk_sp<GrTexture> inputTexture(input->asTextureRef(context));
+ sk_sp<GrTextureProxy> inputTexture(input->asTextureProxy(context));
SkASSERT(inputTexture);
offset->fX = bounds.left();
@@ -158,7 +160,7 @@ sk_sp<SkSpecialImage> SkAlphaThresholdFilterImpl::onFilterImage(SkSpecialImage*
SkMatrix matrix(ctx.ctm());
matrix.postTranslate(SkIntToScalar(-bounds.left()), SkIntToScalar(-bounds.top()));
- sk_sp<GrTexture> maskTexture(this->createMaskTexture(context, matrix, bounds));
+ sk_sp<GrTextureProxy> maskTexture(this->createMaskTexture(context, matrix, bounds));
if (!maskTexture) {
return nullptr;
}
« no previous file with comments | « src/effects/GrAlphaThresholdFragmentProcessor.h ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698