| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 | 24 |
| 25 GrBufferedDrawTarget::~GrBufferedDrawTarget() { | 25 GrBufferedDrawTarget::~GrBufferedDrawTarget() { |
| 26 this->reset(); | 26 this->reset(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void GrBufferedDrawTarget::onDrawBatch(GrBatch* batch) { | 29 void GrBufferedDrawTarget::onDrawBatch(GrBatch* batch) { |
| 30 fCommands->recordDrawBatch(batch, *this->caps()); | 30 fCommands->recordDrawBatch(batch, *this->caps()); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void GrBufferedDrawTarget::onStencilPath(const GrPipelineBuilder& pipelineBuilde
r, | |
| 34 const GrPathProcessor* pathProc, | |
| 35 const GrPath* path, | |
| 36 const GrScissorState& scissorState, | |
| 37 const GrStencilSettings& stencilSetting
s) { | |
| 38 fCommands->recordStencilPath(pipelineBuilder, pathProc, path, scissorState,
stencilSettings); | |
| 39 } | |
| 40 | |
| 41 void GrBufferedDrawTarget::onDrawPath(const GrPathProcessor* pathProc, | 33 void GrBufferedDrawTarget::onDrawPath(const GrPathProcessor* pathProc, |
| 42 const GrPath* path, | 34 const GrPath* path, |
| 43 const GrStencilSettings& stencilSettings, | 35 const GrStencilSettings& stencilSettings, |
| 44 const PipelineInfo& pipelineInfo) { | 36 const PipelineInfo& pipelineInfo) { |
| 45 GrPipelineOptimizations opts; | 37 GrPipelineOptimizations opts; |
| 46 StateForPathDraw* state = this->createStateForPathDraw(pathProc, pipelineInf
o, &opts); | 38 StateForPathDraw* state = this->createStateForPathDraw(pathProc, pipelineInf
o, &opts); |
| 47 if (!state) { | 39 if (!state) { |
| 48 return; | 40 return; |
| 49 } | 41 } |
| 50 fCommands->recordDrawPath(state, pathProc, path, stencilSettings); | 42 fCommands->recordDrawPath(state, pathProc, path, stencilSettings); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 *state->fPrimitiveProcesso
r, | 98 *state->fPrimitiveProcesso
r, |
| 107 state->fBatchTracker) && | 99 state->fBatchTracker) && |
| 108 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { | 100 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { |
| 109 this->unallocState(state); | 101 this->unallocState(state); |
| 110 } else { | 102 } else { |
| 111 fPrevState.reset(state); | 103 fPrevState.reset(state); |
| 112 } | 104 } |
| 113 | 105 |
| 114 return fPrevState; | 106 return fPrevState; |
| 115 } | 107 } |
| OLD | NEW |