Index: src/gpu/GrClipMaskManager.cpp |
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp |
index f86aa9de29f7e1eb649972d4b88179505ab1c614..f8386b5c3123c660001a12185b8eeb186a06a762 100644 |
--- a/src/gpu/GrClipMaskManager.cpp |
+++ b/src/gpu/GrClipMaskManager.cpp |
@@ -18,9 +18,10 @@ |
#include "SkRasterClip.h" |
#include "SkStrokeRec.h" |
#include "SkTLazy.h" |
-#include "effects/GrTextureDomain.h" |
#include "effects/GrConvexPolyEffect.h" |
+#include "effects/GrPorterDuffXferProcessor.h" |
#include "effects/GrRRectEffect.h" |
+#include "effects/GrTextureDomain.h" |
#define GR_AA_CLIP 1 |
typedef SkClipStack::Element Element; |
@@ -332,29 +333,31 @@ namespace { |
// set up the OpenGL blend function to perform the specified |
// boolean operation for alpha clip mask creation |
void setup_boolean_blendcoeffs(SkRegion::Op op, GrDrawState* drawState) { |
+ GrXPFactory* xpFactory = NULL; |
switch (op) { |
case SkRegion::kReplace_Op: |
- drawState->setBlendFunc(kOne_GrBlendCoeff, kZero_GrBlendCoeff); |
+ xpFactory = GrPorterDuffXPFactory::Create(kOne_GrBlendCoeff, kZero_GrBlendCoeff); |
break; |
case SkRegion::kIntersect_Op: |
- drawState->setBlendFunc(kDC_GrBlendCoeff, kZero_GrBlendCoeff); |
+ xpFactory = GrPorterDuffXPFactory::Create(kDC_GrBlendCoeff, kZero_GrBlendCoeff); |
break; |
case SkRegion::kUnion_Op: |
- drawState->setBlendFunc(kOne_GrBlendCoeff, kISC_GrBlendCoeff); |
+ xpFactory = GrPorterDuffXPFactory::Create(kOne_GrBlendCoeff, kISC_GrBlendCoeff); |
break; |
case SkRegion::kXOR_Op: |
- drawState->setBlendFunc(kIDC_GrBlendCoeff, kISC_GrBlendCoeff); |
+ xpFactory = GrPorterDuffXPFactory::Create(kIDC_GrBlendCoeff, kISC_GrBlendCoeff); |
break; |
case SkRegion::kDifference_Op: |
- drawState->setBlendFunc(kZero_GrBlendCoeff, kISC_GrBlendCoeff); |
+ xpFactory = GrPorterDuffXPFactory::Create(kZero_GrBlendCoeff, kISC_GrBlendCoeff); |
break; |
case SkRegion::kReverseDifference_Op: |
- drawState->setBlendFunc(kIDC_GrBlendCoeff, kZero_GrBlendCoeff); |
+ xpFactory = GrPorterDuffXPFactory::Create(kIDC_GrBlendCoeff, kZero_GrBlendCoeff); |
break; |
default: |
SkASSERT(false); |
break; |
} |
+ drawState->setXPFactory(xpFactory)->unref(); |
} |
} |