| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkBlitter_DEFINED | 10 #ifndef SkBlitter_DEFINED |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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); |
| 32 /// Blit a horizontal run of antialiased pixels; runs[] is a *sparse* | 32 /// Blit a horizontal run of antialiased pixels; runs[] is a *sparse* |
| 33 /// zero-terminated run-length encoding of spans of constant alpha values. | 33 /// zero-terminated run-length encoding of spans of constant alpha values. |
| 34 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], | 34 virtual void blitAntiH(int x, int y, const SkAlpha antialias[], |
| 35 const int16_t runs[]); | 35 const int16_t runs[]); |
| 36 |
| 36 /// Blit a vertical run of pixels with a constant alpha value. | 37 /// Blit a vertical run of pixels with a constant alpha value. |
| 37 virtual void blitV(int x, int y, int height, SkAlpha alpha); | 38 virtual void blitV(int x, int y, int height, SkAlpha alpha); |
| 38 /// Blit a solid rectangle one or more pixels wide. | 39 /// Blit a solid rectangle one or more pixels wide. |
| 39 virtual void blitRect(int x, int y, int width, int height); | 40 virtual void blitRect(int x, int y, int width, int height); |
| 40 /** Blit a rectangle with one alpha-blended column on the left, | 41 /** Blit a rectangle with one alpha-blended column on the left, |
| 41 width (zero or more) opaque pixels, and one alpha-blended column | 42 width (zero or more) opaque pixels, and one alpha-blended column |
| 42 on the right. | 43 on the right. |
| 43 The result will always be at least two pixels wide. | 44 The result will always be at least two pixels wide. |
| 44 */ | 45 */ |
| 45 virtual void blitAntiRect(int x, int y, int width, int height, | 46 virtual void blitAntiRect(int x, int y, int width, int height, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 60 * returns false. | 61 * returns false. |
| 61 */ | 62 */ |
| 62 virtual bool isNullBlitter() const; | 63 virtual bool isNullBlitter() const; |
| 63 | 64 |
| 64 /** | 65 /** |
| 65 * 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. |
| 66 */ | 67 */ |
| 67 virtual bool resetShaderContext(const SkShader::ContextRec&); | 68 virtual bool resetShaderContext(const SkShader::ContextRec&); |
| 68 virtual SkShader::Context* getShaderContext() const; | 69 virtual SkShader::Context* getShaderContext() const; |
| 69 | 70 |
| 71 /** |
| 72 * Special methods for blitters that can blit more than one row at a time. |
| 73 * This function returns the number of rows that this blitter could optimall
y |
| 74 * process at a time. It is still required to support blitting one scanline |
| 75 * at a time. |
| 76 */ |
| 77 virtual int requestRowsPreserved() const { return 1; } |
| 78 |
| 70 ///@name non-virtual helpers | 79 ///@name non-virtual helpers |
| 71 void blitMaskRegion(const SkMask& mask, const SkRegion& clip); | 80 void blitMaskRegion(const SkMask& mask, const SkRegion& clip); |
| 72 void blitRectRegion(const SkIRect& rect, const SkRegion& clip); | 81 void blitRectRegion(const SkIRect& rect, const SkRegion& clip); |
| 73 void blitRegion(const SkRegion& clip); | 82 void blitRegion(const SkRegion& clip); |
| 74 ///@} | 83 ///@} |
| 75 | 84 |
| 76 /** @name Factories | 85 /** @name Factories |
| 77 Return the correct blitter to use given the specified context. | 86 Return the correct blitter to use given the specified context. |
| 78 */ | 87 */ |
| 79 static SkBlitter* Choose(const SkBitmap& device, | 88 static SkBlitter* Choose(const SkBitmap& device, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, | 178 SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, |
| 170 const SkIRect* bounds = NULL); | 179 const SkIRect* bounds = NULL); |
| 171 | 180 |
| 172 private: | 181 private: |
| 173 SkNullBlitter fNullBlitter; | 182 SkNullBlitter fNullBlitter; |
| 174 SkRectClipBlitter fRectBlitter; | 183 SkRectClipBlitter fRectBlitter; |
| 175 SkRgnClipBlitter fRgnBlitter; | 184 SkRgnClipBlitter fRgnBlitter; |
| 176 }; | 185 }; |
| 177 | 186 |
| 178 #endif | 187 #endif |
| OLD | NEW |