OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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/GrXfermodeFragmentProcessor.h" | 8 #include "effects/GrXfermodeFragmentProcessor.h" |
9 | 9 |
10 #include "GrFragmentProcessor.h" | 10 #include "GrFragmentProcessor.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 } | 140 } |
141 | 141 |
142 | 142 |
143 const GrFragmentProcessor* GrXfermodeFragmentProcessor::CreateFromTwoProcessors( | 143 const GrFragmentProcessor* GrXfermodeFragmentProcessor::CreateFromTwoProcessors( |
144 const GrFragmentProcessor* src, const GrFragmentProcessor* dst, SkXferm
ode::Mode mode) { | 144 const GrFragmentProcessor* src, const GrFragmentProcessor* dst, SkXferm
ode::Mode mode) { |
145 if (SkXfermode::kLastCoeffMode < mode) { | 145 if (SkXfermode::kLastCoeffMode < mode) { |
146 return nullptr; | 146 return nullptr; |
147 } | 147 } |
148 switch (mode) { | 148 switch (mode) { |
149 case SkXfermode::kClear_Mode: | 149 case SkXfermode::kClear_Mode: |
150 SkDebugf("CreateFromTwoProcessors() should not be used with kClear_M
ode. " | |
151 "Use GrConstColorProcessor.\n"); | |
152 return GrConstColorProcessor::Create(GrColor_TRANS_BLACK, | 150 return GrConstColorProcessor::Create(GrColor_TRANS_BLACK, |
153 GrConstColorProcessor::kIgnore_
InputMode); | 151 GrConstColorProcessor::kIgnore_
InputMode); |
154 break; | 152 break; |
155 case SkXfermode::kSrc_Mode: | 153 case SkXfermode::kSrc_Mode: |
156 SkDebugf("CreateFromTwoProcessors() should not be used with kSrc_Mod
e. " | |
157 "Use the src processor directly.\n"); | |
158 return SkRef(src); | 154 return SkRef(src); |
159 break; | 155 break; |
160 case SkXfermode::kDst_Mode: | 156 case SkXfermode::kDst_Mode: |
161 SkDebugf("CreateFromTwoProcessors() should not be used with kDst_Mod
e. " | |
162 "Use the dst processor directly.\n"); | |
163 return SkRef(dst); | 157 return SkRef(dst); |
164 break; | 158 break; |
165 default: | 159 default: |
166 return new GrComposeTwoFragmentProcessor(src, dst, mode); | 160 return new GrComposeTwoFragmentProcessor(src, dst, mode); |
167 } | 161 } |
168 } | 162 } |
OLD | NEW |