OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #ifndef GrProcessor_DEFINED | 8 #ifndef GrProcessor_DEFINED |
9 #define GrProcessor_DEFINED | 9 #define GrProcessor_DEFINED |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 public: | 35 public: |
36 SK_DECLARE_INST_COUNT(GrProcessor) | 36 SK_DECLARE_INST_COUNT(GrProcessor) |
37 | 37 |
38 virtual ~GrProcessor(); | 38 virtual ~GrProcessor(); |
39 | 39 |
40 struct InvariantOutput{ | 40 struct InvariantOutput{ |
41 GrColor fColor; | 41 GrColor fColor; |
42 uint32_t fValidFlags; | 42 uint32_t fValidFlags; |
43 bool fIsSingleComponent; | 43 bool fIsSingleComponent; |
44 | 44 |
| 45 InvariantOutput() : fColor(0), fValidFlags(0), fIsSingleComponent(false)
{} |
| 46 |
45 bool isOpaque() const { | 47 bool isOpaque() const { |
46 return ((fValidFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUn
packA(fColor)); | 48 return ((fValidFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUn
packA(fColor)); |
47 } | 49 } |
48 | 50 |
49 bool isSolidWhite() const { | 51 bool isSolidWhite() const { |
50 return (fValidFlags == kRGBA_GrColorComponentFlags && 0xFFFFFFFF ==
fColor); | 52 return (fValidFlags == kRGBA_GrColorComponentFlags && 0xFFFFFFFF ==
fColor); |
51 } | 53 } |
52 | 54 |
53 /** | 55 /** |
54 * If isSingleComponent is true, then the flag values for r, g, b, and a
must all be the | 56 * If isSingleComponent is true, then the flag values for r, g, b, and a
must all be the |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 * This creates an effect outside of the effect memory pool. The effect's destru
ctor will be called | 248 * This creates an effect outside of the effect memory pool. The effect's destru
ctor will be called |
247 * at global destruction time. NAME will be the name of the created GrProcessor. | 249 * at global destruction time. NAME will be the name of the created GrProcessor. |
248 */ | 250 */ |
249 #define GR_CREATE_STATIC_FRAGMENT_PROCESSOR(NAME, EFFECT_CLASS, ARGS)
\ | 251 #define GR_CREATE_STATIC_FRAGMENT_PROCESSOR(NAME, EFFECT_CLASS, ARGS)
\ |
250 static SkAlignedSStorage<sizeof(EFFECT_CLASS)> g_##NAME##_Storage;
\ | 252 static SkAlignedSStorage<sizeof(EFFECT_CLASS)> g_##NAME##_Storage;
\ |
251 static GrFragmentProcessor*
\ | 253 static GrFragmentProcessor*
\ |
252 NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EFFECT_CLASS, ARGS);
\ | 254 NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EFFECT_CLASS, ARGS);
\ |
253 static SkAutoTDestroy<GrFragmentProcessor> NAME##_ad(NAME); | 255 static SkAutoTDestroy<GrFragmentProcessor> NAME##_ad(NAME); |
254 | 256 |
255 #endif | 257 #endif |
OLD | NEW |