| 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 add_pixelxor_code(fragBuilder, srcColor, dstColor, outColor, kOpColorUni
); | 287 add_pixelxor_code(fragBuilder, srcColor, dstColor, outColor, kOpColorUni
); |
| 288 | 288 |
| 289 // Apply coverage. | 289 // Apply coverage. |
| 290 INHERITED::DefaultCoverageModulation(fragBuilder, srcCoverage, dstColor,
outColor, | 290 INHERITED::DefaultCoverageModulation(fragBuilder, srcCoverage, dstColor,
outColor, |
| 291 outColorSecondary, proc); | 291 outColorSecondary, proc); |
| 292 } | 292 } |
| 293 | 293 |
| 294 void onSetData(const GrGLSLProgramDataManager& pdman, | 294 void onSetData(const GrGLSLProgramDataManager& pdman, |
| 295 const GrXferProcessor& processor) override { | 295 const GrXferProcessor& processor) override { |
| 296 const PixelXorXP& pixelXor = processor.cast<PixelXorXP>(); | 296 const PixelXorXP& pixelXor = processor.cast<PixelXorXP>(); |
| 297 pdman.set3f(fOpColorUni, | 297 pdman.set3f(fOpColorUni, |
| 298 SkGetPackedR32(pixelXor.opColor())/255.0f, | 298 SkGetPackedR32(pixelXor.opColor())/255.0f, |
| 299 SkGetPackedG32(pixelXor.opColor())/255.0f, | 299 SkGetPackedG32(pixelXor.opColor())/255.0f, |
| 300 SkGetPackedB32(pixelXor.opColor())/255.0f); | 300 SkGetPackedB32(pixelXor.opColor())/255.0f); |
| 301 }; | 301 }; |
| 302 | 302 |
| 303 GrGLSLProgramDataManager::UniformHandle fOpColorUni; | 303 GrGLSLProgramDataManager::UniformHandle fOpColorUni; |
| 304 | 304 |
| 305 typedef GrGLSLXferProcessor INHERITED; | 305 typedef GrGLSLXferProcessor INHERITED; |
| 306 }; | 306 }; |
| 307 | 307 |
| (...skipping 63 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 |