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

Unified Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 1227153003: Remove setFromPaint from GrPipelineBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilAndCoverTextContext.cpp
diff --git a/src/gpu/GrStencilAndCoverTextContext.cpp b/src/gpu/GrStencilAndCoverTextContext.cpp
index b07a546b9a7c4f9dac9707e570b9373176c375b4..980a494eafd01bc2ac55c4177459fc7ce80c2fc1 100644
--- a/src/gpu/GrStencilAndCoverTextContext.cpp
+++ b/src/gpu/GrStencilAndCoverTextContext.cpp
@@ -378,24 +378,6 @@ void GrStencilAndCoverTextContext::init(GrRenderTarget* rt,
&fGlyphCache->getDescriptor(), fStroke);
}
- fStateRestore.set(&fPipelineBuilder);
-
- fPipelineBuilder.setFromPaint(fPaint, fRenderTarget, fClip);
- SkASSERT(fRenderTarget->isStencilBufferMultisampled() || !fPaint.isAntiAlias());
- fPipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, fPaint.isAntiAlias());
-
- GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
- kZero_StencilOp,
- kZero_StencilOp,
- kNotEqual_StencilFunc,
- 0xffff,
- 0x0000,
- 0xffff);
-
- *fPipelineBuilder.stencil() = kStencilPass;
-
- SkASSERT(0 == fQueuedGlyphCount);
- SkASSERT(kGlyphBufferSize == fFallbackGlyphsIdx);
}
bool GrStencilAndCoverTextContext::mapToFallbackContext(SkMatrix* inverse) {
@@ -445,7 +427,26 @@ void GrStencilAndCoverTextContext::flush() {
fViewMatrix,
fLocalMatrix));
- fDrawContext->drawPaths(&fPipelineBuilder, pp, fGlyphs,
+ // We should only be flushing about once every run. However, if this impacts performance
+ // we could move the creation of the GrPipelineBuilder earlier.
+ GrPipelineBuilder pipelineBuilder(fPaint, fRenderTarget, fClip);
+ SkASSERT(fRenderTarget->isStencilBufferMultisampled() || !fPaint.isAntiAlias());
+ pipelineBuilder.setState(GrPipelineBuilder::kHWAntialias_Flag, fPaint.isAntiAlias());
+
+ GR_STATIC_CONST_SAME_STENCIL(kStencilPass,
+ kZero_StencilOp,
+ kZero_StencilOp,
+ kNotEqual_StencilFunc,
+ 0xffff,
+ 0x0000,
+ 0xffff);
+
+ *pipelineBuilder.stencil() = kStencilPass;
+
+ SkASSERT(0 == fQueuedGlyphCount);
+ SkASSERT(kGlyphBufferSize == fFallbackGlyphsIdx);
+
+ fDrawContext->drawPaths(&pipelineBuilder, pp, fGlyphs,
fGlyphIndices, GrPathRange::kU16_PathIndexType,
get_xy_scalar_array(fGlyphPositions),
GrPathRendering::kTranslate_PathTransformType,
@@ -490,8 +491,6 @@ void GrStencilAndCoverTextContext::finish() {
SkGlyphCache::AttachCache(fGlyphCache);
fGlyphCache = NULL;
- fPipelineBuilder.stencil()->setDisabled();
- fStateRestore.set(NULL);
fViewMatrix = fContextInitialMatrix;
}
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698