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

Unified Diff: src/effects/SkAlphaThresholdFilter.cpp

Issue 759713002: Make all blending up to GrOptDrawState be handled by the xp/xp factory. (Closed) Base URL: https://skia.googlesource.com/skia.git@xferFactorySolo
Patch Set: Clean up Created 6 years 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/SkAlphaThresholdFilter.cpp
diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/SkAlphaThresholdFilter.cpp
index ffdba322649a30ebd4cec24f37e57364ca038f4c..ae2a18a3905ad0115133551c3f9a14c76ec955ad 100644
--- a/src/effects/SkAlphaThresholdFilter.cpp
+++ b/src/effects/SkAlphaThresholdFilter.cpp
@@ -51,6 +51,7 @@ SkImageFilter* SkAlphaThresholdFilter::Create(const SkRegion& region,
#include "gl/builders/GrGLProgramBuilder.h"
#include "GrTBackendProcessorFactory.h"
#include "GrTextureAccess.h"
+#include "effects/GrPorterDuffXferProcessor.h"
#include "SkGr.h"
@@ -281,7 +282,8 @@ bool SkAlphaThresholdFilterImpl::asFragmentProcessor(GrFragmentProcessor** fp,
{
GrContext::AutoRenderTarget art(context, maskTexture->asRenderTarget());
GrPaint grPaint;
- grPaint.setBlendFunc(kOne_GrBlendCoeff, kZero_GrBlendCoeff);
+ GrXPFactory* xpFactory = GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode);
+ grPaint.setXPFactory(xpFactory)->unref();
SkRegion::Iterator iter(fRegion);
context->clear(NULL, 0x0, true, maskTexture->asRenderTarget());

Powered by Google App Engine
This is Rietveld 408576698