OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 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 SkBlitter_DEFINED | 8 #ifndef SkBlitter_DEFINED |
9 #define SkBlitter_DEFINED | 9 #define SkBlitter_DEFINED |
10 | 10 |
| 11 #ifdef SK_SUPPORT_LEGACY_BLITANTIH2V2 |
| 12 #define SK_BLITANTIH2V2_VIRTUAL |
| 13 #else |
| 14 #define SK_BLITANTIH2V2_VIRTUAL virtual |
| 15 #endif |
| 16 |
11 #include "SkBitmap.h" | 17 #include "SkBitmap.h" |
12 #include "SkBitmapProcShader.h" | 18 #include "SkBitmapProcShader.h" |
13 #include "SkMask.h" | 19 #include "SkMask.h" |
14 #include "SkMatrix.h" | 20 #include "SkMatrix.h" |
15 #include "SkPaint.h" | 21 #include "SkPaint.h" |
16 #include "SkRefCnt.h" | 22 #include "SkRefCnt.h" |
17 #include "SkRegion.h" | 23 #include "SkRegion.h" |
18 #include "SkShader.h" | 24 #include "SkShader.h" |
19 #include "SkSmallAllocator.h" | 25 #include "SkSmallAllocator.h" |
20 | 26 |
(...skipping 26 matching lines...) Expand all Loading... |
47 /// typically used for text. | 53 /// typically used for text. |
48 virtual void blitMask(const SkMask&, const SkIRect& clip); | 54 virtual void blitMask(const SkMask&, const SkIRect& clip); |
49 | 55 |
50 /** If the blitter just sets a single value for each pixel, return the | 56 /** If the blitter just sets a single value for each pixel, return the |
51 bitmap it draws into, and assign value. If not, return NULL and ignore | 57 bitmap it draws into, and assign value. If not, return NULL and ignore |
52 the value parameter. | 58 the value parameter. |
53 */ | 59 */ |
54 virtual const SkBitmap* justAnOpaqueColor(uint32_t* value); | 60 virtual const SkBitmap* justAnOpaqueColor(uint32_t* value); |
55 | 61 |
56 // (x, y), (x + 1, y) | 62 // (x, y), (x + 1, y) |
57 void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { | 63 SK_BLITANTIH2V2_VIRTUAL void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { |
58 int16_t runs[3]; | 64 int16_t runs[3]; |
59 uint8_t aa[2]; | 65 uint8_t aa[2]; |
60 | 66 |
61 runs[0] = 1; | 67 runs[0] = 1; |
62 runs[1] = 1; | 68 runs[1] = 1; |
63 runs[2] = 0; | 69 runs[2] = 0; |
64 aa[0] = SkToU8(a0); | 70 aa[0] = SkToU8(a0); |
65 aa[1] = SkToU8(a1); | 71 aa[1] = SkToU8(a1); |
66 this->blitAntiH(x, y, aa, runs); | 72 this->blitAntiH(x, y, aa, runs); |
67 } | 73 } |
68 | 74 |
69 // (x, y), (x, y + 1) | 75 // (x, y), (x, y + 1) |
70 void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { | 76 SK_BLITANTIH2V2_VIRTUAL void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { |
71 int16_t runs[2]; | 77 int16_t runs[2]; |
72 uint8_t aa[1]; | 78 uint8_t aa[1]; |
73 | 79 |
74 runs[0] = 1; | 80 runs[0] = 1; |
75 runs[1] = 0; | 81 runs[1] = 0; |
76 aa[0] = SkToU8(a0); | 82 aa[0] = SkToU8(a0); |
77 this->blitAntiH(x, y, aa, runs); | 83 this->blitAntiH(x, y, aa, runs); |
78 // reset in case the clipping blitter modified runs | 84 // reset in case the clipping blitter modified runs |
79 runs[0] = 1; | 85 runs[0] = 1; |
80 runs[1] = 0; | 86 runs[1] = 0; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, | 241 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, |
236 const SkIRect* bounds = NULL); | 242 const SkIRect* bounds = NULL); |
237 | 243 |
238 private: | 244 private: |
239 SkNullBlitter fNullBlitter; | 245 SkNullBlitter fNullBlitter; |
240 SkRectClipBlitter fRectBlitter; | 246 SkRectClipBlitter fRectBlitter; |
241 SkRgnClipBlitter fRgnBlitter; | 247 SkRgnClipBlitter fRgnBlitter; |
242 }; | 248 }; |
243 | 249 |
244 #endif | 250 #endif |
OLD | NEW |