| 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 15 matching lines...) Expand all Loading... |
| 26 #define SkFractionalIntToInt(x) SkFixed48ToInt(x) | 26 #define SkFractionalIntToInt(x) SkFixed48ToInt(x) |
| 27 #else | 27 #else |
| 28 typedef SkFixed SkFractionalInt; | 28 typedef SkFixed SkFractionalInt; |
| 29 #define SkScalarToFractionalInt(x) SkScalarToFixed(x) | 29 #define SkScalarToFractionalInt(x) SkScalarToFixed(x) |
| 30 #define SkFractionalIntToFixed(x) (x) | 30 #define SkFractionalIntToFixed(x) (x) |
| 31 #define SkFixedToFractionalInt(x) (x) | 31 #define SkFixedToFractionalInt(x) (x) |
| 32 #define SkFractionalIntToInt(x) ((x) >> 16) | 32 #define SkFractionalIntToInt(x) ((x) >> 16) |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 class SkPaint; | 35 class SkPaint; |
| 36 struct SkConvolutionProcs; | |
| 37 | 36 |
| 38 struct SkBitmapProcState { | 37 struct SkBitmapProcState { |
| 39 | 38 |
| 40 SkBitmapProcState(): fScaledCacheID(NULL), fBitmapFilter(NULL) {} | 39 SkBitmapProcState(): fScaledCacheID(NULL), fBitmapFilter(NULL) {} |
| 41 ~SkBitmapProcState(); | 40 ~SkBitmapProcState(); |
| 42 | 41 |
| 43 typedef void (*ShaderProc32)(const SkBitmapProcState&, int x, int y, | 42 typedef void (*ShaderProc32)(const SkBitmapProcState&, int x, int y, |
| 44 SkPMColor[], int count); | 43 SkPMColor[], int count); |
| 45 | 44 |
| 46 typedef void (*ShaderProc16)(const SkBitmapProcState&, int x, int y, | 45 typedef void (*ShaderProc16)(const SkBitmapProcState&, int x, int y, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 fMatrixProc | 96 fMatrixProc |
| 98 fSampleProc32 | 97 fSampleProc32 |
| 99 fSampleProc32 | 98 fSampleProc32 |
| 100 | 99 |
| 101 They will already have valid function pointers, so a platform that does | 100 They will already have valid function pointers, so a platform that does |
| 102 not have an accelerated version can just leave that field as is. A valid | 101 not have an accelerated version can just leave that field as is. A valid |
| 103 implementation can do nothing (see SkBitmapProcState_opts_none.cpp) | 102 implementation can do nothing (see SkBitmapProcState_opts_none.cpp) |
| 104 */ | 103 */ |
| 105 void platformProcs(); | 104 void platformProcs(); |
| 106 | 105 |
| 107 /** Platforms can also optionally overwrite the convolution functions | |
| 108 if we have SIMD versions of them. | |
| 109 */ | |
| 110 | |
| 111 void platformConvolutionProcs(SkConvolutionProcs*); | |
| 112 | |
| 113 /** Given the byte size of the index buffer to be passed to the matrix proc, | 106 /** Given the byte size of the index buffer to be passed to the matrix proc, |
| 114 return the maximum number of resulting pixels that can be computed | 107 return the maximum number of resulting pixels that can be computed |
| 115 (i.e. the number of SkPMColor values to be written by the sample proc). | 108 (i.e. the number of SkPMColor values to be written by the sample proc). |
| 116 This routine takes into account that filtering and scale-vs-affine | 109 This routine takes into account that filtering and scale-vs-affine |
| 117 affect the amount of buffer space needed. | 110 affect the amount of buffer space needed. |
| 118 | 111 |
| 119 Only valid to call after chooseProcs (setContext) has been called. It is | 112 Only valid to call after chooseProcs (setContext) has been called. It is |
| 120 safe to call this inside the shader's shadeSpan() method. | 113 safe to call this inside the shader's shadeSpan() method. |
| 121 */ | 114 */ |
| 122 int maxCountForBufferSize(size_t bufferSize) const; | 115 int maxCountForBufferSize(size_t bufferSize) const; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 void S32_D16_filter_DX(const SkBitmapProcState& s, | 216 void S32_D16_filter_DX(const SkBitmapProcState& s, |
| 224 const uint32_t* xy, int count, uint16_t* colors); | 217 const uint32_t* xy, int count, uint16_t* colors); |
| 225 | 218 |
| 226 void highQualityFilter32(const SkBitmapProcState &s, int x, int y, | 219 void highQualityFilter32(const SkBitmapProcState &s, int x, int y, |
| 227 SkPMColor *SK_RESTRICT colors, int count); | 220 SkPMColor *SK_RESTRICT colors, int count); |
| 228 void highQualityFilter16(const SkBitmapProcState &s, int x, int y, | 221 void highQualityFilter16(const SkBitmapProcState &s, int x, int y, |
| 229 uint16_t *SK_RESTRICT colors, int count); | 222 uint16_t *SK_RESTRICT colors, int count); |
| 230 | 223 |
| 231 | 224 |
| 232 #endif | 225 #endif |
| OLD | NEW |