OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkArithmeticMode.h" | 8 #include "SkArithmeticMode.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkFlattenableBuffers.h" | 10 #include "SkFlattenableBuffers.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
224 } | 224 } |
225 if (0 == i3) { | 225 if (0 == i3) { |
226 return SkNEW_ARGS(SkArithmeticMode_src, (i2, i4)); | 226 return SkNEW_ARGS(SkArithmeticMode_src, (i2, i4)); |
227 } | 227 } |
228 return SkNEW_ARGS(SkArithmeticMode_linear, (i2, i3, i4)); | 228 return SkNEW_ARGS(SkArithmeticMode_linear, (i2, i3, i4)); |
229 #endif | 229 #endif |
230 } | 230 } |
231 return SkNEW_ARGS(SkArithmeticMode_scalar, (k1, k2, k3, k4)); | 231 return SkNEW_ARGS(SkArithmeticMode_scalar, (k1, k2, k3, k4)); |
232 } | 232 } |
233 | 233 |
234 SkFlattenable::Factory SkArithmeticMode::GetFactory(SkFlattenable::Type type) { | |
235 switch(type) { | |
mtklein
2013/09/24 22:52:18
For these small guys, I think you're going to be l
sugoi1
2013/09/25 21:15:27
Done.
| |
236 case SkFlattenable::kSkArithmeticMode_scalar: | |
237 return SkArithmeticMode_scalar::CreateProc; | |
238 default: | |
239 break; | |
240 } | |
241 return NULL; | |
242 } | |
243 | |
244 SkFlattenable::TypeCheck SkArithmeticMode::GetTypeCheck(SkFlattenable::Type type ) { | |
245 switch(type) { | |
246 case SkFlattenable::kSkArithmeticMode_scalar: | |
247 return SkArithmeticMode_scalar::IsA; | |
248 default: | |
249 break; | |
250 } | |
251 return NULL; | |
252 } | |
234 | 253 |
235 ////////////////////////////////////////////////////////////////////////////// | 254 ////////////////////////////////////////////////////////////////////////////// |
236 | 255 |
237 #if SK_SUPPORT_GPU | 256 #if SK_SUPPORT_GPU |
238 | 257 |
239 class GrGLArithmeticEffect : public GrGLEffect { | 258 class GrGLArithmeticEffect : public GrGLEffect { |
240 public: | 259 public: |
241 GrGLArithmeticEffect(const GrBackendEffectFactory&, const GrDrawEffect&); | 260 GrGLArithmeticEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
242 virtual ~GrGLArithmeticEffect(); | 261 virtual ~GrGLArithmeticEffect(); |
243 | 262 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 background); | 462 background); |
444 } | 463 } |
445 return true; | 464 return true; |
446 } | 465 } |
447 | 466 |
448 #endif | 467 #endif |
449 | 468 |
450 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) | 469 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) |
451 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) | 470 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) |
452 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 471 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |