Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: src/gpu/text/GrStencilAndCoverTextContext.cpp

Issue 1962243002: Separate user and raw stencil settings (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/gl/GrGLUtil.cpp ('k') | src/gpu/vk/GrVkPipeline.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 SkScalar x, SkScalar y, 603 SkScalar x, SkScalar y,
604 const SkIRect& clipBounds, 604 const SkIRect& clipBounds,
605 GrAtlasTextContext* fallbackTex tContext, 605 GrAtlasTextContext* fallbackTex tContext,
606 const SkPaint& originalSkPaint) const { 606 const SkPaint& originalSkPaint) const {
607 SkASSERT(fInstanceData); 607 SkASSERT(fInstanceData);
608 SkASSERT(dc->accessRenderTarget()->isStencilBufferMultisampled() || !fFont.i sAntiAlias()); 608 SkASSERT(dc->accessRenderTarget()->isStencilBufferMultisampled() || !fFont.i sAntiAlias());
609 609
610 if (fInstanceData->count()) { 610 if (fInstanceData->count()) {
611 pipelineBuilder->setState(GrPipelineBuilder::kHWAntialias_Flag, fFont.is AntiAlias()); 611 pipelineBuilder->setState(GrPipelineBuilder::kHWAntialias_Flag, fFont.is AntiAlias());
612 612
613 static constexpr GrStencilSettings kStencilPass( 613 static constexpr GrUserStencilSettings kCoverPass(
614 kZero_StencilOp, 614 GrUserStencilSettings::StaticInit<
615 kKeep_StencilOp, 615 0x0000,
616 kNotEqual_StencilFunc, 616 GrUserStencilTest::kNotEqual, // Stencil pass accounts for clip.
617 0xffff, 617 0xffff,
618 0x0000, 618 GrUserStencilOp::kZero,
619 0xffff); 619 GrUserStencilOp::kKeep,
620 0xffff>()
621 );
620 622
621 *pipelineBuilder->stencil() = kStencilPass; 623 pipelineBuilder->setUserStencil(&kCoverPass);
622 624
623 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx)); 625 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx));
624 if (fLastDrawnGlyphsID != glyphs->getUniqueID()) { 626 if (fLastDrawnGlyphsID != glyphs->getUniqueID()) {
625 // Either this is the first draw or the glyphs object was purged sin ce last draw. 627 // Either this is the first draw or the glyphs object was purged sin ce last draw.
626 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c ount()); 628 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c ount());
627 fLastDrawnGlyphsID = glyphs->getUniqueID(); 629 fLastDrawnGlyphsID = glyphs->getUniqueID();
628 } 630 }
629 631
630 // Don't compute a bounding box. For dst copy texture, we'll opt instead for it to just copy 632 // Don't compute a bounding box. For dst copy texture, we'll opt instead for it to just copy
631 // the entire dst. Realistically this is a moot point, because any conte xt that supports 633 // the entire dst. Realistically this is a moot point, because any conte xt that supports
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 } 730 }
729 731
730 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) { 732 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) {
731 *count = fCount; 733 *count = fCount;
732 if (fCount) { 734 if (fCount) {
733 this->flush(); 735 this->flush();
734 return fBuilder->build(); 736 return fBuilder->build();
735 } 737 }
736 return nullptr; 738 return nullptr;
737 } 739 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLUtil.cpp ('k') | src/gpu/vk/GrVkPipeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698