Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: src/gpu/GrTargetCommands.cpp

Issue 1131553002: Isolate GrBufferAllocPools inside GrBatchTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | src/gpu/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrInOrderDrawBuffer.h" 10 #include "GrInOrderDrawBuffer.h"
11 11
12 void GrTargetCommands::reset() { 12 void GrTargetCommands::reset() {
13 fCmdBuffer.reset(); 13 fCmdBuffer.reset();
14 fBatchTarget.reset();
14 } 15 }
15 16
16 void GrTargetCommands::flush(GrInOrderDrawBuffer* iodb) { 17 void GrTargetCommands::flush(GrInOrderDrawBuffer* iodb) {
17 if (fCmdBuffer.empty()) { 18 if (fCmdBuffer.empty()) {
18 return; 19 return;
19 } 20 }
20 21
21 GrGpu* gpu = iodb->getGpu(); 22 GrGpu* gpu = iodb->getGpu();
22 23
23 // Loop over all batches and generate geometry 24 // Loop over all batches and generate geometry
24 CmdBuffer::Iter genIter(fCmdBuffer); 25 CmdBuffer::Iter genIter(fCmdBuffer);
25 while (genIter.next()) { 26 while (genIter.next()) {
26 if (Cmd::kDrawBatch_CmdType == genIter->type()) { 27 if (Cmd::kDrawBatch_CmdType == genIter->type()) {
27 DrawBatch* db = reinterpret_cast<DrawBatch*>(genIter.get()); 28 DrawBatch* db = reinterpret_cast<DrawBatch*>(genIter.get());
28 fBatchTarget.resetNumberOfDraws(); 29 fBatchTarget.resetNumberOfDraws();
29 db->fBatch->generateGeometry(&fBatchTarget, db->fState->getPipeline( )); 30 db->fBatch->generateGeometry(&fBatchTarget, db->fState->getPipeline( ));
30 db->fBatch->setNumberOfDraws(fBatchTarget.numberOfDraws()); 31 db->fBatch->setNumberOfDraws(fBatchTarget.numberOfDraws());
31 } 32 }
32 } 33 }
33 34
34 iodb->getVertexAllocPool()->unmap();
35 iodb->getIndexAllocPool()->unmap();
36 fBatchTarget.preFlush(); 35 fBatchTarget.preFlush();
37 36
38 CmdBuffer::Iter iter(fCmdBuffer); 37 CmdBuffer::Iter iter(fCmdBuffer);
39 38
40 while (iter.next()) { 39 while (iter.next()) {
41 GrGpuTraceMarker newMarker("", -1); 40 GrGpuTraceMarker newMarker("", -1);
42 SkString traceString; 41 SkString traceString;
43 if (iter->isTraced()) { 42 if (iter->isTraced()) {
44 traceString = iodb->getCmdString(iter->markerID()); 43 traceString = iodb->getCmdString(iter->markerID());
45 newMarker.fMarker = traceString.c_str(); 44 newMarker.fMarker = traceString.c_str();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget()); 106 gpu->clearStencilClip(fRect, fInsideClip, this->renderTarget());
108 } 107 }
109 108
110 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) { 109 void GrTargetCommands::CopySurface::execute(GrGpu* gpu) {
111 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint); 110 gpu->copySurface(this->dst(), this->src(), fSrcRect, fDstPoint);
112 } 111 }
113 112
114 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) { 113 void GrTargetCommands::XferBarrier::execute(GrGpu* gpu) {
115 gpu->xferBarrier(fBarrierType); 114 gpu->xferBarrier(fBarrierType);
116 } 115 }
OLDNEW
« no previous file with comments | « src/gpu/GrTargetCommands.h ('k') | src/gpu/GrTessellatingPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698