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

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

Issue 767873006: Check XpFactory equality in DrawState (Closed) Base URL: https://skia.googlesource.com/skia.git@moveXPHeader
Patch Set: Rebase Created 6 years 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/GrProcessor.cpp ('k') | no next file » | 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 "GrDrawState.h" 10 #include "GrDrawState.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 GrGLFragmentProcessor* GrPorterDuffXferProcessor::createGLInstance() const { 58 GrGLFragmentProcessor* GrPorterDuffXferProcessor::createGLInstance() const {
59 return SkNEW_ARGS(GrGLPorterDuffXferProcessor, (*this)); 59 return SkNEW_ARGS(GrGLPorterDuffXferProcessor, (*this));
60 } 60 }
61 61
62 void GrPorterDuffXferProcessor::onComputeInvariantOutput(GrInvariantOutput* inou t) const { 62 void GrPorterDuffXferProcessor::onComputeInvariantOutput(GrInvariantOutput* inou t) const {
63 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput); 63 inout->setToUnknown(GrInvariantOutput::kWillNot_ReadInput);
64 } 64 }
65 65
66 /////////////////////////////////////////////////////////////////////////////// 66 ///////////////////////////////////////////////////////////////////////////////
67 67
68 GrPorterDuffXPFactory::GrPorterDuffXPFactory(GrBlendCoeff src, GrBlendCoeff dst)
69 : fSrc(src), fDst(dst) {
70 this->initClassID<GrPorterDuffXPFactory>();
71 }
72
68 GrXPFactory* GrPorterDuffXPFactory::Create(SkXfermode::Mode mode) { 73 GrXPFactory* GrPorterDuffXPFactory::Create(SkXfermode::Mode mode) {
69 switch (mode) { 74 switch (mode) {
70 case SkXfermode::kClear_Mode: { 75 case SkXfermode::kClear_Mode: {
71 static GrPorterDuffXPFactory gClearPDXPF(kZero_GrBlendCoeff, kZero_G rBlendCoeff); 76 static GrPorterDuffXPFactory gClearPDXPF(kZero_GrBlendCoeff, kZero_G rBlendCoeff);
72 return SkRef(&gClearPDXPF); 77 return SkRef(&gClearPDXPF);
73 break; 78 break;
74 } 79 }
75 case SkXfermode::kSrc_Mode: { 80 case SkXfermode::kSrc_Mode: {
76 static GrPorterDuffXPFactory gSrcPDXPF(kOne_GrBlendCoeff, kZero_GrBl endCoeff); 81 static GrPorterDuffXPFactory gSrcPDXPF(kOne_GrBlendCoeff, kZero_GrBl endCoeff);
77 return SkRef(&gSrcPDXPF); 82 return SkRef(&gSrcPDXPF);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 158
154 bool GrPorterDuffXPFactory::supportsRGBCoverage(GrColor /*knownColor*/, 159 bool GrPorterDuffXPFactory::supportsRGBCoverage(GrColor /*knownColor*/,
155 uint32_t knownColorFlags) const { 160 uint32_t knownColorFlags) const {
156 if (kOne_GrBlendCoeff == fSrc && kISA_GrBlendCoeff == fDst && 161 if (kOne_GrBlendCoeff == fSrc && kISA_GrBlendCoeff == fDst &&
157 kRGBA_GrColorComponentFlags == knownColorFlags) { 162 kRGBA_GrColorComponentFlags == knownColorFlags) {
158 return true; 163 return true;
159 } 164 }
160 return false; 165 return false;
161 } 166 }
162 167
OLDNEW
« no previous file with comments | « src/gpu/GrProcessor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698