robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2012 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | #ifndef GrClipMaskManager_DEFINED |
| 10 | #define GrClipMaskManager_DEFINED |
| 11 | |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 12 | #include "GrClip.h" |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 13 | #include "GrContext.h" |
bsalomon@google.com | 411dad0 | 2012-06-05 20:24:20 +0000 | [diff] [blame] | 14 | #include "GrNoncopyable.h" |
| 15 | #include "GrRect.h" |
| 16 | #include "GrStencil.h" |
| 17 | #include "GrTexture.h" |
| 18 | |
| 19 | #include "SkDeque.h" |
| 20 | #include "SkPath.h" |
| 21 | #include "SkRefCnt.h" |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 22 | |
| 23 | class GrGpu; |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 24 | class GrPathRenderer; |
| 25 | class GrPathRendererChain; |
| 26 | class SkPath; |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 27 | class GrTexture; |
| 28 | class GrDrawState; |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * Scissoring needs special handling during stencil clip mask creation |
| 32 | * since the creation process re-entrantly invokes setupClipAndFlushState. |
| 33 | * During this process the call stack is used to keep |
| 34 | * track of (and apply to the GPU) the current scissor settings. |
| 35 | */ |
| 36 | struct ScissoringSettings { |
| 37 | bool fEnableScissoring; |
| 38 | GrIRect fScissorRect; |
| 39 | |
| 40 | void setupScissoring(GrGpu* gpu); |
| 41 | }; |
| 42 | |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 43 | /** |
| 44 | * The stencil buffer stores the last clip path - providing a single entry |
| 45 | * "cache". This class provides similar functionality for AA clip paths |
| 46 | */ |
| 47 | class GrClipMaskCache : public GrNoncopyable { |
| 48 | public: |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 49 | GrClipMaskCache() |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 50 | : fContext(NULL) |
| 51 | , fStack(sizeof(GrClipStackFrame)) { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 52 | // We need an initial frame to capture the clip state prior to |
| 53 | // any pushes |
| 54 | new (fStack.push_back()) GrClipStackFrame(); |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 55 | } |
| 56 | |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 57 | ~GrClipMaskCache() { |
| 58 | |
| 59 | while (!fStack.empty()) { |
| 60 | GrClipStackFrame* temp = (GrClipStackFrame*) fStack.back(); |
| 61 | temp->~GrClipStackFrame(); |
| 62 | fStack.pop_back(); |
| 63 | } |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 64 | } |
| 65 | |
| 66 | bool canReuse(const GrClip& clip, int width, int height) { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 67 | |
| 68 | if (fStack.empty()) { |
| 69 | GrAssert(false); |
| 70 | return false; |
| 71 | } |
| 72 | |
| 73 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 74 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 75 | if (back->fLastMask.texture() && |
| 76 | back->fLastMask.texture()->width() >= width && |
| 77 | back->fLastMask.texture()->height() >= height && |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 78 | clip == back->fLastClip) { |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 79 | return true; |
| 80 | } |
| 81 | |
| 82 | return false; |
| 83 | } |
| 84 | |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 85 | void reset() { |
| 86 | if (fStack.empty()) { |
robertphillips@google.com | 87baf89 | 2012-05-23 12:02:21 +0000 | [diff] [blame] | 87 | // GrAssert(false); |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 88 | return; |
| 89 | } |
| 90 | |
| 91 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 92 | |
| 93 | back->reset(); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * After a "push" the clip state is entirely open. Currently, the |
| 98 | * entire clip stack will be re-rendered into a new clip mask. |
| 99 | * TODO: can we take advantage of the nested nature of the clips to |
| 100 | * reduce the mask creation cost? |
| 101 | */ |
| 102 | void push() { |
| 103 | new (fStack.push_back()) GrClipStackFrame(); |
| 104 | } |
| 105 | |
| 106 | void pop() { |
robertphillips@google.com | 87baf89 | 2012-05-23 12:02:21 +0000 | [diff] [blame] | 107 | //GrAssert(!fStack.empty()); |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 108 | |
| 109 | if (!fStack.empty()) { |
| 110 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 111 | |
| 112 | back->~GrClipStackFrame(); |
| 113 | fStack.pop_back(); |
| 114 | } |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 115 | } |
| 116 | |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 117 | void getLastClip(GrClip* clip) const { |
| 118 | |
| 119 | if (fStack.empty()) { |
| 120 | GrAssert(false); |
| 121 | clip->setEmpty(); |
| 122 | return; |
| 123 | } |
| 124 | |
| 125 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 126 | |
| 127 | *clip = back->fLastClip; |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | GrTexture* getLastMask() { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 131 | |
| 132 | if (fStack.empty()) { |
| 133 | GrAssert(false); |
| 134 | return NULL; |
| 135 | } |
| 136 | |
| 137 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 138 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 139 | return back->fLastMask.texture(); |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 140 | } |
| 141 | |
| 142 | const GrTexture* getLastMask() const { |
| 143 | |
| 144 | if (fStack.empty()) { |
| 145 | GrAssert(false); |
| 146 | return NULL; |
| 147 | } |
| 148 | |
| 149 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 150 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 151 | return back->fLastMask.texture(); |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 152 | } |
| 153 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 154 | void acquireMask(const GrClip& clip, |
| 155 | const GrTextureDesc& desc, |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 156 | const GrIRect& bound) { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 157 | |
| 158 | if (fStack.empty()) { |
| 159 | GrAssert(false); |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 160 | return; |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 164 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 165 | back->acquireMask(fContext, clip, desc, bound); |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 166 | } |
| 167 | |
| 168 | int getLastMaskWidth() const { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 169 | |
| 170 | if (fStack.empty()) { |
| 171 | GrAssert(false); |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 172 | return -1; |
| 173 | } |
| 174 | |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 175 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 176 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 177 | if (NULL == back->fLastMask.texture()) { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 178 | return -1; |
| 179 | } |
| 180 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 181 | return back->fLastMask.texture()->width(); |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | int getLastMaskHeight() const { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 185 | |
| 186 | if (fStack.empty()) { |
| 187 | GrAssert(false); |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 188 | return -1; |
| 189 | } |
| 190 | |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 191 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 192 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 193 | if (NULL == back->fLastMask.texture()) { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 194 | return -1; |
| 195 | } |
| 196 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 197 | return back->fLastMask.texture()->height(); |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 198 | } |
| 199 | |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 200 | void getLastBound(GrIRect* bound) const { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 201 | |
| 202 | if (fStack.empty()) { |
| 203 | GrAssert(false); |
| 204 | bound->setEmpty(); |
| 205 | return; |
| 206 | } |
| 207 | |
| 208 | GrClipStackFrame* back = (GrClipStackFrame*) fStack.back(); |
| 209 | |
| 210 | *bound = back->fLastBound; |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 211 | } |
| 212 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 213 | void setContext(GrContext* context) { |
| 214 | fContext = context; |
| 215 | } |
| 216 | |
| 217 | GrContext* getContext() { |
| 218 | return fContext; |
| 219 | } |
| 220 | |
| 221 | void releaseResources() { |
| 222 | |
| 223 | SkDeque::F2BIter iter(fStack); |
| 224 | for (GrClipStackFrame* frame = (GrClipStackFrame*) iter.next(); |
| 225 | frame != NULL; |
| 226 | frame = (GrClipStackFrame*) iter.next()) { |
| 227 | frame->reset(); |
| 228 | } |
| 229 | } |
| 230 | |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 231 | protected: |
| 232 | private: |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 233 | struct GrClipStackFrame { |
| 234 | |
| 235 | GrClipStackFrame() { |
| 236 | reset(); |
| 237 | } |
| 238 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 239 | void acquireMask(GrContext* context, |
| 240 | const GrClip& clip, |
| 241 | const GrTextureDesc& desc, |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 242 | const GrIRect& bound) { |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 243 | |
| 244 | fLastClip = clip; |
| 245 | |
| 246 | fLastMask.set(context, desc); |
| 247 | |
| 248 | fLastBound = bound; |
| 249 | } |
| 250 | |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 251 | void reset () { |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 252 | fLastClip.setEmpty(); |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 253 | |
robertphillips@google.com | 75b3c96 | 2012-06-07 12:08:45 +0000 | [diff] [blame] | 254 | GrTextureDesc desc; |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 255 | |
| 256 | fLastMask.set(NULL, desc); |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 257 | fLastBound.setEmpty(); |
| 258 | } |
| 259 | |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 260 | GrClip fLastClip; |
| 261 | // The mask's width & height values are used in setupDrawStateAAClip to |
| 262 | // correctly scale the uvs for geometry drawn with this mask |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 263 | GrAutoScratchTexture fLastMask; |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 264 | // fLastBound stores the bounding box of the clip mask in canvas |
| 265 | // space. The left and top fields are used to offset the uvs for |
| 266 | // geometry drawn with this mask (in setupDrawStateAAClip) |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 267 | GrIRect fLastBound; |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 268 | }; |
| 269 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 270 | GrContext* fContext; |
robertphillips@google.com | beeb97c | 2012-05-09 21:15:28 +0000 | [diff] [blame] | 271 | SkDeque fStack; |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 272 | |
| 273 | typedef GrNoncopyable INHERITED; |
| 274 | }; |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 275 | |
| 276 | /** |
| 277 | * The clip mask creator handles the generation of the clip mask. If anti |
| 278 | * aliasing is requested it will (in the future) generate a single channel |
| 279 | * (8bit) mask. If no anti aliasing is requested it will generate a 1-bit |
| 280 | * mask in the stencil buffer. In the non anti-aliasing case, if the clip |
| 281 | * mask can be represented as a rectangle then scissoring is used. In all |
| 282 | * cases scissoring is used to bound the range of the clip mask. |
| 283 | */ |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 284 | class GrClipMaskManager : public GrNoncopyable { |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 285 | public: |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 286 | GrClipMaskManager(GrGpu* gpu) |
| 287 | : fGpu(gpu) |
| 288 | , fClipMaskInStencil(false) |
robertphillips@google.com | 2c75681 | 2012-05-22 20:28:23 +0000 | [diff] [blame] | 289 | , fClipMaskInAlpha(false) { |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 290 | } |
| 291 | |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 292 | bool createClipMask(const GrClip& clip, |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 293 | ScissoringSettings* scissorSettings); |
| 294 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 295 | void releaseResources(); |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 296 | |
| 297 | bool isClipInStencil() const { return fClipMaskInStencil; } |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 298 | bool isClipInAlpha() const { return fClipMaskInAlpha; } |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 299 | |
| 300 | void resetMask() { |
| 301 | fClipMaskInStencil = false; |
| 302 | } |
| 303 | |
robertphillips@google.com | 49d9fd5 | 2012-05-23 11:44:08 +0000 | [diff] [blame] | 304 | void postClipPush() { |
| 305 | // TODO: make sure that, if the clip stack is unaltered, the |
| 306 | // prior clip mask is reused (i.e., a push w/ no change to the |
| 307 | // clip stack) |
| 308 | fAACache.push(); |
| 309 | } |
| 310 | |
| 311 | void preClipPop() { |
| 312 | fAACache.pop(); |
| 313 | } |
| 314 | |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 315 | void setContext(GrContext* context) { |
| 316 | fAACache.setContext(context); |
| 317 | } |
| 318 | |
robertphillips@google.com | 2c75681 | 2012-05-22 20:28:23 +0000 | [diff] [blame] | 319 | GrContext* getContext() { |
| 320 | return fAACache.getContext(); |
| 321 | } |
| 322 | |
bsalomon@google.com | 411dad0 | 2012-06-05 20:24:20 +0000 | [diff] [blame] | 323 | /** |
| 324 | * Informs the helper function adjustStencilParams() about how the stencil |
| 325 | * buffer clip is being used. |
| 326 | */ |
| 327 | enum StencilClipMode { |
| 328 | // Draw to the clip bit of the stencil buffer |
| 329 | kModifyClip_StencilClipMode, |
| 330 | // Clip against the existing representation of the clip in the high bit |
| 331 | // of the stencil buffer. |
| 332 | kRespectClip_StencilClipMode, |
| 333 | // Neither writing to nor clipping against the clip bit. |
| 334 | kIgnoreClip_StencilClipMode, |
| 335 | }; |
| 336 | |
| 337 | /** |
| 338 | * The stencil func, mask, and reference value are specified by GrGpu's |
| 339 | * caller but the actual values passed to the API may have to be adjusted |
| 340 | * due to the stencil buffer simultaneously being used for clipping. This |
| 341 | * function should be called even when clipping is disabled in order to |
| 342 | * prevent the clip from being accidentally overwritten. |
| 343 | */ |
| 344 | GrStencilFunc adjustStencilParams(GrStencilFunc, |
| 345 | StencilClipMode mode, |
| 346 | unsigned int stencilBitCnt, |
| 347 | unsigned int* ref, |
| 348 | unsigned int* mask, |
| 349 | unsigned int* writeMask); |
| 350 | |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 351 | private: |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 352 | GrGpu* fGpu; |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 353 | bool fClipMaskInStencil; // is the clip mask in the stencil buffer? |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 354 | bool fClipMaskInAlpha; // is the clip mask in an alpha texture? |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 355 | GrClipMaskCache fAACache; // cache for the AA path |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 356 | |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 357 | bool createStencilClipMask(const GrClip& clip, |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 358 | const GrRect& bounds, |
| 359 | ScissoringSettings* scissorSettings); |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 360 | bool createAlphaClipMask(const GrClip& clipIn, |
robertphillips@google.com | a72eef3 | 2012-05-01 17:22:59 +0000 | [diff] [blame] | 361 | GrTexture** result, |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 362 | GrIRect *resultBounds); |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 363 | bool createSoftwareClipMask(const GrClip& clipIn, |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 364 | GrTexture** result, |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 365 | GrIRect *resultBounds); |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 366 | bool clipMaskPreamble(const GrClip& clipIn, |
robertphillips@google.com | 6b70a7b | 2012-05-11 15:32:48 +0000 | [diff] [blame] | 367 | GrTexture** result, |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 368 | GrIRect *resultBounds); |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 369 | |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 370 | bool useSWOnlyPath(const GrClip& clipIn); |
robertphillips@google.com | fa66294 | 2012-05-17 12:20:22 +0000 | [diff] [blame] | 371 | |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 372 | bool drawClipShape(GrTexture* target, |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 373 | const GrClip& clipIn, |
| 374 | int index); |
| 375 | |
bsalomon@google.com | 13b85aa | 2012-06-15 21:09:40 +0000 | [diff] [blame^] | 376 | void drawTexture(GrTexture* target, |
robertphillips@google.com | f294b77 | 2012-04-27 14:29:26 +0000 | [diff] [blame] | 377 | GrTexture* texture); |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 378 | |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 379 | void getTemp(const GrIRect& bounds, GrAutoScratchTexture* temp); |
robertphillips@google.com | f105b10 | 2012-05-14 12:18:26 +0000 | [diff] [blame] | 380 | |
| 381 | void setupCache(const GrClip& clip, |
robertphillips@google.com | 6623fcd | 2012-05-15 16:47:23 +0000 | [diff] [blame] | 382 | const GrIRect& bounds); |
robertphillips@google.com | 6d62df4 | 2012-05-07 18:07:36 +0000 | [diff] [blame] | 383 | |
robertphillips@google.com | fd6daf5 | 2012-05-02 19:32:32 +0000 | [diff] [blame] | 384 | typedef GrNoncopyable INHERITED; |
robertphillips@google.com | 1e945b7 | 2012-04-16 18:03:03 +0000 | [diff] [blame] | 385 | }; |
| 386 | |
| 387 | #endif // GrClipMaskManager_DEFINED |