OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrTargetCommands.h" | 8 #include "GrTargetCommands.h" |
9 | 9 |
10 #include "GrBufferedDrawTarget.h" | 10 #include "GrBufferedDrawTarget.h" |
11 | 11 |
| 12 GrBATCH_SPEW(int32_t GrTargetCommands::Cmd::gUniqueID = 0;) |
| 13 |
12 void GrTargetCommands::reset() { | 14 void GrTargetCommands::reset() { |
13 fCmdBuffer.reset(); | 15 fCmdBuffer.reset(); |
14 fBatchTarget.reset(); | 16 fBatchTarget.reset(); |
15 } | 17 } |
16 | 18 |
17 void GrTargetCommands::flush(GrBufferedDrawTarget* bufferedDrawTarget) { | 19 void GrTargetCommands::flush(GrBufferedDrawTarget* bufferedDrawTarget) { |
| 20 GrBATCH_INFO("Flushing\n"); |
18 if (fCmdBuffer.empty()) { | 21 if (fCmdBuffer.empty()) { |
19 return; | 22 return; |
20 } | 23 } |
21 | 24 |
22 GrGpu* gpu = bufferedDrawTarget->getGpu(); | 25 GrGpu* gpu = bufferedDrawTarget->getGpu(); |
23 | 26 |
24 // Loop over all batches and generate geometry | 27 // Loop over all batches and generate geometry |
25 CmdBuffer::Iter genIter(fCmdBuffer); | 28 CmdBuffer::Iter genIter(fCmdBuffer); |
26 while (genIter.next()) { | 29 while (genIter.next()) { |
27 if (Cmd::kDrawBatch_CmdType == genIter->type()) { | 30 if (Cmd::kDrawBatch_CmdType == genIter->type()) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget()); | 102 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget()); |
100 } | 103 } |
101 | 104 |
102 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) { | 105 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) { |
103 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint); | 106 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint); |
104 } | 107 } |
105 | 108 |
106 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) { | 109 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) { |
107 gpu->xferBarrier(fRenderTarget.get(), fBarrierType); | 110 gpu->xferBarrier(fRenderTarget.get(), fBarrierType); |
108 } | 111 } |
OLD | NEW |