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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 GR_DEFINE_XP_FACTORY_TEST(GrPixelXorXPFactory); | 361 GR_DEFINE_XP_FACTORY_TEST(GrPixelXorXPFactory); |
362 | 362 |
363 const GrXPFactory* GrPixelXorXPFactory::TestCreate(GrProcessorTestData* d) { | 363 const GrXPFactory* GrPixelXorXPFactory::TestCreate(GrProcessorTestData* d) { |
364 SkColor color = d->fRandom->nextU(); | 364 SkColor color = d->fRandom->nextU(); |
365 | 365 |
366 return GrPixelXorXPFactory::Create(SkPreMultiplyColor(color)); | 366 return GrPixelXorXPFactory::Create(SkPreMultiplyColor(color)); |
367 } | 367 } |
368 | 368 |
369 /////////////////////////////////////////////////////////////////////////////// | 369 /////////////////////////////////////////////////////////////////////////////// |
370 | 370 |
371 bool SkPixelXorXfermode::asFragmentProcessor(const GrFragmentProcessor** output, | 371 const GrFragmentProcessor* SkPixelXorXfermode::getFragmentProcessorForImageFilte
r( |
372 const GrFragmentProcessor* dst) con
st { | 372 const GrFragmentProcesso
r* dst) const { |
373 if (output) { | 373 return PixelXorFP::Create(fOpColor, dst); |
374 *output = PixelXorFP::Create(fOpColor, dst); | |
375 } | |
376 return true; | |
377 } | 374 } |
378 | 375 |
379 bool SkPixelXorXfermode::asXPFactory(GrXPFactory** xpf) const { | 376 GrXPFactory* SkPixelXorXfermode::asXPFactory() const { |
380 if (xpf) { | 377 return GrPixelXorXPFactory::Create(fOpColor); |
381 *xpf = GrPixelXorXPFactory::Create(fOpColor); | |
382 } | |
383 return true; | |
384 } | 378 } |
385 | 379 |
386 #endif | 380 #endif |
OLD | NEW |