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

Side by Side Diff: src/gpu/GrTargetCommands.cpp

Issue 1157683006: Refactor GrGpu path rendering functions to GrPathRendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase, remove include ordering Created 5 years, 6 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/GrSWMaskHelper.cpp ('k') | src/gpu/GrTest.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 2015 Google Inc. 2 * Copyright 2015 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 "GrTargetCommands.h" 8 #include "GrTargetCommands.h"
9 9
10 #include "GrInOrderDrawBuffer.h" 10 #include "GrInOrderDrawBuffer.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 iter->execute(gpu); 48 iter->execute(gpu);
49 if (iter->isTraced()) { 49 if (iter->isTraced()) {
50 gpu->removeGpuTraceMarker(&newMarker); 50 gpu->removeGpuTraceMarker(&newMarker);
51 } 51 }
52 } 52 }
53 53
54 fBatchTarget.postFlush(); 54 fBatchTarget.postFlush();
55 } 55 }
56 56
57 void GrTargetCommands::StencilPath::execute(GrGpu* gpu) { 57 void GrTargetCommands::StencilPath::execute(GrGpu* gpu) {
58 GrGpu::StencilPathState state; 58 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewM atrix, &fScissor,
59 state.fRenderTarget = fRenderTarget.get(); 59 &fStencil);
60 state.fScissor = &fScissor; 60 gpu->pathRendering()->stencilPath(args, this->path());
61 state.fStencil = &fStencil;
62 state.fUseHWAA = fUseHWAA;
63 state.fViewMatrix = &fViewMatrix;
64
65 gpu->stencilPath(this->path(), state);
66 } 61 }
67 62
68 void GrTargetCommands::DrawPath::execute(GrGpu* gpu) { 63 void GrTargetCommands::DrawPath::execute(GrGpu* gpu) {
69 if (!fState->fCompiled) { 64 if (!fState->fCompiled) {
70 gpu->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProcessor, *fSt ate->getPipeline(), 65 gpu->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProcessor, *fSt ate->getPipeline(),
71 fState->fBatchTracker); 66 fState->fBatchTracker);
72 fState->fCompiled = true; 67 fState->fCompiled = true;
73 } 68 }
74 DrawArgs args(fState->fPrimitiveProcessor.get(), fState->getPipeline(), 69 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState ->getPipeline(),
75 &fState->fDesc, &fState->fBatchTracker); 70 &fState->fDesc, &fState->fBatchTracker, & fStencilSettings);
76 gpu->drawPath(args, this->path(), fStencilSettings); 71 gpu->pathRendering()->drawPath(args, this->path());
77 } 72 }
78 73
79 void GrTargetCommands::DrawPaths::execute(GrGpu* gpu) { 74 void GrTargetCommands::DrawPaths::execute(GrGpu* gpu) {
80 if (!fState->fCompiled) { 75 if (!fState->fCompiled) {
81 gpu->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProcessor, *fSt ate->getPipeline(), 76 gpu->buildProgramDesc(&fState->fDesc, *fState->fPrimitiveProcessor, *fSt ate->getPipeline(),
82 fState->fBatchTracker); 77 fState->fBatchTracker);
83 fState->fCompiled = true; 78 fState->fCompiled = true;
84 } 79 }
85 DrawArgs args(fState->fPrimitiveProcessor.get(), fState->getPipeline(), 80 GrPathRendering::DrawPathArgs args(fState->fPrimitiveProcessor.get(), fState ->getPipeline(),
86 &fState->fDesc, &fState->fBatchTracker); 81 &fState->fDesc, &fState->fBatchTracker, & fStencilSettings);
87 gpu->drawPaths(args, this->pathRange(), 82 gpu->pathRendering()->drawPaths(args, this->pathRange(), fIndices, fIndexTyp e, fTransforms,
88 fIndices, fIndexType, 83 fTransformType, fCount);
89 fTransforms, fTransformType,
90 fCount, fStencilSettings);
91 } 84 }
92 85
93 void GrTargetCommands::DrawBatch::execute(GrGpu*) { 86 void GrTargetCommands::DrawBatch::execute(GrGpu*) {
94 fBatchTarget->flushNext(fBatch->numberOfDraws()); 87 fBatchTarget->flushNext(fBatch->numberOfDraws());
95 } 88 }
96 89
97 void GrTargetCommands::Clear::execute(GrGpu* gpu) { 90 void GrTargetCommands::Clear::execute(GrGpu* gpu) {
98 if (GrColor_ILLEGAL == fColor) { 91 if (GrColor_ILLEGAL == fColor) {
99 gpu->discard(this->renderTarget()); 92 gpu->discard(this->renderTarget());
100 } else { 93 } else {
101 gpu->clear(&fRect, fColor, fCanIgnoreRect, this->renderTarget()); 94 gpu->clear(&fRect, fColor, fCanIgnoreRect, this->renderTarget());
102 } 95 }
103 } 96 }
104 97
105 void GrTargetCommands::ClearStencilClip::execute(GrGpu* gpu) { 98 void GrTargetCommands::ClearStencilClip::execute(GrGpu* gpu) {
106 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget()); 99 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget());
107 } 100 }
108 101
109 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) { 102 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) {
110 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint); 103 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint);
111 } 104 }
112 105
113 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) { 106 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) {
114 gpu->xferBarrier(fRenderTarget.get(), fBarrierType); 107 gpu->xferBarrier(fRenderTarget.get(), fBarrierType);
115 } 108 }
OLDNEW
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698