| OLD | NEW |
| 1 |
| 1 /* | 2 /* |
| 2 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 3 * | 4 * |
| 4 * 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 |
| 5 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 6 */ | 7 */ |
| 7 | 8 |
| 9 |
| 8 #ifndef SkBlitter_DEFINED | 10 #ifndef SkBlitter_DEFINED |
| 9 #define SkBlitter_DEFINED | 11 #define SkBlitter_DEFINED |
| 10 | 12 |
| 11 #ifdef SK_SUPPORT_LEGACY_BLITANTIH2V2 | |
| 12 #define SK_BLITANTIH2V2_VIRTUAL | |
| 13 #else | |
| 14 #define SK_BLITANTIH2V2_VIRTUAL virtual | |
| 15 #endif | |
| 16 | |
| 17 #include "SkBitmap.h" | 13 #include "SkBitmap.h" |
| 18 #include "SkBitmapProcShader.h" | 14 #include "SkBitmapProcShader.h" |
| 19 #include "SkMask.h" | 15 #include "SkMask.h" |
| 20 #include "SkMatrix.h" | 16 #include "SkMatrix.h" |
| 21 #include "SkPaint.h" | 17 #include "SkPaint.h" |
| 22 #include "SkRefCnt.h" | 18 #include "SkRefCnt.h" |
| 23 #include "SkRegion.h" | 19 #include "SkRegion.h" |
| 24 #include "SkShader.h" | 20 #include "SkShader.h" |
| 25 #include "SkSmallAllocator.h" | 21 #include "SkSmallAllocator.h" |
| 26 | 22 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 52 /// Blit a pattern of pixels defined by a rectangle-clipped mask; | 48 /// Blit a pattern of pixels defined by a rectangle-clipped mask; |
| 53 /// typically used for text. | 49 /// typically used for text. |
| 54 virtual void blitMask(const SkMask&, const SkIRect& clip); | 50 virtual void blitMask(const SkMask&, const SkIRect& clip); |
| 55 | 51 |
| 56 /** If the blitter just sets a single value for each pixel, return the | 52 /** If the blitter just sets a single value for each pixel, return the |
| 57 bitmap it draws into, and assign value. If not, return NULL and ignore | 53 bitmap it draws into, and assign value. If not, return NULL and ignore |
| 58 the value parameter. | 54 the value parameter. |
| 59 */ | 55 */ |
| 60 virtual const SkBitmap* justAnOpaqueColor(uint32_t* value); | 56 virtual const SkBitmap* justAnOpaqueColor(uint32_t* value); |
| 61 | 57 |
| 62 // (x, y), (x + 1, y) | |
| 63 SK_BLITANTIH2V2_VIRTUAL void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { | |
| 64 int16_t runs[3]; | |
| 65 uint8_t aa[2]; | |
| 66 | |
| 67 runs[0] = 1; | |
| 68 runs[1] = 1; | |
| 69 runs[2] = 0; | |
| 70 aa[0] = SkToU8(a0); | |
| 71 aa[1] = SkToU8(a1); | |
| 72 this->blitAntiH(x, y, aa, runs); | |
| 73 } | |
| 74 | |
| 75 // (x, y), (x, y + 1) | |
| 76 SK_BLITANTIH2V2_VIRTUAL void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { | |
| 77 int16_t runs[2]; | |
| 78 uint8_t aa[1]; | |
| 79 | |
| 80 runs[0] = 1; | |
| 81 runs[1] = 0; | |
| 82 aa[0] = SkToU8(a0); | |
| 83 this->blitAntiH(x, y, aa, runs); | |
| 84 // reset in case the clipping blitter modified runs | |
| 85 runs[0] = 1; | |
| 86 runs[1] = 0; | |
| 87 aa[0] = SkToU8(a1); | |
| 88 this->blitAntiH(x, y + 1, aa, runs); | |
| 89 } | |
| 90 | |
| 91 /** | 58 /** |
| 92 * Special method just to identify the null blitter, which is returned | 59 * Special method just to identify the null blitter, which is returned |
| 93 * from Choose() if the request cannot be fulfilled. Default impl | 60 * from Choose() if the request cannot be fulfilled. Default impl |
| 94 * returns false. | 61 * returns false. |
| 95 */ | 62 */ |
| 96 virtual bool isNullBlitter() const; | 63 virtual bool isNullBlitter() const; |
| 97 | 64 |
| 98 /** | 65 /** |
| 99 * Special methods for SkShaderBlitter. On all other classes this is a no-o
p. | 66 * Special methods for SkShaderBlitter. On all other classes this is a no-o
p. |
| 100 */ | 67 */ |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, | 208 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, |
| 242 const SkIRect* bounds = NULL); | 209 const SkIRect* bounds = NULL); |
| 243 | 210 |
| 244 private: | 211 private: |
| 245 SkNullBlitter fNullBlitter; | 212 SkNullBlitter fNullBlitter; |
| 246 SkRectClipBlitter fRectBlitter; | 213 SkRectClipBlitter fRectBlitter; |
| 247 SkRgnClipBlitter fRgnBlitter; | 214 SkRgnClipBlitter fRgnBlitter; |
| 248 }; | 215 }; |
| 249 | 216 |
| 250 #endif | 217 #endif |
| OLD | NEW |