| 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 10 matching lines...) Expand all Loading... |
| 21 struct SkMask; | 21 struct SkMask; |
| 22 | 22 |
| 23 /** SkBlitter and its subclasses are responsible for actually writing pixels | 23 /** SkBlitter and its subclasses are responsible for actually writing pixels |
| 24 into memory. Besides efficiency, they handle clipping and antialiasing. | 24 into memory. Besides efficiency, they handle clipping and antialiasing. |
| 25 */ | 25 */ |
| 26 class SkBlitter { | 26 class SkBlitter { |
| 27 public: | 27 public: |
| 28 virtual ~SkBlitter(); | 28 virtual ~SkBlitter(); |
| 29 | 29 |
| 30 /// Blit a horizontal run of one or more pixels. | 30 /// Blit a horizontal run of one or more pixels. |
| 31 virtual void blitH(int x, int y, int width); | 31 virtual void blitH(int x, int y, int width) = 0; |
| 32 |
| 32 /// Blit a horizontal run of antialiased pixels; runs[] is a *sparse* | 33 /// Blit a horizontal run of antialiased pixels; runs[] is a *sparse* |
| 33 /// zero-terminated run-length encoding of spans of constant alpha values. | 34 /// zero-terminated run-length encoding of spans of constant alpha values. |
| 34 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], | 35 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_
t runs[]) = 0; |
| 35 const int16_t runs[]); | |
| 36 | 36 |
| 37 /// Blit a vertical run of pixels with a constant alpha value. | 37 /// Blit a vertical run of pixels with a constant alpha value. |
| 38 virtual void blitV(int x, int y, int height, SkAlpha alpha); | 38 virtual void blitV(int x, int y, int height, SkAlpha alpha); |
| 39 |
| 39 /// Blit a solid rectangle one or more pixels wide. | 40 /// Blit a solid rectangle one or more pixels wide. |
| 40 virtual void blitRect(int x, int y, int width, int height); | 41 virtual void blitRect(int x, int y, int width, int height); |
| 42 |
| 41 /** Blit a rectangle with one alpha-blended column on the left, | 43 /** Blit a rectangle with one alpha-blended column on the left, |
| 42 width (zero or more) opaque pixels, and one alpha-blended column | 44 width (zero or more) opaque pixels, and one alpha-blended column |
| 43 on the right. | 45 on the right. |
| 44 The result will always be at least two pixels wide. | 46 The result will always be at least two pixels wide. |
| 45 */ | 47 */ |
| 46 virtual void blitAntiRect(int x, int y, int width, int height, | 48 virtual void blitAntiRect(int x, int y, int width, int height, |
| 47 SkAlpha leftAlpha, SkAlpha rightAlpha); | 49 SkAlpha leftAlpha, SkAlpha rightAlpha); |
| 50 |
| 48 /// Blit a pattern of pixels defined by a rectangle-clipped mask; | 51 /// Blit a pattern of pixels defined by a rectangle-clipped mask; |
| 49 /// typically used for text. | 52 /// typically used for text. |
| 50 virtual void blitMask(const SkMask&, const SkIRect& clip); | 53 virtual void blitMask(const SkMask&, const SkIRect& clip); |
| 51 | 54 |
| 52 /** If the blitter just sets a single value for each pixel, return the | 55 /** 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 | 56 bitmap it draws into, and assign value. If not, return nullptr and ignor
e |
| 54 the value parameter. | 57 the value parameter. |
| 55 */ | 58 */ |
| 56 virtual const SkPixmap* justAnOpaqueColor(uint32_t* value); | 59 virtual const SkPixmap* justAnOpaqueColor(uint32_t* value); |
| 57 | 60 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, | 236 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, |
| 234 const SkIRect* bounds = nullptr); | 237 const SkIRect* bounds = nullptr); |
| 235 | 238 |
| 236 private: | 239 private: |
| 237 SkNullBlitter fNullBlitter; | 240 SkNullBlitter fNullBlitter; |
| 238 SkRectClipBlitter fRectBlitter; | 241 SkRectClipBlitter fRectBlitter; |
| 239 SkRgnClipBlitter fRgnBlitter; | 242 SkRgnClipBlitter fRgnBlitter; |
| 240 }; | 243 }; |
| 241 | 244 |
| 242 #endif | 245 #endif |
| OLD | NEW |