| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 ** Copyright 2007, The Android Open Source Project | |
| 3 ** | |
| 4 ** Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 ** you may not use this file except in compliance with the License. | |
| 6 ** You may obtain a copy of the License at | |
| 7 ** | |
| 8 ** http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 ** | |
| 10 ** Unless required by applicable law or agreed to in writing, software | |
| 11 ** distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 ** See the License for the specific language governing permissions and | |
| 14 ** limitations under the License. | |
| 15 */ | |
| 16 | |
| 17 #ifndef SkBitmapProcState_DEFINED | |
| 18 #define SkBitmapProcState_DEFINED | |
| 19 | |
| 20 #include "SkBitmap.h" | |
| 21 #include "SkMatrix.h" | |
| 22 | |
| 23 class SkPaint; | |
| 24 | |
| 25 struct SkBitmapProcState { | |
| 26 | |
| 27 typedef void (*MatrixProc)(const SkBitmapProcState&, | |
| 28 uint32_t bitmapXY[], | |
| 29 int count, | |
| 30 int x, int y); | |
| 31 | |
| 32 typedef void (*SampleProc32)(const SkBitmapProcState&, | |
| 33 const uint32_t[], | |
| 34 int count, | |
| 35 SkPMColor colors[]); | |
| 36 | |
| 37 typedef void (*SampleProc16)(const SkBitmapProcState&, | |
| 38 const uint32_t[], | |
| 39 int count, | |
| 40 uint16_t colors[]); | |
| 41 | |
| 42 typedef SkFixed (*FixedTileProc)(SkFixed, int); | |
| 43 typedef int (*IntTileProc)(int, int); | |
| 44 | |
| 45 MatrixProc fMatrixProc; // chooseProcs | |
| 46 SampleProc32 fSampleProc32; // chooseProcs | |
| 47 SampleProc16 fSampleProc16; // chooseProcs | |
| 48 | |
| 49 SkMatrix fUnitInvMatrix; // chooseProcs | |
| 50 FixedTileProc fTileProcX; // chooseProcs | |
| 51 FixedTileProc fTileProcY; // chooseProcs | |
| 52 IntTileProc iTileProcX; // chooseProcs | |
| 53 IntTileProc iTileProcY; // chooseProcs | |
| 54 SkFixed fFilterOneX; | |
| 55 SkFixed fFilterOneY; | |
| 56 | |
| 57 const SkBitmap* fBitmap; // chooseProcs - orig or mip | |
| 58 SkBitmap fOrigBitmap; // CONSTRUCTOR | |
| 59 #ifdef SK_SUPPORT_MIPMAP | |
| 60 SkBitmap fMipBitmap; | |
| 61 #endif | |
| 62 SkPMColor fPaintPMColor; // chooseProcs - A8 config | |
| 63 const SkMatrix* fInvMatrix; // chooseProcs | |
| 64 SkMatrix::MapXYProc fInvProc; // chooseProcs | |
| 65 SkFixed fInvSx, fInvSy; // chooseProcs | |
| 66 SkFixed fInvKy; // chooseProcs | |
| 67 SkFixed fInvTxPlusHalf; // chooseProcs | |
| 68 SkFixed fInvTyPlusHalf; // chooseProcs | |
| 69 uint16_t fAlphaScale; // chooseProcs | |
| 70 uint8_t fInvType; // chooseProcs | |
| 71 uint8_t fTileModeX; // CONSTRUCTOR | |
| 72 uint8_t fTileModeY; // CONSTRUCTOR | |
| 73 SkBool8 fDoFilter; // chooseProcs | |
| 74 | |
| 75 bool chooseProcs(const SkMatrix& inv, const SkPaint&); | |
| 76 | |
| 77 private: | |
| 78 MatrixProc chooseMatrixProc(); | |
| 79 }; | |
| 80 | |
| 81 #endif | |
| OLD | NEW |