Index: src/effects/SkArithmeticMode_gpu.cpp |
diff --git a/src/effects/SkArithmeticMode_gpu.cpp b/src/effects/SkArithmeticMode_gpu.cpp |
index 38bb904538509216ec1eafe6aac881684533fd80..6379b8dc822fba2f3bdf1c7bac49baef068b1469 100644 |
--- a/src/effects/SkArithmeticMode_gpu.cpp |
+++ b/src/effects/SkArithmeticMode_gpu.cpp |
@@ -166,7 +166,15 @@ public: |
~GLArithmeticXP() SK_OVERRIDE {} |
- void emitCode(const EmitArgs& args) SK_OVERRIDE { |
+ static void GenKey(const GrProcessor& processor, const GrGLCaps& caps, |
+ GrProcessorKeyBuilder* b) { |
+ const GrArithmeticXP& arith = processor.cast<GrArithmeticXP>(); |
+ uint32_t key = arith.enforcePMColor() ? 1 : 0; |
+ b->add32(key); |
+ } |
+ |
+private: |
+ void onEmitCode(const EmitArgs& args) SK_OVERRIDE { |
GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
const char* dstColor = fsBuilder->dstColor(); |
@@ -184,21 +192,13 @@ public: |
args.fInputCoverage, dstColor); |
} |
- void setData(const GrGLProgramDataManager& pdman, |
- const GrXferProcessor& processor) SK_OVERRIDE { |
+ void onSetData(const GrGLProgramDataManager& pdman, |
+ const GrXferProcessor& processor) SK_OVERRIDE { |
const GrArithmeticXP& arith = processor.cast<GrArithmeticXP>(); |
pdman.set4f(fKUni, arith.k1(), arith.k2(), arith.k3(), arith.k4()); |
fEnforcePMColor = arith.enforcePMColor(); |
}; |
- static void GenKey(const GrProcessor& processor, const GrGLCaps& caps, |
- GrProcessorKeyBuilder* b) { |
- const GrArithmeticXP& arith = processor.cast<GrArithmeticXP>(); |
- uint32_t key = arith.enforcePMColor() ? 1 : 0; |
- b->add32(key); |
- } |
- |
-private: |
GrGLProgramDataManager::UniformHandle fKUni; |
bool fEnforcePMColor; |
@@ -207,17 +207,18 @@ private: |
/////////////////////////////////////////////////////////////////////////////// |
-GrArithmeticXP::GrArithmeticXP(float k1, float k2, float k3, float k4, bool enforcePMColor) |
- : fK1(k1) |
+GrArithmeticXP::GrArithmeticXP(float k1, float k2, float k3, float k4, bool enforcePMColor, |
+ const GrDeviceCoordTexture* dstCopy, bool willReadDstColor) |
+ : INHERITED(dstCopy, willReadDstColor) |
+ , fK1(k1) |
, fK2(k2) |
, fK3(k3) |
, fK4(k4) |
, fEnforcePMColor(enforcePMColor) { |
this->initClassID<GrArithmeticXP>(); |
- this->setWillReadDstColor(); |
} |
-void GrArithmeticXP::getGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const { |
+void GrArithmeticXP::onGetGLProcessorKey(const GrGLCaps& caps, GrProcessorKeyBuilder* b) const { |
GLArithmeticXP::GenKey(*this, caps, b); |
} |