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 if (SkFlattenable::kSkArithmeticMode_scalar_Type == type) { |
| 236 return SkArithmeticMode_scalar::CreateProc; |
| 237 } |
| 238 return NULL; |
| 239 } |
| 240 |
| 241 SkFlattenable::TypeCheck SkArithmeticMode::GetTypeCheck(SkFlattenable::Type type
) { |
| 242 if (SkFlattenable::kSkArithmeticMode_scalar_Type == type) { |
| 243 return SkArithmeticMode_scalar::IsA; |
| 244 } |
| 245 return NULL; |
| 246 } |
234 | 247 |
235 ////////////////////////////////////////////////////////////////////////////// | 248 ////////////////////////////////////////////////////////////////////////////// |
236 | 249 |
237 #if SK_SUPPORT_GPU | 250 #if SK_SUPPORT_GPU |
238 | 251 |
239 class GrGLArithmeticEffect : public GrGLEffect { | 252 class GrGLArithmeticEffect : public GrGLEffect { |
240 public: | 253 public: |
241 GrGLArithmeticEffect(const GrBackendEffectFactory&, const GrDrawEffect&); | 254 GrGLArithmeticEffect(const GrBackendEffectFactory&, const GrDrawEffect&); |
242 virtual ~GrGLArithmeticEffect(); | 255 virtual ~GrGLArithmeticEffect(); |
243 | 256 |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 background); | 434 background); |
422 } | 435 } |
423 return true; | 436 return true; |
424 } | 437 } |
425 | 438 |
426 #endif | 439 #endif |
427 | 440 |
428 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) | 441 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkArithmeticMode) |
429 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) | 442 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArithmeticMode_scalar) |
430 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 443 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |