| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" | 8 #include "GrStencilAndCoverTextContext.h" |
| 9 #include "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
| 10 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 SkScalar x, SkScalar y, | 578 SkScalar x, SkScalar y, |
| 579 const SkIRect& clipBounds, | 579 const SkIRect& clipBounds, |
| 580 GrAtlasTextContext* fallbackTex
tContext, | 580 GrAtlasTextContext* fallbackTex
tContext, |
| 581 const SkPaint& originalSkPaint)
const { | 581 const SkPaint& originalSkPaint)
const { |
| 582 SkASSERT(fInstanceData); | 582 SkASSERT(fInstanceData); |
| 583 SkASSERT(dc->accessRenderTarget()->isStencilBufferMultisampled() || !fFont.i
sAntiAlias()); | 583 SkASSERT(dc->accessRenderTarget()->isStencilBufferMultisampled() || !fFont.i
sAntiAlias()); |
| 584 | 584 |
| 585 if (fInstanceData->count()) { | 585 if (fInstanceData->count()) { |
| 586 pipelineBuilder->setState(GrPipelineBuilder::kHWAntialias_Flag, fFont.is
AntiAlias()); | 586 pipelineBuilder->setState(GrPipelineBuilder::kHWAntialias_Flag, fFont.is
AntiAlias()); |
| 587 | 587 |
| 588 GR_STATIC_CONST_SAME_STENCIL(kStencilPass, | 588 static constexpr GrStencilSettings kStencilPass( |
| 589 kZero_StencilOp, | 589 kZero_StencilOp, |
| 590 kKeep_StencilOp, | 590 kKeep_StencilOp, |
| 591 kNotEqual_StencilFunc, | 591 kNotEqual_StencilFunc, |
| 592 0xffff, | 592 0xffff, |
| 593 0x0000, | 593 0x0000, |
| 594 0xffff); | 594 0xffff); |
| 595 | 595 |
| 596 *pipelineBuilder->stencil() = kStencilPass; | 596 *pipelineBuilder->stencil() = kStencilPass; |
| 597 | 597 |
| 598 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx)); | 598 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx)); |
| 599 if (fLastDrawnGlyphsID != glyphs->getUniqueID()) { | 599 if (fLastDrawnGlyphsID != glyphs->getUniqueID()) { |
| 600 // Either this is the first draw or the glyphs object was purged sin
ce last draw. | 600 // Either this is the first draw or the glyphs object was purged sin
ce last draw. |
| 601 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c
ount()); | 601 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c
ount()); |
| 602 fLastDrawnGlyphsID = glyphs->getUniqueID(); | 602 fLastDrawnGlyphsID = glyphs->getUniqueID(); |
| 603 } | 603 } |
| 604 | 604 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 } | 703 } |
| 704 | 704 |
| 705 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { | 705 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed
ed(int *count) { |
| 706 *count = fCount; | 706 *count = fCount; |
| 707 if (fCount) { | 707 if (fCount) { |
| 708 this->flush(); | 708 this->flush(); |
| 709 return fBuilder->build(); | 709 return fBuilder->build(); |
| 710 } | 710 } |
| 711 return nullptr; | 711 return nullptr; |
| 712 } | 712 } |
| OLD | NEW |