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

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

Issue 1933053002: Use constexpr constructors of GrStencilSettings rather than hacky macro system (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment 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') | tests/GLProgramsTest.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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLUtil.cpp ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698