| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkBitmapProcState_DEFINED | 10 #ifndef SkBitmapProcState_DEFINED |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 fMatrixProc | 90 fMatrixProc |
| 91 fSampleProc32 | 91 fSampleProc32 |
| 92 fSampleProc32 | 92 fSampleProc32 |
| 93 | 93 |
| 94 They will already have valid function pointers, so a platform that does | 94 They will already have valid function pointers, so a platform that does |
| 95 not have an accelerated version can just leave that field as is. A valid | 95 not have an accelerated version can just leave that field as is. A valid |
| 96 implementation can do nothing (see SkBitmapProcState_opts_none.cpp) | 96 implementation can do nothing (see SkBitmapProcState_opts_none.cpp) |
| 97 */ | 97 */ |
| 98 void platformProcs(); | 98 void platformProcs(); |
| 99 | 99 |
| 100 |
| 100 /** Given the byte size of the index buffer to be passed to the matrix proc, | 101 /** Given the byte size of the index buffer to be passed to the matrix proc, |
| 101 return the maximum number of resulting pixels that can be computed | 102 return the maximum number of resulting pixels that can be computed |
| 102 (i.e. the number of SkPMColor values to be written by the sample proc). | 103 (i.e. the number of SkPMColor values to be written by the sample proc). |
| 103 This routine takes into account that filtering and scale-vs-affine | 104 This routine takes into account that filtering and scale-vs-affine |
| 104 affect the amount of buffer space needed. | 105 affect the amount of buffer space needed. |
| 105 | 106 |
| 106 Only valid to call after chooseProcs (setContext) has been called. It is | 107 Only valid to call after chooseProcs (setContext) has been called. It is |
| 107 safe to call this inside the shader's shadeSpan() method. | 108 safe to call this inside the shader's shadeSpan() method. |
| 108 */ | 109 */ |
| 109 int maxCountForBufferSize(size_t bufferSize) const; | 110 int maxCountForBufferSize(size_t bufferSize) const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 132 SampleProc16 fSampleProc16; // chooseProcs | 133 SampleProc16 fSampleProc16; // chooseProcs |
| 133 | 134 |
| 134 SkMatrix fUnitInvMatrix; // chooseProcs | 135 SkMatrix fUnitInvMatrix; // chooseProcs |
| 135 SkBitmap fOrigBitmap; // CONSTRUCTOR | 136 SkBitmap fOrigBitmap; // CONSTRUCTOR |
| 136 SkBitmap fMipBitmap; | 137 SkBitmap fMipBitmap; |
| 137 | 138 |
| 138 MatrixProc chooseMatrixProc(bool trivial_matrix); | 139 MatrixProc chooseMatrixProc(bool trivial_matrix); |
| 139 bool chooseProcs(const SkMatrix& inv, const SkPaint&); | 140 bool chooseProcs(const SkMatrix& inv, const SkPaint&); |
| 140 ShaderProc32 chooseShaderProc32(); | 141 ShaderProc32 chooseShaderProc32(); |
| 141 | 142 |
| 143 |
| 144 /** test method for choosing a bicubic shading filter |
| 145 */ |
| 146 |
| 147 ShaderProc32 chooseBicubicFilterProc(const SkPaint &paint); |
| 148 |
| 142 // Return false if we failed to setup for fast translate (e.g. overflow) | 149 // Return false if we failed to setup for fast translate (e.g. overflow) |
| 143 bool setupForTranslate(); | 150 bool setupForTranslate(); |
| 144 | 151 |
| 145 #ifdef SK_DEBUG | 152 #ifdef SK_DEBUG |
| 146 static void DebugMatrixProc(const SkBitmapProcState&, | 153 static void DebugMatrixProc(const SkBitmapProcState&, |
| 147 uint32_t[], int count, int x, int y); | 154 uint32_t[], int count, int x, int y); |
| 148 #endif | 155 #endif |
| 149 }; | 156 }; |
| 150 | 157 |
| 151 /* Macros for packing and unpacking pairs of 16bit values in a 32bit uint. | 158 /* Macros for packing and unpacking pairs of 16bit values in a 32bit uint. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 void ClampX_ClampY_nofilter_scale(const SkBitmapProcState& s, uint32_t xy[], | 194 void ClampX_ClampY_nofilter_scale(const SkBitmapProcState& s, uint32_t xy[], |
| 188 int count, int x, int y); | 195 int count, int x, int y); |
| 189 void ClampX_ClampY_filter_affine(const SkBitmapProcState& s, | 196 void ClampX_ClampY_filter_affine(const SkBitmapProcState& s, |
| 190 uint32_t xy[], int count, int x, int y); | 197 uint32_t xy[], int count, int x, int y); |
| 191 void ClampX_ClampY_nofilter_affine(const SkBitmapProcState& s, | 198 void ClampX_ClampY_nofilter_affine(const SkBitmapProcState& s, |
| 192 uint32_t xy[], int count, int x, int y); | 199 uint32_t xy[], int count, int x, int y); |
| 193 void S32_D16_filter_DX(const SkBitmapProcState& s, | 200 void S32_D16_filter_DX(const SkBitmapProcState& s, |
| 194 const uint32_t* xy, int count, uint16_t* colo
rs); | 201 const uint32_t* xy, int count, uint16_t* colo
rs); |
| 195 | 202 |
| 196 #endif | 203 #endif |
| OLD | NEW |