OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
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 #include "GrClipMaskManager.h" | 9 #include "GrClipMaskManager.h" |
10 #include "GrAAConvexPathRenderer.h" | 10 #include "GrAAConvexPathRenderer.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 return false; | 107 return false; |
108 } | 108 } |
109 | 109 |
110 bool GrClipMaskManager::installClipEffects(const ElementList& elements, | 110 bool GrClipMaskManager::installClipEffects(const ElementList& elements, |
111 GrDrawState::AutoRestoreEffects* are, | 111 GrDrawState::AutoRestoreEffects* are, |
112 const SkVector& clipToRTOffset, | 112 const SkVector& clipToRTOffset, |
113 const SkRect* drawBounds) { | 113 const SkRect* drawBounds) { |
114 | 114 |
115 GrDrawState* drawState = fGpu->drawState(); | 115 GrDrawState* drawState = fGpu->drawState(); |
116 SkRect boundsInClipSpace; | 116 SkRect boundsInClipSpace; |
117 if (NULL != drawBounds) { | 117 if (drawBounds) { |
118 boundsInClipSpace = *drawBounds; | 118 boundsInClipSpace = *drawBounds; |
119 boundsInClipSpace.offset(-clipToRTOffset.fX, -clipToRTOffset.fY); | 119 boundsInClipSpace.offset(-clipToRTOffset.fX, -clipToRTOffset.fY); |
120 } | 120 } |
121 | 121 |
122 are->set(drawState); | 122 are->set(drawState); |
123 GrRenderTarget* rt = drawState->getRenderTarget(); | 123 GrRenderTarget* rt = drawState->getRenderTarget(); |
124 ElementList::Iter iter(elements); | 124 ElementList::Iter iter(elements); |
125 | 125 |
126 bool setARE = false; | 126 bool setARE = false; |
127 bool failed = false; | 127 bool failed = false; |
128 | 128 |
129 while (NULL != iter.get()) { | 129 while (iter.get()) { |
130 SkRegion::Op op = iter.get()->getOp(); | 130 SkRegion::Op op = iter.get()->getOp(); |
131 bool invert; | 131 bool invert; |
132 bool skip = false; | 132 bool skip = false; |
133 switch (op) { | 133 switch (op) { |
134 case SkRegion::kReplace_Op: | 134 case SkRegion::kReplace_Op: |
135 SkASSERT(iter.get() == elements.head()); | 135 SkASSERT(iter.get() == elements.head()); |
136 // Fallthrough, handled same as intersect. | 136 // Fallthrough, handled same as intersect. |
137 case SkRegion::kIntersect_Op: | 137 case SkRegion::kIntersect_Op: |
138 invert = false; | 138 invert = false; |
139 if (NULL != drawBounds && iter.get()->contains(boundsInClipSpace
)) { | 139 if (drawBounds && iter.get()->contains(boundsInClipSpace)) { |
140 skip = true; | 140 skip = true; |
141 } | 141 } |
142 break; | 142 break; |
143 case SkRegion::kDifference_Op: | 143 case SkRegion::kDifference_Op: |
144 invert = true; | 144 invert = true; |
145 // We don't currently have a cheap test for whether a rect is fu
lly outside an | 145 // We don't currently have a cheap test for whether a rect is fu
lly outside an |
146 // element's primitive, so don't attempt to set skip. | 146 // element's primitive, so don't attempt to set skip. |
147 break; | 147 break; |
148 default: | 148 default: |
149 failed = true; | 149 failed = true; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 ElementList elements(16); | 218 ElementList elements(16); |
219 int32_t genID; | 219 int32_t genID; |
220 InitialState initialState; | 220 InitialState initialState; |
221 SkIRect clipSpaceIBounds; | 221 SkIRect clipSpaceIBounds; |
222 bool requiresAA; | 222 bool requiresAA; |
223 | 223 |
224 GrDrawState* drawState = fGpu->drawState(); | 224 GrDrawState* drawState = fGpu->drawState(); |
225 | 225 |
226 const GrRenderTarget* rt = drawState->getRenderTarget(); | 226 const GrRenderTarget* rt = drawState->getRenderTarget(); |
227 // GrDrawTarget should have filtered this for us | 227 // GrDrawTarget should have filtered this for us |
228 SkASSERT(NULL != rt); | 228 SkASSERT(rt); |
229 | 229 |
230 bool ignoreClip = !drawState->isClipState() || clipDataIn->fClipStack->isWid
eOpen(); | 230 bool ignoreClip = !drawState->isClipState() || clipDataIn->fClipStack->isWid
eOpen(); |
231 | 231 |
232 if (!ignoreClip) { | 232 if (!ignoreClip) { |
233 SkIRect clipSpaceRTIBounds = SkIRect::MakeWH(rt->width(), rt->height()); | 233 SkIRect clipSpaceRTIBounds = SkIRect::MakeWH(rt->width(), rt->height()); |
234 clipSpaceRTIBounds.offset(clipDataIn->fOrigin); | 234 clipSpaceRTIBounds.offset(clipDataIn->fOrigin); |
235 ReduceClipStack(*clipDataIn->fClipStack, | 235 ReduceClipStack(*clipDataIn->fClipStack, |
236 clipSpaceRTIBounds, | 236 clipSpaceRTIBounds, |
237 &elements, | 237 &elements, |
238 &genID, | 238 &genID, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 initialState, | 292 initialState, |
293 elements, | 293 elements, |
294 clipSpaceIBounds); | 294 clipSpaceIBounds); |
295 } else { | 295 } else { |
296 result = this->createAlphaClipMask(genID, | 296 result = this->createAlphaClipMask(genID, |
297 initialState, | 297 initialState, |
298 elements, | 298 elements, |
299 clipSpaceIBounds); | 299 clipSpaceIBounds); |
300 } | 300 } |
301 | 301 |
302 if (NULL != result) { | 302 if (result) { |
303 // The mask's top left coord should be pinned to the rounded-out top
left corner of | 303 // The mask's top left coord should be pinned to the rounded-out top
left corner of |
304 // clipSpace bounds. We determine the mask's position WRT to the ren
der target here. | 304 // clipSpace bounds. We determine the mask's position WRT to the ren
der target here. |
305 SkIRect rtSpaceMaskBounds = clipSpaceIBounds; | 305 SkIRect rtSpaceMaskBounds = clipSpaceIBounds; |
306 rtSpaceMaskBounds.offset(-clipDataIn->fOrigin); | 306 rtSpaceMaskBounds.offset(-clipDataIn->fOrigin); |
307 are->set(fGpu->drawState()); | 307 are->set(fGpu->drawState()); |
308 setup_drawstate_aaclip(fGpu, result, rtSpaceMaskBounds); | 308 setup_drawstate_aaclip(fGpu, result, rtSpaceMaskBounds); |
309 fGpu->disableScissor(); | 309 fGpu->disableScissor(); |
310 this->setGpuStencil(); | 310 this->setGpuStencil(); |
311 return true; | 311 return true; |
312 } | 312 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 SkPath path; | 446 SkPath path; |
447 element->asPath(&path); | 447 element->asPath(&path); |
448 if (path.isInverseFillType()) { | 448 if (path.isInverseFillType()) { |
449 path.toggleInverseFillType(); | 449 path.toggleInverseFillType(); |
450 } | 450 } |
451 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 451 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
452 GrPathRendererChain::DrawType type = element->isAA() ? | 452 GrPathRendererChain::DrawType type = element->isAA() ? |
453 GrPathRendererChain::kStencilAndColorAntiAlias_DrawType : | 453 GrPathRendererChain::kStencilAndColorAntiAlias_DrawType : |
454 GrPathRendererChain::kStencilAndColor_DrawType; | 454 GrPathRendererChain::kStencilAndColor_DrawType; |
455 *pr = this->getContext()->getPathRenderer(path, stroke, fGpu, false, typ
e); | 455 *pr = this->getContext()->getPathRenderer(path, stroke, fGpu, false, typ
e); |
456 return NULL != *pr; | 456 return SkToBool(*pr); |
457 } | 457 } |
458 } | 458 } |
459 | 459 |
460 void GrClipMaskManager::mergeMask(GrTexture* dstMask, | 460 void GrClipMaskManager::mergeMask(GrTexture* dstMask, |
461 GrTexture* srcMask, | 461 GrTexture* srcMask, |
462 SkRegion::Op op, | 462 SkRegion::Op op, |
463 const SkIRect& dstBound, | 463 const SkIRect& dstBound, |
464 const SkIRect& srcBound) { | 464 const SkIRect& srcBound) { |
465 GrDrawState::AutoViewMatrixRestore avmr; | 465 GrDrawState::AutoViewMatrixRestore avmr; |
466 GrDrawState* drawState = fGpu->drawState(); | 466 GrDrawState* drawState = fGpu->drawState(); |
(...skipping 12 matching lines...) Expand all Loading... |
479 sampleM, | 479 sampleM, |
480 GrTextureDomain::MakeTexelDomain(srcMask,
srcBound), | 480 GrTextureDomain::MakeTexelDomain(srcMask,
srcBound), |
481 GrTextureDomain::kDecal_Mode, | 481 GrTextureDomain::kDecal_Mode, |
482 GrTextureParams::kNone_FilterMode))->unref
(); | 482 GrTextureParams::kNone_FilterMode))->unref
(); |
483 fGpu->drawSimpleRect(SkRect::Make(dstBound)); | 483 fGpu->drawSimpleRect(SkRect::Make(dstBound)); |
484 } | 484 } |
485 | 485 |
486 // get a texture to act as a temporary buffer for AA clip boolean operations | 486 // get a texture to act as a temporary buffer for AA clip boolean operations |
487 // TODO: given the expense of createTexture we may want to just cache this too | 487 // TODO: given the expense of createTexture we may want to just cache this too |
488 void GrClipMaskManager::getTemp(int width, int height, GrAutoScratchTexture* tem
p) { | 488 void GrClipMaskManager::getTemp(int width, int height, GrAutoScratchTexture* tem
p) { |
489 if (NULL != temp->texture()) { | 489 if (temp->texture()) { |
490 // we've already allocated the temp texture | 490 // we've already allocated the temp texture |
491 return; | 491 return; |
492 } | 492 } |
493 | 493 |
494 GrTextureDesc desc; | 494 GrTextureDesc desc; |
495 desc.fFlags = kRenderTarget_GrTextureFlagBit|kNoStencil_GrTextureFlagBit; | 495 desc.fFlags = kRenderTarget_GrTextureFlagBit|kNoStencil_GrTextureFlagBit; |
496 desc.fWidth = width; | 496 desc.fWidth = width; |
497 desc.fHeight = height; | 497 desc.fHeight = height; |
498 desc.fConfig = kAlpha_8_GrPixelConfig; | 498 desc.fConfig = kAlpha_8_GrPixelConfig; |
499 | 499 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 //////////////////////////////////////////////////////////////////////////////// | 539 //////////////////////////////////////////////////////////////////////////////// |
540 // Create a 8-bit clip mask in alpha | 540 // Create a 8-bit clip mask in alpha |
541 GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID, | 541 GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID, |
542 InitialState initialState, | 542 InitialState initialState, |
543 const ElementList& elements, | 543 const ElementList& elements, |
544 const SkIRect& clipSpaceIBound
s) { | 544 const SkIRect& clipSpaceIBound
s) { |
545 SkASSERT(kNone_ClipMaskType == fCurrClipMaskType); | 545 SkASSERT(kNone_ClipMaskType == fCurrClipMaskType); |
546 | 546 |
547 // First, check for cached texture | 547 // First, check for cached texture |
548 GrTexture* result = this->getCachedMaskTexture(elementsGenID, clipSpaceIBoun
ds); | 548 GrTexture* result = this->getCachedMaskTexture(elementsGenID, clipSpaceIBoun
ds); |
549 if (NULL != result) { | 549 if (result) { |
550 fCurrClipMaskType = kAlpha_ClipMaskType; | 550 fCurrClipMaskType = kAlpha_ClipMaskType; |
551 return result; | 551 return result; |
552 } | 552 } |
553 | 553 |
554 // There's no texture in the cache. Let's try to allocate it then. | 554 // There's no texture in the cache. Let's try to allocate it then. |
555 result = this->allocMaskTexture(elementsGenID, clipSpaceIBounds, false); | 555 result = this->allocMaskTexture(elementsGenID, clipSpaceIBounds, false); |
556 if (NULL == result) { | 556 if (NULL == result) { |
557 fAACache.reset(); | 557 fAACache.reset(); |
558 return NULL; | 558 return NULL; |
559 } | 559 } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 const ElementList& elements, | 694 const ElementList& elements, |
695 const SkIRect& clipSpaceIBounds, | 695 const SkIRect& clipSpaceIBounds, |
696 const SkIPoint& clipSpaceToStencil
Offset) { | 696 const SkIPoint& clipSpaceToStencil
Offset) { |
697 | 697 |
698 SkASSERT(kNone_ClipMaskType == fCurrClipMaskType); | 698 SkASSERT(kNone_ClipMaskType == fCurrClipMaskType); |
699 | 699 |
700 GrDrawState* drawState = fGpu->drawState(); | 700 GrDrawState* drawState = fGpu->drawState(); |
701 SkASSERT(drawState->isClipState()); | 701 SkASSERT(drawState->isClipState()); |
702 | 702 |
703 GrRenderTarget* rt = drawState->getRenderTarget(); | 703 GrRenderTarget* rt = drawState->getRenderTarget(); |
704 SkASSERT(NULL != rt); | 704 SkASSERT(rt); |
705 | 705 |
706 // TODO: dynamically attach a SB when needed. | 706 // TODO: dynamically attach a SB when needed. |
707 GrStencilBuffer* stencilBuffer = rt->getStencilBuffer(); | 707 GrStencilBuffer* stencilBuffer = rt->getStencilBuffer(); |
708 if (NULL == stencilBuffer) { | 708 if (NULL == stencilBuffer) { |
709 return false; | 709 return false; |
710 } | 710 } |
711 | 711 |
712 if (stencilBuffer->mustRenderClip(elementsGenID, clipSpaceIBounds, clipSpace
ToStencilOffset)) { | 712 if (stencilBuffer->mustRenderClip(elementsGenID, clipSpaceIBounds, clipSpace
ToStencilOffset)) { |
713 | 713 |
714 stencilBuffer->setLastClip(elementsGenID, clipSpaceIBounds, clipSpaceToS
tencilOffset); | 714 stencilBuffer->setLastClip(elementsGenID, clipSpaceIBounds, clipSpaceToS
tencilOffset); |
(...skipping 21 matching lines...) Expand all Loading... |
736 #endif | 736 #endif |
737 | 737 |
738 int clipBit = stencilBuffer->bits(); | 738 int clipBit = stencilBuffer->bits(); |
739 SkASSERT((clipBit <= 16) && "Ganesh only handles 16b or smaller stencil
buffers"); | 739 SkASSERT((clipBit <= 16) && "Ganesh only handles 16b or smaller stencil
buffers"); |
740 clipBit = (1 << (clipBit-1)); | 740 clipBit = (1 << (clipBit-1)); |
741 | 741 |
742 fGpu->clearStencilClip(rt, stencilSpaceIBounds, kAllIn_InitialState == i
nitialState); | 742 fGpu->clearStencilClip(rt, stencilSpaceIBounds, kAllIn_InitialState == i
nitialState); |
743 | 743 |
744 // walk through each clip element and perform its set op | 744 // walk through each clip element and perform its set op |
745 // with the existing clip. | 745 // with the existing clip. |
746 for (ElementList::Iter iter(elements.headIter()); NULL != iter.get(); it
er.next()) { | 746 for (ElementList::Iter iter(elements.headIter()); iter.get(); iter.next(
)) { |
747 const Element* element = iter.get(); | 747 const Element* element = iter.get(); |
748 bool fillInverted = false; | 748 bool fillInverted = false; |
749 // enabled at bottom of loop | 749 // enabled at bottom of loop |
750 drawState->disableState(GrGpu::kModifyStencilClip_StateBit); | 750 drawState->disableState(GrGpu::kModifyStencilClip_StateBit); |
751 // if the target is MSAA then we want MSAA enabled when the clip is
soft | 751 // if the target is MSAA then we want MSAA enabled when the clip is
soft |
752 if (rt->isMultisampled()) { | 752 if (rt->isMultisampled()) { |
753 drawState->setState(GrDrawState::kHWAntialias_StateBit, element-
>isAA()); | 753 drawState->setState(GrDrawState::kHWAntialias_StateBit, element-
>isAA()); |
754 } | 754 } |
755 | 755 |
756 // This will be used to determine whether the clip shape can be rend
ered into the | 756 // This will be used to determine whether the clip shape can be rend
ered into the |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
939 return; | 939 return; |
940 } | 940 } |
941 } else { | 941 } else { |
942 settings = drawState.getStencil(); | 942 settings = drawState.getStencil(); |
943 } | 943 } |
944 | 944 |
945 // TODO: dynamically attach a stencil buffer | 945 // TODO: dynamically attach a stencil buffer |
946 int stencilBits = 0; | 946 int stencilBits = 0; |
947 GrStencilBuffer* stencilBuffer = | 947 GrStencilBuffer* stencilBuffer = |
948 drawState.getRenderTarget()->getStencilBuffer(); | 948 drawState.getRenderTarget()->getStencilBuffer(); |
949 if (NULL != stencilBuffer) { | 949 if (stencilBuffer) { |
950 stencilBits = stencilBuffer->bits(); | 950 stencilBits = stencilBuffer->bits(); |
951 } | 951 } |
952 | 952 |
953 SkASSERT(fGpu->caps()->stencilWrapOpsSupport() || !settings.usesWrapOp()); | 953 SkASSERT(fGpu->caps()->stencilWrapOpsSupport() || !settings.usesWrapOp()); |
954 SkASSERT(fGpu->caps()->twoSidedStencilSupport() || !settings.isTwoSided()); | 954 SkASSERT(fGpu->caps()->twoSidedStencilSupport() || !settings.isTwoSided()); |
955 this->adjustStencilParams(&settings, clipMode, stencilBits); | 955 this->adjustStencilParams(&settings, clipMode, stencilBits); |
956 fGpu->setStencilSettings(settings); | 956 fGpu->setStencilSettings(settings); |
957 } | 957 } |
958 | 958 |
959 void GrClipMaskManager::adjustStencilParams(GrStencilSettings* settings, | 959 void GrClipMaskManager::adjustStencilParams(GrStencilSettings* settings, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 } | 1038 } |
1039 | 1039 |
1040 //////////////////////////////////////////////////////////////////////////////// | 1040 //////////////////////////////////////////////////////////////////////////////// |
1041 GrTexture* GrClipMaskManager::createSoftwareClipMask(int32_t elementsGenID, | 1041 GrTexture* GrClipMaskManager::createSoftwareClipMask(int32_t elementsGenID, |
1042 GrReducedClip::InitialState
initialState, | 1042 GrReducedClip::InitialState
initialState, |
1043 const GrReducedClip::Elemen
tList& elements, | 1043 const GrReducedClip::Elemen
tList& elements, |
1044 const SkIRect& clipSpaceIBo
unds) { | 1044 const SkIRect& clipSpaceIBo
unds) { |
1045 SkASSERT(kNone_ClipMaskType == fCurrClipMaskType); | 1045 SkASSERT(kNone_ClipMaskType == fCurrClipMaskType); |
1046 | 1046 |
1047 GrTexture* result = this->getCachedMaskTexture(elementsGenID, clipSpaceIBoun
ds); | 1047 GrTexture* result = this->getCachedMaskTexture(elementsGenID, clipSpaceIBoun
ds); |
1048 if (NULL != result) { | 1048 if (result) { |
1049 return result; | 1049 return result; |
1050 } | 1050 } |
1051 | 1051 |
1052 // The mask texture may be larger than necessary. We round out the clip spac
e bounds and pin | 1052 // The mask texture may be larger than necessary. We round out the clip spac
e bounds and pin |
1053 // the top left corner of the resulting rect to the top left of the texture. | 1053 // the top left corner of the resulting rect to the top left of the texture. |
1054 SkIRect maskSpaceIBounds = SkIRect::MakeWH(clipSpaceIBounds.width(), clipSpa
ceIBounds.height()); | 1054 SkIRect maskSpaceIBounds = SkIRect::MakeWH(clipSpaceIBounds.width(), clipSpa
ceIBounds.height()); |
1055 | 1055 |
1056 GrSWMaskHelper helper(this->getContext()); | 1056 GrSWMaskHelper helper(this->getContext()); |
1057 | 1057 |
1058 SkMatrix matrix; | 1058 SkMatrix matrix; |
1059 matrix.setTranslate(SkIntToScalar(-clipSpaceIBounds.fLeft), | 1059 matrix.setTranslate(SkIntToScalar(-clipSpaceIBounds.fLeft), |
1060 SkIntToScalar(-clipSpaceIBounds.fTop)); | 1060 SkIntToScalar(-clipSpaceIBounds.fTop)); |
1061 helper.init(maskSpaceIBounds, &matrix, false); | 1061 helper.init(maskSpaceIBounds, &matrix, false); |
1062 | 1062 |
1063 helper.clear(kAllIn_InitialState == initialState ? 0xFF : 0x00); | 1063 helper.clear(kAllIn_InitialState == initialState ? 0xFF : 0x00); |
1064 | 1064 |
1065 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 1065 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
1066 | 1066 |
1067 for (ElementList::Iter iter(elements.headIter()) ; NULL != iter.get(); iter.
next()) { | 1067 for (ElementList::Iter iter(elements.headIter()) ; iter.get(); iter.next())
{ |
1068 | 1068 |
1069 const Element* element = iter.get(); | 1069 const Element* element = iter.get(); |
1070 SkRegion::Op op = element->getOp(); | 1070 SkRegion::Op op = element->getOp(); |
1071 | 1071 |
1072 if (SkRegion::kIntersect_Op == op || SkRegion::kReverseDifference_Op ==
op) { | 1072 if (SkRegion::kIntersect_Op == op || SkRegion::kReverseDifference_Op ==
op) { |
1073 // Intersect and reverse difference require modifying pixels outside
of the geometry | 1073 // Intersect and reverse difference require modifying pixels outside
of the geometry |
1074 // that is being "drawn". In both cases we erase all the pixels outs
ide of the geometry | 1074 // that is being "drawn". In both cases we erase all the pixels outs
ide of the geometry |
1075 // but leave the pixels inside the geometry alone. For reverse diffe
rence we invert all | 1075 // but leave the pixels inside the geometry alone. For reverse diffe
rence we invert all |
1076 // the pixels before clearing the ones outside the geometry. | 1076 // the pixels before clearing the ones outside the geometry. |
1077 if (SkRegion::kReverseDifference_Op == op) { | 1077 if (SkRegion::kReverseDifference_Op == op) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1133 GrGpu::kModifyStencilClip_StateBit)) { | 1133 GrGpu::kModifyStencilClip_StateBit)) { |
1134 clipMode = GrClipMaskManager::kModifyClip_StencilClipMode; | 1134 clipMode = GrClipMaskManager::kModifyClip_StencilClipMode; |
1135 } else { | 1135 } else { |
1136 clipMode = GrClipMaskManager::kIgnoreClip_StencilClipMode; | 1136 clipMode = GrClipMaskManager::kIgnoreClip_StencilClipMode; |
1137 } | 1137 } |
1138 | 1138 |
1139 // TODO: dynamically attach a stencil buffer | 1139 // TODO: dynamically attach a stencil buffer |
1140 int stencilBits = 0; | 1140 int stencilBits = 0; |
1141 GrStencilBuffer* stencilBuffer = | 1141 GrStencilBuffer* stencilBuffer = |
1142 drawState.getRenderTarget()->getStencilBuffer(); | 1142 drawState.getRenderTarget()->getStencilBuffer(); |
1143 if (NULL != stencilBuffer) { | 1143 if (stencilBuffer) { |
1144 stencilBits = stencilBuffer->bits(); | 1144 stencilBits = stencilBuffer->bits(); |
1145 this->adjustStencilParams(settings, clipMode, stencilBits); | 1145 this->adjustStencilParams(settings, clipMode, stencilBits); |
1146 } | 1146 } |
1147 } | 1147 } |
OLD | NEW |