| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "GrClipMaskManager.h" | 8 #include "GrClipMaskManager.h" |
| 9 #include "GrAAConvexPathRenderer.h" | 9 #include "GrAAConvexPathRenderer.h" |
| 10 #include "GrAAHairLinePathRenderer.h" | 10 #include "GrAAHairLinePathRenderer.h" |
| 11 #include "GrAARectRenderer.h" | |
| 12 #include "GrCaps.h" | 11 #include "GrCaps.h" |
| 12 #include "GrDrawContext.h" |
| 13 #include "GrDrawTarget.h" |
| 13 #include "GrPaint.h" | 14 #include "GrPaint.h" |
| 14 #include "GrPathRenderer.h" | 15 #include "GrPathRenderer.h" |
| 15 #include "GrRenderTarget.h" | 16 #include "GrRenderTarget.h" |
| 16 #include "GrRenderTargetPriv.h" | 17 #include "GrRenderTargetPriv.h" |
| 17 #include "GrStencilAttachment.h" | 18 #include "GrStencilAttachment.h" |
| 18 #include "GrSWMaskHelper.h" | 19 #include "GrSWMaskHelper.h" |
| 19 #include "SkRasterClip.h" | 20 #include "SkRasterClip.h" |
| 20 #include "SkTLazy.h" | 21 #include "SkTLazy.h" |
| 21 #include "effects/GrConvexPolyEffect.h" | 22 #include "effects/GrConvexPolyEffect.h" |
| 22 #include "effects/GrPorterDuffXferProcessor.h" | 23 #include "effects/GrPorterDuffXferProcessor.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 switch (element->getType()) { | 388 switch (element->getType()) { |
| 388 case Element::kEmpty_Type: | 389 case Element::kEmpty_Type: |
| 389 SkDEBUGFAIL("Should never get here with an empty element."); | 390 SkDEBUGFAIL("Should never get here with an empty element."); |
| 390 break; | 391 break; |
| 391 case Element::kRect_Type: | 392 case Element::kRect_Type: |
| 392 // TODO: Do rects directly to the accumulator using a aa-rect GrProc
essor that covers | 393 // TODO: Do rects directly to the accumulator using a aa-rect GrProc
essor that covers |
| 393 // the entire mask bounds and writes 0 outside the rect. | 394 // the entire mask bounds and writes 0 outside the rect. |
| 394 if (element->isAA()) { | 395 if (element->isAA()) { |
| 395 SkRect devRect = element->getRect(); | 396 SkRect devRect = element->getRect(); |
| 396 viewMatrix.mapRect(&devRect); | 397 viewMatrix.mapRect(&devRect); |
| 397 this->getContext()->getAARectRenderer()->fillAARect(fClipTarget, | 398 |
| 398 pipelineBuil
der, | 399 fClipTarget->drawAARect(pipelineBuilder, color, viewMatrix, |
| 399 color, | 400 element->getRect(), devRect); |
| 400 viewMatrix, | |
| 401 element->get
Rect(), | |
| 402 devRect); | |
| 403 } else { | 401 } else { |
| 404 fClipTarget->drawSimpleRect(pipelineBuilder, color, viewMatrix,
element->getRect()); | 402 fClipTarget->drawSimpleRect(pipelineBuilder, color, viewMatrix, |
| 403 element->getRect()); |
| 405 } | 404 } |
| 406 return true; | 405 return true; |
| 407 default: { | 406 default: { |
| 408 SkPath path; | 407 SkPath path; |
| 409 element->asPath(&path); | 408 element->asPath(&path); |
| 410 path.setIsVolatile(true); | 409 path.setIsVolatile(true); |
| 411 if (path.isInverseFillType()) { | 410 if (path.isInverseFillType()) { |
| 412 path.toggleInverseFillType(); | 411 path.toggleInverseFillType(); |
| 413 } | 412 } |
| 414 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); | 413 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); |
| (...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 fAACache.setContext(clipTarget->getContext()); | 1114 fAACache.setContext(clipTarget->getContext()); |
| 1116 } | 1115 } |
| 1117 | 1116 |
| 1118 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, | 1117 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, |
| 1119 GrStencilSettings* settings) { | 1118 GrStencilSettings* settings) { |
| 1120 if (stencilAttachment) { | 1119 if (stencilAttachment) { |
| 1121 int stencilBits = stencilAttachment->bits(); | 1120 int stencilBits = stencilAttachment->bits(); |
| 1122 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1121 this->adjustStencilParams(settings, fClipMode, stencilBits); |
| 1123 } | 1122 } |
| 1124 } | 1123 } |
| OLD | NEW |