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

Side by Side Diff: src/gpu/batches/GrVertexBatch.cpp

Issue 2078483002: Start using GrGpuCommandBuffer in GrDrawTarget. (Closed) Base URL: https://skia.googlesource.com/skia.git@memoryWAR
Patch Set: remove errant lines Created 4 years, 6 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/batches/GrDiscardBatch.h ('k') | src/gpu/gl/GrGLGpu.h » ('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 "GrVertexBatch.h" 8 #include "GrVertexBatch.h"
9 #include "GrBatchFlushState.h" 9 #include "GrBatchFlushState.h"
10 #include "GrResourceProvider.h" 10 #include "GrResourceProvider.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 SkASSERT(fQueuedDraws.empty() || fBaseDrawToken == state->nextTokenToFlush() ); 69 SkASSERT(fQueuedDraws.empty() || fBaseDrawToken == state->nextTokenToFlush() );
70 70
71 for (int currDrawIdx = 0; currDrawIdx < fQueuedDraws.count(); ++currDrawIdx) { 71 for (int currDrawIdx = 0; currDrawIdx < fQueuedDraws.count(); ++currDrawIdx) {
72 GrBatchDrawToken drawToken = state->nextTokenToFlush(); 72 GrBatchDrawToken drawToken = state->nextTokenToFlush();
73 while (currUploadIdx < fInlineUploads.count() && 73 while (currUploadIdx < fInlineUploads.count() &&
74 fInlineUploads[currUploadIdx].fUploadBeforeToken == drawToken) { 74 fInlineUploads[currUploadIdx].fUploadBeforeToken == drawToken) {
75 state->doUpload(fInlineUploads[currUploadIdx++].fUpload); 75 state->doUpload(fInlineUploads[currUploadIdx++].fUpload);
76 } 76 }
77 const QueuedDraw &draw = fQueuedDraws[currDrawIdx]; 77 const QueuedDraw &draw = fQueuedDraws[currDrawIdx];
78 state->gpu()->draw(*this->pipeline(), *draw.fGeometryProcessor.get(), 78 state->commandBuffer()->draw(*this->pipeline(), *draw.fGeometryProcessor .get(),
79 fMeshes.begin() + currMeshIdx, draw.fMeshCnt); 79 fMeshes.begin() + currMeshIdx, draw.fMeshCn t);
80 currMeshIdx += draw.fMeshCnt; 80 currMeshIdx += draw.fMeshCnt;
81 state->flushToken(); 81 state->flushToken();
82 } 82 }
83 SkASSERT(currUploadIdx == fInlineUploads.count()); 83 SkASSERT(currUploadIdx == fInlineUploads.count());
84 SkASSERT(currMeshIdx == fMeshes.count()); 84 SkASSERT(currMeshIdx == fMeshes.count());
85 fQueuedDraws.reset(); 85 fQueuedDraws.reset();
86 fInlineUploads.reset(); 86 fInlineUploads.reset();
87 } 87 }
88 88
89 ////////////////////////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////
(...skipping 13 matching lines...) Expand all
103 } 103 }
104 } 104 }
105 GrVertexBatch::QueuedDraw& draw = this->vertexBatch()->fQueuedDraws.push_bac k(); 105 GrVertexBatch::QueuedDraw& draw = this->vertexBatch()->fQueuedDraws.push_bac k();
106 GrBatchDrawToken token = this->state()->issueDrawToken(); 106 GrBatchDrawToken token = this->state()->issueDrawToken();
107 draw.fGeometryProcessor.reset(gp); 107 draw.fGeometryProcessor.reset(gp);
108 draw.fMeshCnt = 1; 108 draw.fMeshCnt = 1;
109 if (batch->fQueuedDraws.count() == 1) { 109 if (batch->fQueuedDraws.count() == 1) {
110 batch->fBaseDrawToken = token; 110 batch->fBaseDrawToken = token;
111 } 111 }
112 } 112 }
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDiscardBatch.h ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698