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

Unified Diff: src/effects/SkBlurMaskFilter.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/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 0a98fa8c3a61ee52d3f95aa4266f278992e7ab0c..35bf428d870e8489c474d5e28334a95934f44eba 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -20,6 +20,7 @@
#include "GrContext.h"
#include "GrRenderTargetContext.h"
#include "GrTexture.h"
+#include "GrTextureProxy.h"
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
#include "GrStyle.h"
@@ -64,10 +65,10 @@ public:
const SkStrokeRec& strokeRec,
const SkRRect& rrect,
const SkRRect& devRRect) const override;
- bool filterMaskGPU(GrTexture* src,
+ bool filterMaskGPU(GrTextureProxy* src,
const SkMatrix& ctm,
const SkIRect& maskRect,
- GrTexture** result) const override;
+ GrTextureProxy** result) const override;
#endif
void computeFastBounds(const SkRect&, SkRect*) const override;
@@ -1084,6 +1085,8 @@ private:
GrRRectBlurEffect(float sigma, const SkRRect&, GrTexture* profileTexture);
+ GrRRectBlurEffect(float sigma, const SkRRect&, GrTextureProxy* profileTexture);
+
virtual void onGetGLSLProcessorKey(const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const override;
@@ -1100,11 +1103,11 @@ private:
typedef GrFragmentProcessor INHERITED;
};
-static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
- const SkRRect& rrectToDraw,
- const SkISize& size,
- float xformedSigma,
- bool doAA) {
+static sk_sp<GrTextureProxy> find_or_create_rrect_blur_mask(GrContext* context,
+ const SkRRect& rrectToDraw,
+ const SkISize& size,
+ float xformedSigma,
+ bool doAA) {
static const GrUniqueKey::Domain kDomain = GrUniqueKey::GenerateDomain();
GrUniqueKey key;
GrUniqueKey::Builder builder(&key, kDomain, 9);
@@ -1119,7 +1122,7 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
}
builder.finish();
- sk_sp<GrTexture> mask(context->textureProvider()->findAndRefTextureByUniqueKey(key));
+ sk_sp<GrTextureProxy> mask(context->textureProvider()->findAndRefTextureProxyByUniqueKey(key));
if (!mask) {
// TODO: this could be approx but the texture coords will need to be updated
sk_sp<GrRenderTargetContext> rtc(context->makeRenderTargetContextWithFallback(
@@ -1134,7 +1137,7 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
rtc->clear(nullptr, 0x0, true);
rtc->drawRRect(GrNoClip(), grPaint, SkMatrix::I(), rrectToDraw, GrStyle::SimpleFill());
- sk_sp<GrTexture> srcTexture(rtc->asTexture());
+ sk_sp<GrTextureProxy> srcTexture(rtc->asDeferredTexture());
sk_sp<GrRenderTargetContext> rtc2(SkGpuBlurUtils::GaussianBlur(context,
srcTexture.get(),
nullptr,
@@ -1148,9 +1151,9 @@ static sk_sp<GrTexture> find_or_create_rrect_blur_mask(GrContext* context,
return nullptr;
}
- mask = rtc2->asTexture();
+ mask = rtc2->asDeferredTexture();
SkASSERT(mask);
- context->textureProvider()->assignUniqueKeyToTexture(key, mask.get());
+ context->textureProvider()->assignUniqueKeyToDeferredTexture(key, mask.get());
}
return mask;
@@ -1187,8 +1190,8 @@ sk_sp<GrFragmentProcessor> GrRRectBlurEffect::Make(GrContext* context,
return nullptr;
}
- sk_sp<GrTexture> mask(find_or_create_rrect_blur_mask(context, rrectToDraw, size,
- xformedSigma, true));
+ sk_sp<GrTextureProxy> mask(find_or_create_rrect_blur_mask(context, rrectToDraw, size,
+ xformedSigma, true));
if (!mask) {
return nullptr;
}
@@ -1488,10 +1491,10 @@ bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRRect& devRRect,
return true;
}
-bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
+bool SkBlurMaskFilterImpl::filterMaskGPU(GrTextureProxy* src,
const SkMatrix& ctm,
const SkIRect& maskRect,
- GrTexture** result) const {
+ GrTextureProxy** result) const {
// 'maskRect' isn't snapped to the UL corner but the mask in 'src' is.
const SkIRect clipRect = SkIRect::MakeWH(maskRect.width(), maskRect.height());
@@ -1536,7 +1539,7 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
renderTargetContext->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::Make(clipRect));
}
- *result = renderTargetContext->asTexture().release();
+ *result = renderTargetContext->asDeferredTexture().release();
return true;
}
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698