| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPixelXorXfermode.h" | 8 #include "SkPixelXorXfermode.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; | 166 GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |
| 167 typedef GrFragmentProcessor INHERITED; | 167 typedef GrFragmentProcessor INHERITED; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 /////////////////////////////////////////////////////////////////////////////// | 170 /////////////////////////////////////////////////////////////////////////////// |
| 171 | 171 |
| 172 class GLPixelXorFP : public GrGLSLFragmentProcessor { | 172 class GLPixelXorFP : public GrGLSLFragmentProcessor { |
| 173 public: | 173 public: |
| 174 void emitCode(EmitArgs& args) override { | 174 void emitCode(EmitArgs& args) override { |
| 175 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; | 175 GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; |
| 176 SkString dstColor("dstColor"); | 176 SkString dstColor("dstColor"); |
| 177 this->emitChild(0, nullptr, &dstColor, args); | 177 this->emitChild(0, nullptr, &dstColor, args); |
| 178 | 178 |
| 179 fOpColorUni = args.fUniformHandler->addUniform(kFragment_GrShaderFlag, | 179 fOpColorUni = args.fUniformHandler->addUniform(kFragment_GrShaderFlag, |
| 180 kVec3f_GrSLType, kHigh_Gr
SLPrecision, | 180 kVec3f_GrSLType, kHigh_Gr
SLPrecision, |
| 181 "opColor"); | 181 "opColor"); |
| 182 const char* kOpColorUni = args.fUniformHandler->getUniformCStr(fOpColorU
ni); | 182 const char* kOpColorUni = args.fUniformHandler->getUniformCStr(fOpColorU
ni); |
| 183 | 183 |
| 184 add_pixelxor_code(fragBuilder, args.fInputColor, dstColor.c_str(), | 184 add_pixelxor_code(fragBuilder, args.fInputColor, dstColor.c_str(), |
| 185 args.fOutputColor, kOpColorUni); | 185 args.fOutputColor, kOpColorUni); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 const GrFragmentProcessor* SkPixelXorXfermode::getFragmentProcessorForImageFilte
r( | 371 const GrFragmentProcessor* SkPixelXorXfermode::getFragmentProcessorForImageFilte
r( |
| 372 const GrFragmentProcesso
r* dst) const { | 372 const GrFragmentProcesso
r* dst) const { |
| 373 return PixelXorFP::Create(fOpColor, dst); | 373 return PixelXorFP::Create(fOpColor, dst); |
| 374 } | 374 } |
| 375 | 375 |
| 376 GrXPFactory* SkPixelXorXfermode::asXPFactory() const { | 376 GrXPFactory* SkPixelXorXfermode::asXPFactory() const { |
| 377 return GrPixelXorXPFactory::Create(fOpColor); | 377 return GrPixelXorXPFactory::Create(fOpColor); |
| 378 } | 378 } |
| 379 | 379 |
| 380 #endif | 380 #endif |
| OLD | NEW |