Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: src/effects/SkPixelXorXfermode.cpp

Issue 1674673002: Alter SkXfermode's asFragmentProcessor & asXPFactory contracts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix unit test bug Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/effects/SkAvoidXfermode.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/effects/SkAvoidXfermode.cpp ('k') | src/effects/SkXfermodeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698