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

Unified Diff: src/effects/SkBlurMaskFilter.cpp

Issue 1151283004: Split drawing functionality out of GrContext and into new GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-GPU builds Created 5 years, 7 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/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 556cb4469daf266a70ba890831f1278c1cc91562..22a9ac62a20c40b5be5e64e753ea50e3b8584bf6 100644
--- a/src/effects/SkBlurMaskFilter.cpp
+++ b/src/effects/SkBlurMaskFilter.cpp
@@ -19,6 +19,7 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
+#include "GrDrawContext.h"
#include "GrTexture.h"
#include "GrFragmentProcessor.h"
#include "GrInvariantOutput.h"
@@ -870,8 +871,14 @@ bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrContext* context,
if (!viewMatrix.invert(&inverse)) {
return false;
}
- context->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), rect, inverse);
- return true;
+
+ GrDrawContext* drawContext = context->drawContext();
+ if (drawContext) {
+ drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), rect, inverse);
+ return true;
+ }
+
+ return false;
}
class GrRRectBlurEffect : public GrFragmentProcessor {
@@ -1154,8 +1161,15 @@ bool SkBlurMaskFilterImpl::directFilterRRectMaskGPU(GrContext* context,
if (!viewMatrix.invert(&inverse)) {
return false;
}
- context->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(), proxy_rect, inverse);
- return true;
+
+ GrDrawContext* drawContext = context->drawContext();
+ if (drawContext) {
+ drawContext->drawNonAARectWithLocalMatrix(rt, clip, *grp, SkMatrix::I(),
+ proxy_rect, inverse);
+ return true;
+ }
+
+ return false;
}
bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRect& srcBounds,
@@ -1236,8 +1250,14 @@ bool SkBlurMaskFilterImpl::filterMaskGPU(GrTexture* src,
// = 0 * src + (1 - src) * dst
paint.setCoverageSetOpXPFactory(SkRegion::kDifference_Op);
}
- context->drawRect((*result)->asRenderTarget(), GrClip::WideOpen(), paint, SkMatrix::I(),
- clipRect);
+
+ GrDrawContext* drawContext = context->drawContext();
+ if (!drawContext) {
+ return false;
+ }
+
+ drawContext->drawRect((*result)->asRenderTarget(), GrClip::WideOpen(),
+ paint, SkMatrix::I(), clipRect);
}
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