OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 SkRasterPipeline_DEFINED | 8 #ifndef SkRasterPipeline_DEFINED |
9 #define SkRasterPipeline_DEFINED | 9 #define SkRasterPipeline_DEFINED |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 * 1) call st->next() with its mutated arguments, chaining to the next stage o
f the pipeline; or | 47 * 1) call st->next() with its mutated arguments, chaining to the next stage o
f the pipeline; or |
48 * 2) return, indicating the pipeline is complete for these pixels. | 48 * 2) return, indicating the pipeline is complete for these pixels. |
49 * | 49 * |
50 * Some stages that typically return are those that write a color to a destinati
on pointer, | 50 * Some stages that typically return are those that write a color to a destinati
on pointer, |
51 * but any stage can short-circuit the rest of the pipeline by returning instead
of calling next(). | 51 * but any stage can short-circuit the rest of the pipeline by returning instead
of calling next(). |
52 */ | 52 */ |
53 | 53 |
54 // TODO: There may be a better place to stuff tail, e.g. in the bottom alignment
bits of | 54 // TODO: There may be a better place to stuff tail, e.g. in the bottom alignment
bits of |
55 // the Stage*. This mostly matters on 64-bit Windows where every register is pr
ecious. | 55 // the Stage*. This mostly matters on 64-bit Windows where every register is pr
ecious. |
56 | 56 |
| 57 #define DECLARE_GAMMA(M, name) M(name##_r) M(name##_g) M(name##_b) M(name##_a) |
| 58 |
57 #define SK_RASTER_PIPELINE_STAGES(M) \ | 59 #define SK_RASTER_PIPELINE_STAGES(M) \ |
58 M(move_src_dst) M(clamp_0) M(clamp_a) M(unpremul) M(premul) \ | 60 M(move_src_dst) M(clamp_0) M(clamp_a) M(unpremul) M(premul) \ |
59 M(constant_color) M(store_f32) \ | 61 M(constant_color) M(store_f32) \ |
60 M(load_s_565) M(load_d_565) M(store_565) \ | 62 M(load_s_565) M(load_d_565) M(store_565) \ |
61 M(load_s_srgb) M(load_d_srgb) M(store_srgb) \ | 63 M(load_s_srgb) M(load_d_srgb) M(store_srgb) \ |
62 M(load_s_f16) M(load_d_f16) M(store_f16) \ | 64 M(load_s_f16) M(load_d_f16) M(store_f16) \ |
| 65 M(load_s_linear_rgba) M(load_s_linear_bgra) \ |
| 66 M(store_linear_rgba) M(store_linear_bgra) \ |
63 M(scale_u8) M(scale_constant_float) \ | 67 M(scale_u8) M(scale_constant_float) \ |
64 M(lerp_u8) M(lerp_565) M(lerp_constant_float) \ | 68 M(lerp_u8) M(lerp_565) M(lerp_constant_float) \ |
65 M(dst) \ | 69 M(dst) \ |
66 M(dstatop) M(dstin) M(dstout) M(dstover) \ | 70 M(dstatop) M(dstin) M(dstout) M(dstover) \ |
67 M(srcatop) M(srcin) M(srcout) M(srcover) \ | 71 M(srcatop) M(srcin) M(srcout) M(srcover) \ |
68 M(clear) M(modulate) M(multiply) M(plus_) M(screen) M(xor_) \ | 72 M(clear) M(modulate) M(multiply) M(plus_) M(screen) M(xor_) \ |
69 M(colorburn) M(colordodge) M(darken) M(difference) \ | 73 M(colorburn) M(colordodge) M(darken) M(difference) \ |
70 M(exclusion) M(hardlight) M(lighten) M(overlay) M(softlight) \ | 74 M(exclusion) M(hardlight) M(lighten) M(overlay) M(softlight) \ |
71 M(luminance_to_alpha) M(matrix_4x5) | 75 M(luminance_to_alpha) M(matrix_4x4) M(matrix_4x5) \ |
| 76 DECLARE_GAMMA(M, param_gamma) DECLARE_GAMMA(M, table_gamma) \ |
| 77 M(clut) M(labtoxyz) |
72 | 78 |
73 class SkRasterPipeline { | 79 class SkRasterPipeline { |
74 public: | 80 public: |
75 // No pipeline may be more than kMaxStages long. | 81 // No pipeline may be more than kMaxStages long. |
76 static const int kMaxStages = 32; | 82 static const int kMaxStages = 32; |
77 | 83 |
78 SkRasterPipeline(); | 84 SkRasterPipeline(); |
79 | 85 |
80 enum StockStage { | 86 enum StockStage { |
81 #define M(stage) stage, | 87 #define M(stage) stage, |
(...skipping 13 matching lines...) Expand all Loading... |
95 StockStage stage; | 101 StockStage stage; |
96 void* ctx; | 102 void* ctx; |
97 }; | 103 }; |
98 | 104 |
99 private: | 105 private: |
100 int fNum = 0; | 106 int fNum = 0; |
101 Stage fStages[kMaxStages]; | 107 Stage fStages[kMaxStages]; |
102 }; | 108 }; |
103 | 109 |
104 #endif//SkRasterPipeline_DEFINED | 110 #endif//SkRasterPipeline_DEFINED |
OLD | NEW |