OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 The Android Open Source Project |
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 SkBitmapProcState_DEFINED | 8 #ifndef SkBitmapProcState_DEFINED |
9 #define SkBitmapProcState_DEFINED | 9 #define SkBitmapProcState_DEFINED |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 typedef void (*MatrixProc)(const SkBitmapProcState&, | 39 typedef void (*MatrixProc)(const SkBitmapProcState&, |
40 uint32_t bitmapXY[], | 40 uint32_t bitmapXY[], |
41 int count, | 41 int count, |
42 int x, int y); | 42 int x, int y); |
43 | 43 |
44 typedef void (*SampleProc32)(const SkBitmapProcState&, | 44 typedef void (*SampleProc32)(const SkBitmapProcState&, |
45 const uint32_t[], | 45 const uint32_t[], |
46 int count, | 46 int count, |
47 SkPMColor colors[]); | 47 SkPMColor colors[]); |
48 | 48 |
49 typedef void (*SampleProc16)(const SkBitmapProcState&, | |
50 const uint32_t[], | |
51 int count, | |
52 uint16_t colors[]); | |
53 | |
54 typedef U16CPU (*FixedTileProc)(SkFixed); // returns 0..0xFFFF | 49 typedef U16CPU (*FixedTileProc)(SkFixed); // returns 0..0xFFFF |
55 typedef U16CPU (*FixedTileLowBitsProc)(SkFixed, int); // returns 0..0xF | 50 typedef U16CPU (*FixedTileLowBitsProc)(SkFixed, int); // returns 0..0xF |
56 typedef U16CPU (*IntTileProc)(int value, int count); // returns 0..count-1 | 51 typedef U16CPU (*IntTileProc)(int value, int count); // returns 0..count-1 |
57 | 52 |
58 SkPixmap fPixmap; | 53 SkPixmap fPixmap; |
59 SkMatrix fInvMatrix; // copy of what is in fBMState, can
we remove the dup? | 54 SkMatrix fInvMatrix; // copy of what is in fBMState, can
we remove the dup? |
60 | 55 |
61 SkMatrix::MapXYProc fInvProc; // chooseProcs | 56 SkMatrix::MapXYProc fInvProc; // chooseProcs |
62 | 57 |
63 SkFractionalInt fInvSxFractionalInt; | 58 SkFractionalInt fInvSxFractionalInt; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // are ignored | 105 // are ignored |
111 ShaderProc32 getShaderProc32() const { return fShaderProc32; } | 106 ShaderProc32 getShaderProc32() const { return fShaderProc32; } |
112 ShaderProc16 getShaderProc16() const { return fShaderProc16; } | 107 ShaderProc16 getShaderProc16() const { return fShaderProc16; } |
113 | 108 |
114 #ifdef SK_DEBUG | 109 #ifdef SK_DEBUG |
115 MatrixProc getMatrixProc() const; | 110 MatrixProc getMatrixProc() const; |
116 #else | 111 #else |
117 MatrixProc getMatrixProc() const { return fMatrixProc; } | 112 MatrixProc getMatrixProc() const { return fMatrixProc; } |
118 #endif | 113 #endif |
119 SampleProc32 getSampleProc32() const { return fSampleProc32; } | 114 SampleProc32 getSampleProc32() const { return fSampleProc32; } |
120 SampleProc16 getSampleProc16() const { return fSampleProc16; } | |
121 | 115 |
122 private: | 116 private: |
123 friend class SkBitmapProcShader; | 117 friend class SkBitmapProcShader; |
124 friend class SkLightingShaderImpl; | 118 friend class SkLightingShaderImpl; |
125 | 119 |
126 ShaderProc32 fShaderProc32; // chooseProcs | 120 ShaderProc32 fShaderProc32; // chooseProcs |
127 ShaderProc16 fShaderProc16; // chooseProcs | 121 ShaderProc16 fShaderProc16; // chooseProcs |
128 // These are used if the shaderproc is nullptr | 122 // These are used if the shaderproc is nullptr |
129 MatrixProc fMatrixProc; // chooseProcs | 123 MatrixProc fMatrixProc; // chooseProcs |
130 SampleProc32 fSampleProc32; // chooseProcs | 124 SampleProc32 fSampleProc32; // chooseProcs |
131 SampleProc16 fSampleProc16; // chooseProcs | |
132 | 125 |
133 const SkBitmapProvider fProvider; | 126 const SkBitmapProvider fProvider; |
134 | 127 |
135 enum { | 128 enum { |
136 kBMStateSize = 136 // found by inspection. if too small, we will call n
ew/delete | 129 kBMStateSize = 136 // found by inspection. if too small, we will call n
ew/delete |
137 }; | 130 }; |
138 SkAlignedSStorage<kBMStateSize> fBMStateStorage; | 131 SkAlignedSStorage<kBMStateSize> fBMStateStorage; |
139 SkBitmapController::State* fBMState; | 132 SkBitmapController::State* fBMState; |
140 | 133 |
141 MatrixProc chooseMatrixProc(bool trivial_matrix); | 134 MatrixProc chooseMatrixProc(bool trivial_matrix); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 } | 216 } |
224 | 217 |
225 SkFractionalInt x() const { return fX; } | 218 SkFractionalInt x() const { return fX; } |
226 SkFractionalInt y() const { return fY; } | 219 SkFractionalInt y() const { return fY; } |
227 | 220 |
228 private: | 221 private: |
229 SkFractionalInt fX, fY; | 222 SkFractionalInt fX, fY; |
230 }; | 223 }; |
231 | 224 |
232 #endif | 225 #endif |
OLD | NEW |