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

Side by Side Diff: src/gpu/effects/GrPorterDuffXferProcessor.cpp

Issue 1213623022: fix up test create functions (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more cleanup Created 5 years, 5 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/gpu/effects/GrOvalEffect.cpp ('k') | src/gpu/effects/GrRRectEffect.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 2014 Google Inc. 2 * Copyright 2014 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 "effects/GrPorterDuffXferProcessor.h" 8 #include "effects/GrPorterDuffXferProcessor.h"
9 9
10 #include "GrBlend.h" 10 #include "GrBlend.h"
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 if (covPOI.isFourChannelOutput()) { 801 if (covPOI.isFourChannelOutput()) {
802 return false; // The LCD XP will abort rather than doing a dst read. 802 return false; // The LCD XP will abort rather than doing a dst read.
803 } 803 }
804 // We fallback on the shader XP when the blend formula would use dual source blending but we 804 // We fallback on the shader XP when the blend formula would use dual source blending but we
805 // don't have support for it. 805 // don't have support for it.
806 return get_blend_formula(colorPOI, covPOI, hasMixedSamples, fXfermode).hasSe condaryOutput(); 806 return get_blend_formula(colorPOI, covPOI, hasMixedSamples, fXfermode).hasSe condaryOutput();
807 } 807 }
808 808
809 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory); 809 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory);
810 810
811 GrXPFactory* GrPorterDuffXPFactory::TestCreate(SkRandom* random, 811 GrXPFactory* GrPorterDuffXPFactory::TestCreate(GrProcessorTestData* d) {
812 GrContext*, 812 SkXfermode::Mode mode = SkXfermode::Mode(d->fRandom->nextULessThan(SkXfermod e::kLastCoeffMode));
813 const GrCaps&,
814 GrTexture*[]) {
815 SkXfermode::Mode mode = SkXfermode::Mode(random->nextULessThan(SkXfermode::k LastCoeffMode));
816 return GrPorterDuffXPFactory::Create(mode); 813 return GrPorterDuffXPFactory::Create(mode);
817 } 814 }
818 815
819 void GrPorterDuffXPFactory::TestGetXPOutputTypes(const GrXferProcessor* xp, 816 void GrPorterDuffXPFactory::TestGetXPOutputTypes(const GrXferProcessor* xp,
820 int* outPrimary, 817 int* outPrimary,
821 int* outSecondary) { 818 int* outSecondary) {
822 if (!!strcmp(xp->name(), "Porter Duff")) { 819 if (!!strcmp(xp->name(), "Porter Duff")) {
823 *outPrimary = *outSecondary = -1; 820 *outPrimary = *outSecondary = -1;
824 return; 821 return;
825 } 822 }
826 BlendFormula blendFormula = static_cast<const PorterDuffXferProcessor*>(xp)- >getBlendFormula(); 823 BlendFormula blendFormula = static_cast<const PorterDuffXferProcessor*>(xp)- >getBlendFormula();
827 *outPrimary = blendFormula.fPrimaryOutputType; 824 *outPrimary = blendFormula.fPrimaryOutputType;
828 *outSecondary = blendFormula.fSecondaryOutputType; 825 *outSecondary = blendFormula.fSecondaryOutputType;
829 } 826 }
830 827
OLDNEW
« no previous file with comments | « src/gpu/effects/GrOvalEffect.cpp ('k') | src/gpu/effects/GrRRectEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698