aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkAlphaThresholdFilter.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-05-26 11:38:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-26 11:38:03 -0700
commitea4615034498aca2f9ca1753fb9a1ef10508d8cc (patch)
tree22f0027849de0dd18b199fb13c6c28be812cf229 /src/effects/SkAlphaThresholdFilter.cpp
parent884e97cb04db7ed053a866567ee9c6e4c01f993a (diff)
Split drawing functionality out of GrContext and into new GrDrawContext
This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext). I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them. Review URL: https://codereview.chromium.org/1151283004
Diffstat (limited to 'src/effects/SkAlphaThresholdFilter.cpp')
-rw-r--r--src/effects/SkAlphaThresholdFilter.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index d4638779a4..395408c23e 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -10,6 +10,9 @@
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
#include "SkRegion.h"
+#if SK_SUPPORT_GPU
+#include "GrDrawContext.h"
+#endif
class SK_API SkAlphaThresholdFilterImpl : public SkImageFilter {
public:
@@ -284,16 +287,17 @@ bool SkAlphaThresholdFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp,
return false;
}
- {
+ GrDrawContext* drawContext = context->drawContext();
+ if (drawContext) {
GrPaint grPaint;
grPaint.setPorterDuffXPFactory(SkXfermode::kSrc_Mode);
SkRegion::Iterator iter(fRegion);
- context->clear(NULL, 0x0, true, maskTexture->asRenderTarget());
+ drawContext->clear(maskTexture->asRenderTarget(), NULL, 0x0, true);
while (!iter.done()) {
SkRect rect = SkRect::Make(iter.rect());
- context->drawRect(maskTexture->asRenderTarget(), GrClip::WideOpen(), grPaint,
- in_matrix, rect);
+ drawContext->drawRect(maskTexture->asRenderTarget(), GrClip::WideOpen(), grPaint,
+ in_matrix, rect);
iter.next();
}
}