| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // Note, fPrevState points into fPipelineBuffer's allocation, so we have to
reset first. | 96 // Note, fPrevState points into fPipelineBuffer's allocation, so we have to
reset first. |
| 97 // Furthermore, we have to reset fCommands before fPipelineBuffer too. | 97 // Furthermore, we have to reset fCommands before fPipelineBuffer too. |
| 98 if (fDrawID % kPipelineBufferHighWaterMark) { | 98 if (fDrawID % kPipelineBufferHighWaterMark) { |
| 99 fPipelineBuffer.rewind(); | 99 fPipelineBuffer.rewind(); |
| 100 } else { | 100 } else { |
| 101 fPipelineBuffer.reset(); | 101 fPipelineBuffer.reset(); |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 void GrBufferedDrawTarget::onFlush() { | 105 void GrBufferedDrawTarget::onFlush() { |
| 106 fCommands->flush(this); | 106 fCommands->flush(this->getGpu(), this->getContext()->resourceProvider()); |
| 107 ++fDrawID; | 107 ++fDrawID; |
| 108 } | 108 } |
| 109 | 109 |
| 110 void GrBufferedDrawTarget::onCopySurface(GrSurface* dst, | 110 void GrBufferedDrawTarget::onCopySurface(GrSurface* dst, |
| 111 GrSurface* src, | 111 GrSurface* src, |
| 112 const SkIRect& srcRect, | 112 const SkIRect& srcRect, |
| 113 const SkIPoint& dstPoint) { | 113 const SkIPoint& dstPoint) { |
| 114 fCommands->recordCopySurface(dst, src, srcRect, dstPoint); | 114 fCommands->recordCopySurface(dst, src, srcRect, dstPoint); |
| 115 } | 115 } |
| 116 | 116 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 131 *state->fPrimitiveProcesso
r, | 131 *state->fPrimitiveProcesso
r, |
| 132 state->fBatchTracker) && | 132 state->fBatchTracker) && |
| 133 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { | 133 GrPipeline::AreEqual(*fPrevState->getPipeline(), *state->getPipeline(),
false)) { |
| 134 this->unallocState(state); | 134 this->unallocState(state); |
| 135 } else { | 135 } else { |
| 136 fPrevState.reset(state); | 136 fPrevState.reset(state); |
| 137 } | 137 } |
| 138 | 138 |
| 139 return fPrevState; | 139 return fPrevState; |
| 140 } | 140 } |
| OLD | NEW |