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

Unified Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 816513003: Stop creating GrODS for stencilPath commands. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years 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/GrInOrderDrawBuffer.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrInOrderDrawBuffer.cpp
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 83e0926b6d4b3b9dde31c3320bd56a541ca6dc8c..dc074b7b511e5ebf95fe7a1c13df9f1b9cd4132b 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -222,7 +222,7 @@ int GrInOrderDrawBuffer::concatInstancedDraw(const GrDrawState& ds, const DrawIn
void GrInOrderDrawBuffer::onDraw(const GrDrawState& ds,
const GrGeometryProcessor* gp,
const DrawInfo& info,
- const ScissorState& scissorState,
+ const GrScissorState& scissorState,
const GrDeviceCoordTexture* dstCopy) {
SkASSERT(info.vertexBuffer() && (!info.isIndexed() || info.indexBuffer()));
@@ -250,22 +250,21 @@ void GrInOrderDrawBuffer::onDraw(const GrDrawState& ds,
void GrInOrderDrawBuffer::onStencilPath(const GrDrawState& ds,
const GrPathProcessor* pathProc,
const GrPath* path,
- const GrClipMaskManager::ScissorState& scissorState,
+ const GrScissorState& scissorState,
const GrStencilSettings& stencilSettings) {
- // Only compare the subset of GrDrawState relevant to path stenciling?
- if (!this->recordStateAndShouldDraw(ds, NULL, pathProc, GrGpu::kStencilPath_DrawType,
- scissorState, NULL)) {
- return;
- }
- StencilPath* sp = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, StencilPath, (path));
- sp->fStencilSettings = stencilSettings;
+ StencilPath* sp = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, StencilPath,
+ (path, ds.getRenderTarget()));
+ sp->fScissor = scissorState;
+ sp->fUseHWAA = ds.isHWAntialias();
+ sp->fViewMatrix = ds.getViewMatrix();
+ sp->fStencil = stencilSettings;
this->recordTraceMarkersIfNecessary();
}
void GrInOrderDrawBuffer::onDrawPath(const GrDrawState& ds,
const GrPathProcessor* pathProc,
const GrPath* path,
- const GrClipMaskManager::ScissorState& scissorState,
+ const GrScissorState& scissorState,
const GrStencilSettings& stencilSettings,
const GrDeviceCoordTexture* dstCopy) {
// TODO: Only compare the subset of GrDrawState relevant to path covering?
@@ -286,7 +285,7 @@ void GrInOrderDrawBuffer::onDrawPaths(const GrDrawState& ds,
const float transformValues[],
PathTransformType transformType,
int count,
- const GrClipMaskManager::ScissorState& scissorState,
+ const GrScissorState& scissorState,
const GrStencilSettings& stencilSettings,
const GrDeviceCoordTexture* dstCopy) {
SkASSERT(pathRange);
@@ -435,10 +434,15 @@ void GrInOrderDrawBuffer::Draw::execute(GrInOrderDrawBuffer* buf, const GrOptDra
buf->getGpu()->draw(*optState, fInfo);
}
-void GrInOrderDrawBuffer::StencilPath::execute(GrInOrderDrawBuffer* buf,
- const GrOptDrawState* optState) {
- SkASSERT(optState);
- buf->getGpu()->stencilPath(*optState, this->path(), fStencilSettings);
+void GrInOrderDrawBuffer::StencilPath::execute(GrInOrderDrawBuffer* buf, const GrOptDrawState*) {
+ GrGpu::StencilPathState state;
+ state.fRenderTarget = fRenderTarget.get();
+ state.fScissor = &fScissor;
+ state.fStencil = &fStencil;
+ state.fUseHWAA = fUseHWAA;
+ state.fViewMatrix = &fViewMatrix;
+
joshualitt 2014/12/17 21:22:37 Is there any reason StencilPathCmd doesn't just ho
+ buf->getGpu()->stencilPath(this->path(), state);
}
void GrInOrderDrawBuffer::DrawPath::execute(GrInOrderDrawBuffer* buf,
@@ -493,7 +497,7 @@ bool GrInOrderDrawBuffer::recordStateAndShouldDraw(const GrDrawState& ds,
const GrGeometryProcessor* gp,
const GrPathProcessor* pathProc,
GrGpu::DrawType drawType,
- const GrClipMaskManager::ScissorState& scissor,
+ const GrScissorState& scissor,
const GrDeviceCoordTexture* dstCopy) {
SetState* ss = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, SetState,
(ds, gp, pathProc, *this->getGpu()->caps(), scissor,
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698