epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 8 | #ifndef SkBlitter_DEFINED |
| 9 | #define SkBlitter_DEFINED |
| 10 | |
Hal Canary | 95e3c05 | 2017-01-11 12:44:43 -0500 | [diff] [blame] | 11 | #include "SkAutoMalloc.h" |
commit-bot@chromium.org | a5572e5 | 2014-03-07 03:24:41 +0000 | [diff] [blame] | 12 | #include "SkBitmapProcShader.h" |
bungeman | d3ebb48 | 2015-08-05 13:57:49 -0700 | [diff] [blame] | 13 | #include "SkColor.h" |
| 14 | #include "SkRect.h" |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 15 | #include "SkRegion.h" |
commit-bot@chromium.org | a5572e5 | 2014-03-07 03:24:41 +0000 | [diff] [blame] | 16 | #include "SkShader.h" |
bungeman | d3ebb48 | 2015-08-05 13:57:49 -0700 | [diff] [blame] | 17 | |
Herb Derby | 57bfa02 | 2017-02-09 17:25:43 -0500 | [diff] [blame] | 18 | class SkArenaAlloc; |
bungeman | d3ebb48 | 2015-08-05 13:57:49 -0700 | [diff] [blame] | 19 | class SkMatrix; |
| 20 | class SkPaint; |
| 21 | class SkPixmap; |
| 22 | struct SkMask; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 23 | |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 24 | /** SkBlitter and its subclasses are responsible for actually writing pixels |
| 25 | into memory. Besides efficiency, they handle clipping and antialiasing. |
herb | 3be72b0 | 2016-06-24 13:02:31 -0700 | [diff] [blame] | 26 | A SkBlitter subclass contains all the context needed to generate pixels |
| 27 | for the destination and how src/generated pixels map to the destination. |
| 28 | The coordinates passed to the blitX calls are in destination pixel space. |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 29 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 30 | class SkBlitter { |
| 31 | public: |
| 32 | virtual ~SkBlitter(); |
| 33 | |
tomhudson@google.com | a31ac73 | 2011-12-29 16:09:31 +0000 | [diff] [blame] | 34 | /// Blit a horizontal run of one or more pixels. |
herb | 7df9e4a | 2016-06-10 13:01:27 -0700 | [diff] [blame] | 35 | virtual void blitH(int x, int y, int width) = 0; |
| 36 | |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 37 | /// Blit a horizontal run of antialiased pixels; runs[] is a *sparse* |
| 38 | /// zero-terminated run-length encoding of spans of constant alpha values. |
herb | 3be72b0 | 2016-06-24 13:02:31 -0700 | [diff] [blame] | 39 | /// The runs[] and antialias[] work together to represent long runs of pixels with the same |
| 40 | /// alphas. The runs[] contains the number of pixels with the same alpha, and antialias[] |
| 41 | /// contain the coverage value for that number of pixels. The runs[] (and antialias[]) are |
| 42 | /// encoded in a clever way. The runs array is zero terminated, and has enough entries for |
| 43 | /// each pixel plus one, in most cases some of the entries will not contain valid data. An entry |
| 44 | /// in the runs array contains the number of pixels (np) that have the same alpha value. The |
| 45 | /// next np value is found np entries away. For example, if runs[0] = 7, then the next valid |
| 46 | /// entry will by at runs[7]. The runs array and antialias[] are coupled by index. So, if the |
| 47 | /// np entry is at runs[45] = 12 then the alpha value can be found at antialias[45] = 0x88. |
| 48 | /// This would mean to use an alpha value of 0x88 for the next 12 pixels starting at pixel 45. |
herb | 7df9e4a | 2016-06-10 13:01:27 -0700 | [diff] [blame] | 49 | virtual void blitAntiH(int x, int y, const SkAlpha antialias[], const int16_t runs[]) = 0; |
krajcevski | 2ec93fc | 2014-07-16 13:31:41 -0700 | [diff] [blame] | 50 | |
reed@google.com | a89c77b | 2011-12-01 21:47:26 +0000 | [diff] [blame] | 51 | /// Blit a vertical run of pixels with a constant alpha value. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 52 | virtual void blitV(int x, int y, int height, SkAlpha alpha); |
herb | 7df9e4a | 2016-06-10 13:01:27 -0700 | [diff] [blame] | 53 | |
tomhudson@google.com | a31ac73 | 2011-12-29 16:09:31 +0000 | [diff] [blame] | 54 | /// Blit a solid rectangle one or more pixels wide. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 55 | virtual void blitRect(int x, int y, int width, int height); |
herb | 7df9e4a | 2016-06-10 13:01:27 -0700 | [diff] [blame] | 56 | |
tomhudson@google.com | 49eac19 | 2011-12-27 13:59:20 +0000 | [diff] [blame] | 57 | /** Blit a rectangle with one alpha-blended column on the left, |
tomhudson@google.com | 4714359 | 2011-12-28 17:58:07 +0000 | [diff] [blame] | 58 | width (zero or more) opaque pixels, and one alpha-blended column |
| 59 | on the right. |
| 60 | The result will always be at least two pixels wide. |
tomhudson@google.com | 49eac19 | 2011-12-27 13:59:20 +0000 | [diff] [blame] | 61 | */ |
| 62 | virtual void blitAntiRect(int x, int y, int width, int height, |
| 63 | SkAlpha leftAlpha, SkAlpha rightAlpha); |
herb | 7df9e4a | 2016-06-10 13:01:27 -0700 | [diff] [blame] | 64 | |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 65 | /// Blit a pattern of pixels defined by a rectangle-clipped mask; |
| 66 | /// typically used for text. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 67 | virtual void blitMask(const SkMask&, const SkIRect& clip); |
| 68 | |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 69 | /** If the blitter just sets a single value for each pixel, return the |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 70 | bitmap it draws into, and assign value. If not, return nullptr and ignore |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 71 | the value parameter. |
| 72 | */ |
reed | 41e010c | 2015-06-09 12:16:53 -0700 | [diff] [blame] | 73 | virtual const SkPixmap* justAnOpaqueColor(uint32_t* value); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 74 | |
reed | 793a6dd | 2015-04-15 07:51:15 -0700 | [diff] [blame] | 75 | // (x, y), (x + 1, y) |
reed | a8ec480 | 2015-04-20 05:18:01 -0700 | [diff] [blame] | 76 | virtual void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) { |
reed | 793a6dd | 2015-04-15 07:51:15 -0700 | [diff] [blame] | 77 | int16_t runs[3]; |
| 78 | uint8_t aa[2]; |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 79 | |
reed | 793a6dd | 2015-04-15 07:51:15 -0700 | [diff] [blame] | 80 | runs[0] = 1; |
| 81 | runs[1] = 1; |
| 82 | runs[2] = 0; |
| 83 | aa[0] = SkToU8(a0); |
| 84 | aa[1] = SkToU8(a1); |
| 85 | this->blitAntiH(x, y, aa, runs); |
| 86 | } |
| 87 | |
| 88 | // (x, y), (x, y + 1) |
reed | a8ec480 | 2015-04-20 05:18:01 -0700 | [diff] [blame] | 89 | virtual void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) { |
reed | 793a6dd | 2015-04-15 07:51:15 -0700 | [diff] [blame] | 90 | int16_t runs[2]; |
| 91 | uint8_t aa[1]; |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 92 | |
reed | 793a6dd | 2015-04-15 07:51:15 -0700 | [diff] [blame] | 93 | runs[0] = 1; |
| 94 | runs[1] = 0; |
| 95 | aa[0] = SkToU8(a0); |
| 96 | this->blitAntiH(x, y, aa, runs); |
| 97 | // reset in case the clipping blitter modified runs |
| 98 | runs[0] = 1; |
| 99 | runs[1] = 0; |
| 100 | aa[0] = SkToU8(a1); |
| 101 | this->blitAntiH(x, y + 1, aa, runs); |
| 102 | } |
halcanary | 9d524f2 | 2016-03-29 09:03:52 -0700 | [diff] [blame] | 103 | |
reed@google.com | ea03360 | 2012-12-14 13:13:55 +0000 | [diff] [blame] | 104 | /** |
| 105 | * Special method just to identify the null blitter, which is returned |
| 106 | * from Choose() if the request cannot be fulfilled. Default impl |
| 107 | * returns false. |
| 108 | */ |
| 109 | virtual bool isNullBlitter() const; |
| 110 | |
commit-bot@chromium.org | 87fcd95 | 2014-04-23 19:10:51 +0000 | [diff] [blame] | 111 | /** |
krajcevski | 2ec93fc | 2014-07-16 13:31:41 -0700 | [diff] [blame] | 112 | * Special methods for blitters that can blit more than one row at a time. |
| 113 | * This function returns the number of rows that this blitter could optimally |
| 114 | * process at a time. It is still required to support blitting one scanline |
| 115 | * at a time. |
| 116 | */ |
| 117 | virtual int requestRowsPreserved() const { return 1; } |
| 118 | |
krajcevski | 75f8851 | 2014-07-21 09:54:23 -0700 | [diff] [blame] | 119 | /** |
| 120 | * This function allocates memory for the blitter that the blitter then owns. |
| 121 | * The memory can be used by the calling function at will, but it will be |
| 122 | * released when the blitter's destructor is called. This function returns |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 123 | * nullptr if no persistent memory is needed by the blitter. |
krajcevski | 75f8851 | 2014-07-21 09:54:23 -0700 | [diff] [blame] | 124 | */ |
| 125 | virtual void* allocBlitMemory(size_t sz) { |
| 126 | return fBlitMemory.reset(sz, SkAutoMalloc::kReuse_OnShrink); |
| 127 | } |
| 128 | |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 129 | ///@name non-virtual helpers |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 130 | void blitMaskRegion(const SkMask& mask, const SkRegion& clip); |
| 131 | void blitRectRegion(const SkIRect& rect, const SkRegion& clip); |
| 132 | void blitRegion(const SkRegion& clip); |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 133 | ///@} |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 134 | |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 135 | /** @name Factories |
| 136 | Return the correct blitter to use given the specified context. |
| 137 | */ |
reed | 41e010c | 2015-06-09 12:16:53 -0700 | [diff] [blame] | 138 | static SkBlitter* Choose(const SkPixmap& dst, |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 139 | const SkMatrix& matrix, |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 140 | const SkPaint& paint, |
Herb Derby | 83e939b | 2017-02-07 14:25:11 -0500 | [diff] [blame] | 141 | SkArenaAlloc*, |
reed@google.com | 126f7f5 | 2013-11-07 16:06:53 +0000 | [diff] [blame] | 142 | bool drawCoverage = false); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 143 | |
reed | cb67414 | 2015-06-05 06:58:22 -0700 | [diff] [blame] | 144 | static SkBlitter* ChooseSprite(const SkPixmap& dst, |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 145 | const SkPaint&, |
reed | c240e71 | 2015-05-23 12:26:41 -0700 | [diff] [blame] | 146 | const SkPixmap& src, |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 147 | int left, int top, |
Herb Derby | 57bfa02 | 2017-02-09 17:25:43 -0500 | [diff] [blame] | 148 | SkArenaAlloc*); |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 149 | ///@} |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 150 | |
fmalita | d0c4e09 | 2016-02-22 17:19:04 -0800 | [diff] [blame] | 151 | static SkShader::ContextRec::DstType PreferredShaderDest(const SkImageInfo&); |
| 152 | |
krajcevski | 75f8851 | 2014-07-21 09:54:23 -0700 | [diff] [blame] | 153 | protected: |
krajcevski | 75f8851 | 2014-07-21 09:54:23 -0700 | [diff] [blame] | 154 | SkAutoMalloc fBlitMemory; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | /** This blitter silently never draws anything. |
| 158 | */ |
| 159 | class SkNullBlitter : public SkBlitter { |
| 160 | public: |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 161 | void blitH(int x, int y, int width) override; |
reed | 3dfd133 | 2015-06-25 14:26:11 -0700 | [diff] [blame] | 162 | void blitAntiH(int x, int y, const SkAlpha[], const int16_t runs[]) override; |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 163 | void blitV(int x, int y, int height, SkAlpha alpha) override; |
| 164 | void blitRect(int x, int y, int width, int height) override; |
| 165 | void blitMask(const SkMask&, const SkIRect& clip) override; |
reed | 41e010c | 2015-06-09 12:16:53 -0700 | [diff] [blame] | 166 | const SkPixmap* justAnOpaqueColor(uint32_t* value) override; |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 167 | bool isNullBlitter() const override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 168 | }; |
| 169 | |
| 170 | /** Wraps another (real) blitter, and ensures that the real blitter is only |
| 171 | called with coordinates that have been clipped by the specified clipRect. |
| 172 | This means the caller need not perform the clipping ahead of time. |
| 173 | */ |
| 174 | class SkRectClipBlitter : public SkBlitter { |
| 175 | public: |
| 176 | void init(SkBlitter* blitter, const SkIRect& clipRect) { |
| 177 | SkASSERT(!clipRect.isEmpty()); |
| 178 | fBlitter = blitter; |
| 179 | fClipRect = clipRect; |
| 180 | } |
| 181 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 182 | void blitH(int x, int y, int width) override; |
reed | 3dfd133 | 2015-06-25 14:26:11 -0700 | [diff] [blame] | 183 | void blitAntiH(int x, int y, const SkAlpha[], const int16_t runs[]) override; |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 184 | void blitV(int x, int y, int height, SkAlpha alpha) override; |
| 185 | void blitRect(int x, int y, int width, int height) override; |
tomhudson@google.com | 49eac19 | 2011-12-27 13:59:20 +0000 | [diff] [blame] | 186 | virtual void blitAntiRect(int x, int y, int width, int height, |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 187 | SkAlpha leftAlpha, SkAlpha rightAlpha) override; |
| 188 | void blitMask(const SkMask&, const SkIRect& clip) override; |
reed | 41e010c | 2015-06-09 12:16:53 -0700 | [diff] [blame] | 189 | const SkPixmap* justAnOpaqueColor(uint32_t* value) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 190 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 191 | int requestRowsPreserved() const override { |
krajcevski | fdd7d2b | 2014-07-29 07:21:41 -0700 | [diff] [blame] | 192 | return fBlitter->requestRowsPreserved(); |
| 193 | } |
| 194 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 195 | void* allocBlitMemory(size_t sz) override { |
krajcevski | 75f8851 | 2014-07-21 09:54:23 -0700 | [diff] [blame] | 196 | return fBlitter->allocBlitMemory(sz); |
| 197 | } |
| 198 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 199 | private: |
| 200 | SkBlitter* fBlitter; |
| 201 | SkIRect fClipRect; |
| 202 | }; |
| 203 | |
| 204 | /** Wraps another (real) blitter, and ensures that the real blitter is only |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 205 | called with coordinates that have been clipped by the specified clipRgn. |
| 206 | This means the caller need not perform the clipping ahead of time. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 207 | */ |
| 208 | class SkRgnClipBlitter : public SkBlitter { |
| 209 | public: |
| 210 | void init(SkBlitter* blitter, const SkRegion* clipRgn) { |
| 211 | SkASSERT(clipRgn && !clipRgn->isEmpty()); |
| 212 | fBlitter = blitter; |
| 213 | fRgn = clipRgn; |
| 214 | } |
| 215 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 216 | void blitH(int x, int y, int width) override; |
reed | 3dfd133 | 2015-06-25 14:26:11 -0700 | [diff] [blame] | 217 | void blitAntiH(int x, int y, const SkAlpha[], const int16_t runs[]) override; |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 218 | void blitV(int x, int y, int height, SkAlpha alpha) override; |
| 219 | void blitRect(int x, int y, int width, int height) override; |
reed | 3dfd133 | 2015-06-25 14:26:11 -0700 | [diff] [blame] | 220 | void blitAntiRect(int x, int y, int width, int height, |
| 221 | SkAlpha leftAlpha, SkAlpha rightAlpha) override; |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 222 | void blitMask(const SkMask&, const SkIRect& clip) override; |
reed | 41e010c | 2015-06-09 12:16:53 -0700 | [diff] [blame] | 223 | const SkPixmap* justAnOpaqueColor(uint32_t* value) override; |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 224 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 225 | int requestRowsPreserved() const override { |
krajcevski | fdd7d2b | 2014-07-29 07:21:41 -0700 | [diff] [blame] | 226 | return fBlitter->requestRowsPreserved(); |
| 227 | } |
| 228 | |
mtklein | 36352bf | 2015-03-25 18:17:31 -0700 | [diff] [blame] | 229 | void* allocBlitMemory(size_t sz) override { |
krajcevski | 75f8851 | 2014-07-21 09:54:23 -0700 | [diff] [blame] | 230 | return fBlitter->allocBlitMemory(sz); |
| 231 | } |
| 232 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 233 | private: |
| 234 | SkBlitter* fBlitter; |
| 235 | const SkRegion* fRgn; |
| 236 | }; |
| 237 | |
Mike Reed | 28930b4 | 2016-11-09 15:23:26 -0500 | [diff] [blame] | 238 | #ifdef SK_DEBUG |
| 239 | class SkRectClipCheckBlitter : public SkBlitter { |
| 240 | public: |
| 241 | void init(SkBlitter* blitter, const SkIRect& clipRect) { |
| 242 | SkASSERT(blitter); |
| 243 | SkASSERT(!clipRect.isEmpty()); |
| 244 | fBlitter = blitter; |
| 245 | fClipRect = clipRect; |
| 246 | } |
| 247 | |
| 248 | void blitH(int x, int y, int width) override; |
| 249 | void blitAntiH(int x, int y, const SkAlpha[], const int16_t runs[]) override; |
| 250 | void blitV(int x, int y, int height, SkAlpha alpha) override; |
| 251 | void blitRect(int x, int y, int width, int height) override; |
| 252 | void blitAntiRect(int x, int y, int width, int height, |
| 253 | SkAlpha leftAlpha, SkAlpha rightAlpha) override; |
| 254 | void blitMask(const SkMask&, const SkIRect& clip) override; |
| 255 | const SkPixmap* justAnOpaqueColor(uint32_t* value) override; |
Yuqian Li | 99bba9e | 2016-11-21 09:44:59 -0500 | [diff] [blame] | 256 | void blitAntiH2(int x, int y, U8CPU a0, U8CPU a1) override; |
| 257 | void blitAntiV2(int x, int y, U8CPU a0, U8CPU a1) override; |
Mike Reed | 28930b4 | 2016-11-09 15:23:26 -0500 | [diff] [blame] | 258 | |
| 259 | int requestRowsPreserved() const override { |
| 260 | return fBlitter->requestRowsPreserved(); |
| 261 | } |
| 262 | |
| 263 | void* allocBlitMemory(size_t sz) override { |
| 264 | return fBlitter->allocBlitMemory(sz); |
| 265 | } |
| 266 | |
| 267 | private: |
| 268 | SkBlitter* fBlitter; |
| 269 | SkIRect fClipRect; |
| 270 | }; |
| 271 | #endif |
| 272 | |
tomhudson@google.com | 05fffdc | 2011-12-01 20:41:24 +0000 | [diff] [blame] | 273 | /** Factory to set up the appropriate most-efficient wrapper blitter |
| 274 | to apply a clip. Returns a pointer to a member, so lifetime must |
| 275 | be managed carefully. |
| 276 | */ |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 277 | class SkBlitterClipper { |
| 278 | public: |
| 279 | SkBlitter* apply(SkBlitter* blitter, const SkRegion* clip, |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 280 | const SkIRect* bounds = nullptr); |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 281 | |
| 282 | private: |
| 283 | SkNullBlitter fNullBlitter; |
| 284 | SkRectClipBlitter fRectBlitter; |
| 285 | SkRgnClipBlitter fRgnBlitter; |
| 286 | }; |
| 287 | |
| 288 | #endif |