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

Unified Diff: src/effects/SkAlphaThresholdFilter.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/core/SkImageFilter.cpp ('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 d4638779a47b06f60027a49a300fa7ed46659c2e..395408c23e48bbfadd29ee94ad80b4704786e814 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();
}
}
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698