| 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" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 db->batch()->generateGeometry(&fBatchTarget); | 33 db->batch()->generateGeometry(&fBatchTarget); |
| 34 db->batch()->setNumberOfDraws(fBatchTarget.numberOfDraws()); | 34 db->batch()->setNumberOfDraws(fBatchTarget.numberOfDraws()); |
| 35 } | 35 } |
| 36 } | 36 } |
| 37 | 37 |
| 38 fBatchTarget.preFlush(); | 38 fBatchTarget.preFlush(); |
| 39 | 39 |
| 40 CmdBuffer::Iter iter(fCmdBuffer); | 40 CmdBuffer::Iter iter(fCmdBuffer); |
| 41 | 41 |
| 42 while (iter.next()) { | 42 while (iter.next()) { |
| 43 GrGpuTraceMarker newMarker("", -1); | |
| 44 SkString traceString; | |
| 45 if (iter->isTraced()) { | |
| 46 traceString = bufferedDrawTarget->getCmdString(iter->markerID()); | |
| 47 newMarker.fMarker = traceString.c_str(); | |
| 48 gpu->addGpuTraceMarker(&newMarker); | |
| 49 } | |
| 50 | |
| 51 iter->execute(gpu); | 43 iter->execute(gpu); |
| 52 if (iter->isTraced()) { | |
| 53 gpu->removeGpuTraceMarker(&newMarker); | |
| 54 } | |
| 55 } | 44 } |
| 56 | 45 |
| 57 fBatchTarget.postFlush(); | 46 fBatchTarget.postFlush(); |
| 58 } | 47 } |
| 59 | 48 |
| 60 void GrTargetCommands::StencilPath::execute(GrGpu* gpu) { | 49 void GrTargetCommands::StencilPath::execute(GrGpu* gpu) { |
| 61 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewM
atrix, &fScissor, | 50 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewM
atrix, &fScissor, |
| 62 &fStencil); | 51 &fStencil); |
| 63 gpu->pathRendering()->stencilPath(args, this->path()); | 52 gpu->pathRendering()->stencilPath(args, this->path()); |
| 64 } | 53 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget()); | 91 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget()); |
| 103 } | 92 } |
| 104 | 93 |
| 105 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) { | 94 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) { |
| 106 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint); | 95 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint); |
| 107 } | 96 } |
| 108 | 97 |
| 109 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) { | 98 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) { |
| 110 gpu->xferBarrier(fRenderTarget.get(), fBarrierType); | 99 gpu->xferBarrier(fRenderTarget.get(), fBarrierType); |
| 111 } | 100 } |
| OLD | NEW |