| 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::onDrawPath(const GrPathProcessor* pathProc, | |
| 34 const GrPath* path, | |
| 35 const GrStencilSettings& stencilSettings, | |
| 36 const PipelineInfo& pipelineInfo) { | |
| 37 GrPipelineOptimizations opts; | |
| 38 StateForPathDraw* state = this->createStateForPathDraw(pathProc, pipelineInf
o, &opts); | |
| 39 if (!state) { | |
| 40 return; | |
| 41 } | |
| 42 fCommands->recordDrawPath(state, pathProc, path, stencilSettings); | |
| 43 } | |
| 44 | |
| 45 void GrBufferedDrawTarget::onDrawPaths(const GrPathProcessor* pathProc, | 33 void GrBufferedDrawTarget::onDrawPaths(const GrPathProcessor* pathProc, |
| 46 const GrPathRange* pathRange, | 34 const GrPathRange* pathRange, |
| 47 const void* indices, | 35 const void* indices, |
| 48 PathIndexType indexType, | 36 PathIndexType indexType, |
| 49 const float transformValues[], | 37 const float transformValues[], |
| 50 PathTransformType transformType, | 38 PathTransformType transformType, |
| 51 int count, | 39 int count, |
| 52 const GrStencilSettings& stencilSettings, | 40 const GrStencilSettings& stencilSettings, |
| 53 const PipelineInfo& pipelineInfo) { | 41 const PipelineInfo& pipelineInfo) { |
| 54 GrPipelineOptimizations opts; | 42 GrPipelineOptimizations opts; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 *state->fPrimitiveProcesso
r, | 86 *state->fPrimitiveProcesso
r, |
| 99 state->fBatchTracker) && | 87 state->fBatchTracker) && |
| 100 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { | 88 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { |
| 101 this->unallocState(state); | 89 this->unallocState(state); |
| 102 } else { | 90 } else { |
| 103 fPrevState.reset(state); | 91 fPrevState.reset(state); |
| 104 } | 92 } |
| 105 | 93 |
| 106 return fPrevState; | 94 return fPrevState; |
| 107 } | 95 } |
| OLD | NEW |