| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
| 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 #include "GrClip.h" | 8 #include "GrClip.h" |
| 9 | 9 |
| 10 #include "GrClipMaskManager.h" | 10 #include "GrClipMaskManager.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 if (fScissorState.enabled()) { | 45 if (fScissorState.enabled()) { |
| 46 const GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); | 46 const GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
| 47 SkIRect tightScissor; | 47 SkIRect tightScissor; |
| 48 if (!tightScissor.intersect(fScissorState.rect(), | 48 if (!tightScissor.intersect(fScissorState.rect(), |
| 49 SkIRect::MakeWH(rt->width(), rt->height())))
{ | 49 SkIRect::MakeWH(rt->width(), rt->height())))
{ |
| 50 return false; | 50 return false; |
| 51 } | 51 } |
| 52 if (devBounds && !devBounds->intersects(SkRect::Make(tightScissor))) { | 52 if (devBounds && !devBounds->intersects(SkRect::Make(tightScissor))) { |
| 53 return false; | 53 return false; |
| 54 } | 54 } |
| 55 out->fScissorState.set(tightScissor); | 55 out->makeScissoredStencil(fHasStencilClip, tightScissor); |
| 56 return true; |
| 56 } | 57 } |
| 57 out->fHasStencilClip = fHasStencilClip; | 58 |
| 59 out->makeStencil(fHasStencilClip); |
| 58 return true; | 60 return true; |
| 59 } | 61 } |
| 60 | 62 |
| 61 bool GrClipStackClip::quickContains(const SkRect& rect) const { | 63 bool GrClipStackClip::quickContains(const SkRect& rect) const { |
| 62 if (!fStack) { | 64 if (!fStack) { |
| 63 return true; | 65 return true; |
| 64 } | 66 } |
| 65 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()), | 67 return fStack->quickContains(rect.makeOffset(SkIntToScalar(fOrigin.x()), |
| 66 SkIntToScalar(fOrigin.y()))); | 68 SkIntToScalar(fOrigin.y()))); |
| 67 } | 69 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 80 isIntersectionOfRects); | 82 isIntersectionOfRects); |
| 81 devBounds.roundOut(devResult); | 83 devBounds.roundOut(devResult); |
| 82 } | 84 } |
| 83 | 85 |
| 84 bool GrClipStackClip::apply(GrClipMaskManager* clipMaskManager, | 86 bool GrClipStackClip::apply(GrClipMaskManager* clipMaskManager, |
| 85 const GrPipelineBuilder& pipelineBuilder, const SkRe
ct* devBounds, | 87 const GrPipelineBuilder& pipelineBuilder, const SkRe
ct* devBounds, |
| 86 GrAppliedClip* out) const { | 88 GrAppliedClip* out) const { |
| 87 // TODO: Collapse ClipMaskManager into this class.(?) | 89 // TODO: Collapse ClipMaskManager into this class.(?) |
| 88 return clipMaskManager->setupClipping(pipelineBuilder, *this, devBounds, out
); | 90 return clipMaskManager->setupClipping(pipelineBuilder, *this, devBounds, out
); |
| 89 } | 91 } |
| OLD | NEW |