| 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 | |
| 47 bool isOpaque() const { | 45 bool isOpaque() const { |
| 48 return ((fValidFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUn
packA(fColor)); | 46 return ((fValidFlags & kA_GrColorComponentFlag) && 0xFF == GrColorUn
packA(fColor)); |
| 49 } | 47 } |
| 50 | 48 |
| 51 bool isSolidWhite() const { | 49 bool isSolidWhite() const { |
| 52 return (fValidFlags == kRGBA_GrColorComponentFlags && 0xFFFFFFFF ==
fColor); | 50 return (fValidFlags == kRGBA_GrColorComponentFlags && 0xFFFFFFFF ==
fColor); |
| 53 } | 51 } |
| 54 | 52 |
| 55 /** | 53 /** |
| 56 * If isSingleComponent is true, then the flag values for r, g, b, and a
must all be the | 54 * 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... |
| 248 * This creates an effect outside of the effect memory pool. The effect's destru
ctor will be called | 246 * This creates an effect outside of the effect memory pool. The effect's destru
ctor will be called |
| 249 * at global destruction time. NAME will be the name of the created GrProcessor. | 247 * at global destruction time. NAME will be the name of the created GrProcessor. |
| 250 */ | 248 */ |
| 251 #define GR_CREATE_STATIC_FRAGMENT_PROCESSOR(NAME, EFFECT_CLASS, ARGS)
\ | 249 #define GR_CREATE_STATIC_FRAGMENT_PROCESSOR(NAME, EFFECT_CLASS, ARGS)
\ |
| 252 static SkAlignedSStorage<sizeof(EFFECT_CLASS)> g_##NAME##_Storage;
\ | 250 static SkAlignedSStorage<sizeof(EFFECT_CLASS)> g_##NAME##_Storage;
\ |
| 253 static GrFragmentProcessor*
\ | 251 static GrFragmentProcessor*
\ |
| 254 NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EFFECT_CLASS, ARGS);
\ | 252 NAME SkNEW_PLACEMENT_ARGS(g_##NAME##_Storage.get(), EFFECT_CLASS, ARGS);
\ |
| 255 static SkAutoTDestroy<GrFragmentProcessor> NAME##_ad(NAME); | 253 static SkAutoTDestroy<GrFragmentProcessor> NAME##_ad(NAME); |
| 256 | 254 |
| 257 #endif | 255 #endif |
| OLD | NEW |