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 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 /** 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 |
53 bitmap it draws into, and assign value. If not, return nullptr and ignor
e | 53 bitmap it draws into, and assign value. If not, return nullptr and ignor
e |
54 the value parameter. | 54 the value parameter. |
55 */ | 55 */ |
56 virtual const SkPixmap* justAnOpaqueColor(uint32_t* value); | 56 virtual const SkPixmap* justAnOpaqueColor(uint32_t* value); |
57 | 57 |
58 // (x, y), (x + 1, y) | 58 // (x, y), (x + 1, y) |
59 virtual void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { | 59 virtual void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { |
60 int16_t runs[3]; | 60 int16_t runs[3]; |
61 uint8_t aa[2]; | 61 uint8_t aa[2]; |
62 | 62 |
63 runs[0] = 1; | 63 runs[0] = 1; |
64 runs[1] = 1; | 64 runs[1] = 1; |
65 runs[2] = 0; | 65 runs[2] = 0; |
66 aa[0] = SkToU8(a0); | 66 aa[0] = SkToU8(a0); |
67 aa[1] = SkToU8(a1); | 67 aa[1] = SkToU8(a1); |
68 this->blitAntiH(x, y, aa, runs); | 68 this->blitAntiH(x, y, aa, runs); |
69 } | 69 } |
70 | 70 |
71 // (x, y), (x, y + 1) | 71 // (x, y), (x, y + 1) |
72 virtual void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { | 72 virtual void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { |
73 int16_t runs[2]; | 73 int16_t runs[2]; |
74 uint8_t aa[1]; | 74 uint8_t aa[1]; |
75 | 75 |
76 runs[0] = 1; | 76 runs[0] = 1; |
77 runs[1] = 0; | 77 runs[1] = 0; |
78 aa[0] = SkToU8(a0); | 78 aa[0] = SkToU8(a0); |
79 this->blitAntiH(x, y, aa, runs); | 79 this->blitAntiH(x, y, aa, runs); |
80 // reset in case the clipping blitter modified runs | 80 // reset in case the clipping blitter modified runs |
81 runs[0] = 1; | 81 runs[0] = 1; |
82 runs[1] = 0; | 82 runs[1] = 0; |
83 aa[0] = SkToU8(a1); | 83 aa[0] = SkToU8(a1); |
84 this->blitAntiH(x, y + 1, aa, runs); | 84 this->blitAntiH(x, y + 1, aa, runs); |
85 } | 85 } |
86 | 86 |
87 /** | 87 /** |
88 * Special method just to identify the null blitter, which is returned | 88 * Special method just to identify the null blitter, which is returned |
89 * from Choose() if the request cannot be fulfilled. Default impl | 89 * from Choose() if the request cannot be fulfilled. Default impl |
90 * returns false. | 90 * returns false. |
91 */ | 91 */ |
92 virtual bool isNullBlitter() const; | 92 virtual bool isNullBlitter() const; |
93 | 93 |
94 /** | 94 /** |
95 * Special methods for SkShaderBlitter. On all other classes this is a no-o
p. | 95 * Special methods for SkShaderBlitter. On all other classes this is a no-o
p. |
96 */ | 96 */ |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, | 233 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, |
234 const SkIRect* bounds = nullptr); | 234 const SkIRect* bounds = nullptr); |
235 | 235 |
236 private: | 236 private: |
237 SkNullBlitter fNullBlitter; | 237 SkNullBlitter fNullBlitter; |
238 SkRectClipBlitter fRectBlitter; | 238 SkRectClipBlitter fRectBlitter; |
239 SkRgnClipBlitter fRgnBlitter; | 239 SkRgnClipBlitter fRgnBlitter; |
240 }; | 240 }; |
241 | 241 |
242 #endif | 242 #endif |
OLD | NEW |