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

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

Issue 1282893002: Make initBatchTracker private, move towards pipeline on batch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | src/gpu/GrCommandBuilder.h » ('j') | src/gpu/GrReorderCommandBuilder.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "GrBufferedDrawTarget.h" 8 #include "GrBufferedDrawTarget.h"
9 9
10 // We will use the reordering buffer, unless we have NVPR. 10 // We will use the reordering buffer, unless we have NVPR.
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 void GrBufferedDrawTarget::onDrawBatch(GrBatch* batch, 29 void GrBufferedDrawTarget::onDrawBatch(GrBatch* batch,
30 const PipelineInfo& pipelineInfo) { 30 const PipelineInfo& pipelineInfo) {
31 GrPipelineOptimizations opts; 31 GrPipelineOptimizations opts;
32 State* state = this->setupPipelineAndShouldDraw(batch, pipelineInfo, &opts); 32 State* state = this->setupPipelineAndShouldDraw(batch, pipelineInfo, &opts);
33 if (!state) { 33 if (!state) {
34 return; 34 return;
35 } 35 }
36 36
37 GrTargetCommands::Cmd* cmd = fCommands->recordDrawBatch(state, batch); 37 GrTargetCommands::Cmd* cmd = fCommands->recordDrawBatch(state, opts, batch);
38 this->recordTraceMarkersIfNecessary(cmd); 38 this->recordTraceMarkersIfNecessary(cmd);
39 } 39 }
40 40
41 void GrBufferedDrawTarget::onStencilPath(const GrPipelineBuilder& pipelineBuilde r, 41 void GrBufferedDrawTarget::onStencilPath(const GrPipelineBuilder& pipelineBuilde r,
42 const GrPathProcessor* pathProc, 42 const GrPathProcessor* pathProc,
43 const GrPath* path, 43 const GrPath* path,
44 const GrScissorState& scissorState, 44 const GrScissorState& scissorState,
45 const GrStencilSettings& stencilSetting s) { 45 const GrStencilSettings& stencilSetting s) {
46 GrTargetCommands::Cmd* cmd = fCommands->recordStencilPath(pipelineBuilder, 46 GrTargetCommands::Cmd* cmd = fCommands->recordStencilPath(pipelineBuilder,
47 pathProc, path, sc issorState, 47 pathProc, path, sc issorState,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 const GrDrawTarget::PipelineInf o& pipelineInfo, 183 const GrDrawTarget::PipelineInf o& pipelineInfo,
184 GrPipelineOptimizations* opts) { 184 GrPipelineOptimizations* opts) {
185 State* state = this->allocState(); 185 State* state = this->allocState();
186 this->setupPipeline(pipelineInfo, state->pipelineLocation(), opts); 186 this->setupPipeline(pipelineInfo, state->pipelineLocation(), opts);
187 187
188 if (state->getPipeline()->mustSkip()) { 188 if (state->getPipeline()->mustSkip()) {
189 this->unallocState(state); 189 this->unallocState(state);
190 return NULL; 190 return NULL;
191 } 191 }
192 192
193 batch->initBatchTracker(*opts);
194
195 if (fPrevState && !fPrevState->fPrimitiveProcessor.get() && 193 if (fPrevState && !fPrevState->fPrimitiveProcessor.get() &&
196 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { 194 fPrevState->getPipeline()->isEqual(*state->getPipeline())) {
197 this->unallocState(state); 195 this->unallocState(state);
198 } else { 196 } else {
199 fPrevState.reset(state); 197 fPrevState.reset(state);
200 } 198 }
201 199
202 this->recordTraceMarkersIfNecessary( 200 this->recordTraceMarkersIfNecessary(
203 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps())); 201 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(), *this->caps()));
204 return fPrevState; 202 return fPrevState;
205 } 203 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrCommandBuilder.h » ('j') | src/gpu/GrReorderCommandBuilder.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698