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

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

Issue 1969693003: Revert of 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 GrUserStencilSettings kCoverPass( 613 static constexpr GrStencilSettings kStencilPass(
614 GrUserStencilSettings::StaticInit< 614 kZero_StencilOp,
615 0x0000, 615 kKeep_StencilOp,
616 GrUserStencilTest::kNotEqual, // Stencil pass accounts for clip. 616 kNotEqual_StencilFunc,
617 0xffff, 617 0xffff,
618 GrUserStencilOp::kZero, 618 0x0000,
619 GrUserStencilOp::kKeep, 619 0xffff);
620 0xffff>()
621 );
622 620
623 pipelineBuilder->setUserStencil(&kCoverPass); 621 *pipelineBuilder->stencil() = kStencilPass;
624 622
625 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx)); 623 SkAutoTUnref<GrPathRange> glyphs(this->createGlyphs(ctx));
626 if (fLastDrawnGlyphsID != glyphs->getUniqueID()) { 624 if (fLastDrawnGlyphsID != glyphs->getUniqueID()) {
627 // Either this is the first draw or the glyphs object was purged sin ce last draw. 625 // Either this is the first draw or the glyphs object was purged sin ce last draw.
628 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c ount()); 626 glyphs->loadPathsIfNeeded(fInstanceData->indices(), fInstanceData->c ount());
629 fLastDrawnGlyphsID = glyphs->getUniqueID(); 627 fLastDrawnGlyphsID = glyphs->getUniqueID();
630 } 628 }
631 629
632 // Don't compute a bounding box. For dst copy texture, we'll opt instead for it to just copy 630 // Don't compute a bounding box. For dst copy texture, we'll opt instead for it to just copy
633 // the entire dst. Realistically this is a moot point, because any conte xt that supports 631 // 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
730 } 728 }
731 729
732 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) { 730 const SkTextBlob* GrStencilAndCoverTextContext::FallbackBlobBuilder::buildIfNeed ed(int *count) {
733 *count = fCount; 731 *count = fCount;
734 if (fCount) { 732 if (fCount) {
735 this->flush(); 733 this->flush();
736 return fBuilder->build(); 734 return fBuilder->build();
737 } 735 }
738 return nullptr; 736 return nullptr;
739 } 737 }
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