| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 GrPipelineOptimizations opts; | 62 GrPipelineOptimizations opts; |
| 63 StateForPathDraw* state = this->createStateForPathDraw(pathProc, pipelineInf
o, &opts); | 63 StateForPathDraw* state = this->createStateForPathDraw(pathProc, pipelineInf
o, &opts); |
| 64 if (!state) { | 64 if (!state) { |
| 65 return; | 65 return; |
| 66 } | 66 } |
| 67 fCommands->recordDrawPaths(state, this, pathProc, pathRange, indices, indexT
ype, | 67 fCommands->recordDrawPaths(state, this, pathProc, pathRange, indices, indexT
ype, |
| 68 transformValues, transformType, count, stencilSet
tings, | 68 transformValues, transformType, count, stencilSet
tings, |
| 69 opts); | 69 opts); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void GrBufferedDrawTarget::clearStencilClip(const SkIRect& rect, | |
| 73 bool insideClip, | |
| 74 GrRenderTarget* renderTarget) { | |
| 75 fCommands->recordClearStencilClip(rect, insideClip, renderTarget); | |
| 76 } | |
| 77 | |
| 78 void GrBufferedDrawTarget::onReset() { | 72 void GrBufferedDrawTarget::onReset() { |
| 79 fCommands->reset(); | 73 fCommands->reset(); |
| 80 fPathIndexBuffer.rewind(); | 74 fPathIndexBuffer.rewind(); |
| 81 fPathTransformBuffer.rewind(); | 75 fPathTransformBuffer.rewind(); |
| 82 | 76 |
| 83 fPrevState.reset(NULL); | 77 fPrevState.reset(NULL); |
| 84 // Note, fPrevState points into fPipelineBuffer's allocation, so we have to
reset first. | 78 // Note, fPrevState points into fPipelineBuffer's allocation, so we have to
reset first. |
| 85 // Furthermore, we have to reset fCommands before fPipelineBuffer too. | 79 // Furthermore, we have to reset fCommands before fPipelineBuffer too. |
| 86 if (fDrawID % kPipelineBufferHighWaterMark) { | 80 if (fDrawID % kPipelineBufferHighWaterMark) { |
| 87 fPipelineBuffer.rewind(); | 81 fPipelineBuffer.rewind(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 *state->fPrimitiveProcesso
r, | 113 *state->fPrimitiveProcesso
r, |
| 120 state->fBatchTracker) && | 114 state->fBatchTracker) && |
| 121 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { | 115 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { |
| 122 this->unallocState(state); | 116 this->unallocState(state); |
| 123 } else { | 117 } else { |
| 124 fPrevState.reset(state); | 118 fPrevState.reset(state); |
| 125 } | 119 } |
| 126 | 120 |
| 127 return fPrevState; | 121 return fPrevState; |
| 128 } | 122 } |
| OLD | NEW |