| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 bool isHWAntiAlias, | 47 bool isHWAntiAlias, |
| 48 bool hasUserStencilSettings, | 48 bool hasUserStencilSettings, |
| 49 GrAppliedClip* out) const { | 49 GrAppliedClip* out) const { |
| 50 SkASSERT(!fDeviceBounds.isLargest()); | 50 SkASSERT(!fDeviceBounds.isLargest()); |
| 51 if (fScissorState.enabled()) { | 51 if (fScissorState.enabled()) { |
| 52 SkIRect tightScissor; | 52 SkIRect tightScissor; |
| 53 if (!tightScissor.intersect(fScissorState.rect(), | 53 if (!tightScissor.intersect(fScissorState.rect(), |
| 54 SkIRect::MakeWH(drawContext->width(), drawCo
ntext->height()))) { | 54 SkIRect::MakeWH(drawContext->width(), drawCo
ntext->height()))) { |
| 55 return false; | 55 return false; |
| 56 } | 56 } |
| 57 if (devBounds && !devBounds->intersects(SkRect::Make(tightScissor))) { | 57 if (devBounds && IsOutsideClip(tightScissor, *devBounds)) { |
| 58 return false; | 58 return false; |
| 59 } | 59 } |
| 60 if (!devBounds || !CanIgnoreScissor(fScissorState.rect(), *devBounds)) { | 60 if (!devBounds || !IsInsideClip(fScissorState.rect(), *devBounds)) { |
| 61 if (fHasStencilClip) { | 61 if (fHasStencilClip) { |
| 62 out->makeScissoredStencil(tightScissor, &fDeviceBounds); | 62 out->makeScissoredStencil(tightScissor, &fDeviceBounds); |
| 63 } else { | 63 } else { |
| 64 out->makeScissored(tightScissor); | 64 out->makeScissored(tightScissor); |
| 65 } | 65 } |
| 66 return true; | 66 return true; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 | 69 |
| 70 out->makeStencil(fHasStencilClip, fDeviceBounds); | 70 out->makeStencil(fHasStencilClip, fDeviceBounds); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 bool GrClipStackClip::apply(GrContext* context, | 97 bool GrClipStackClip::apply(GrContext* context, |
| 98 GrDrawContext* drawContext, | 98 GrDrawContext* drawContext, |
| 99 const SkRect* devBounds, | 99 const SkRect* devBounds, |
| 100 bool useHWAA, | 100 bool useHWAA, |
| 101 bool hasUserStencilSettings, | 101 bool hasUserStencilSettings, |
| 102 GrAppliedClip* out) const { | 102 GrAppliedClip* out) const { |
| 103 return GrClipMaskManager::SetupClipping(context, drawContext, *this, devBoun
ds, | 103 return GrClipMaskManager::SetupClipping(context, drawContext, *this, devBoun
ds, |
| 104 useHWAA, hasUserStencilSettings, out
); | 104 useHWAA, hasUserStencilSettings, out
); |
| 105 } | 105 } |
| OLD | NEW |