| 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 "GrInOrderDrawBuffer.h" | 8 #include "GrInOrderDrawBuffer.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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 void GrInOrderDrawBuffer::onFlush() { | 122 void GrInOrderDrawBuffer::onFlush() { |
| 123 fCommands->flush(this); | 123 fCommands->flush(this); |
| 124 ++fDrawID; | 124 ++fDrawID; |
| 125 } | 125 } |
| 126 | 126 |
| 127 void GrInOrderDrawBuffer::onCopySurface(GrSurface* dst, | 127 void GrInOrderDrawBuffer::onCopySurface(GrSurface* dst, |
| 128 GrSurface* src, | 128 GrSurface* src, |
| 129 const SkIRect& srcRect, | 129 const SkIRect& srcRect, |
| 130 const SkIPoint& dstPoint) { | 130 const SkIPoint& dstPoint) { |
| 131 SkASSERT(this->getGpu()->canCopySurface(dst, src, srcRect, dstPoint)); | |
| 132 GrTargetCommands::Cmd* cmd = fCommands->recordCopySurface(dst, src, srcRect,
dstPoint); | 131 GrTargetCommands::Cmd* cmd = fCommands->recordCopySurface(dst, src, srcRect,
dstPoint); |
| 133 this->recordTraceMarkersIfNecessary(cmd); | 132 this->recordTraceMarkersIfNecessary(cmd); |
| 134 } | 133 } |
| 135 | 134 |
| 136 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* c
md) { | 135 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* c
md) { |
| 137 if (!cmd) { | 136 if (!cmd) { |
| 138 return; | 137 return; |
| 139 } | 138 } |
| 140 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); | 139 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); |
| 141 if (activeTraceMarkers.count() > 0) { | 140 if (activeTraceMarkers.count() > 0) { |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { | 193 fPrevState->getPipeline()->isEqual(*state->getPipeline())) { |
| 195 this->unallocState(state); | 194 this->unallocState(state); |
| 196 } else { | 195 } else { |
| 197 fPrevState.reset(state); | 196 fPrevState.reset(state); |
| 198 } | 197 } |
| 199 | 198 |
| 200 this->recordTraceMarkersIfNecessary( | 199 this->recordTraceMarkersIfNecessary( |
| 201 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(),
*this->caps())); | 200 fCommands->recordXferBarrierIfNecessary(*fPrevState->getPipeline(),
*this->caps())); |
| 202 return fPrevState; | 201 return fPrevState; |
| 203 } | 202 } |
| OLD | NEW |