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

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: 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
Index: src/effects/SkBlurMaskFilter.cpp
diff --git a/src/effects/SkBlurMaskFilter.cpp b/src/effects/SkBlurMaskFilter.cpp
index 556cb4469daf266a70ba890831f1278c1cc91562..7534959c6b43ae99ba0925157f81a5441d40e49c 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,14 @@ 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);
bsalomon 2015/05/22 20:33:57 wrap?
robertphillips 2015/05/26 16:12:58 Done.
+ return true;
+ }
+
+ return false;
}
bool SkBlurMaskFilterImpl::canFilterMaskGPU(const SkRect& srcBounds,
@@ -1236,8 +1249,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;

Powered by Google App Engine
This is Rietveld 408576698