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

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

Issue 1287973003: Check for xfer barriers in GrBatch, auto-issue barriers in GrGpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment Created 5 years, 4 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/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrRectBatch.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 "GrDrawVerticesBatch.h" 8 #include "GrDrawVerticesBatch.h"
9 9
10 #include "GrBatchTarget.h" 10 #include "GrBatchTarget.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 if (this->hasIndices()) { 176 if (this->hasIndices()) {
177 vertices.initIndexed(this->primitiveType(), vertexBuffer, indexBuffer, f irstVertex, 177 vertices.initIndexed(this->primitiveType(), vertexBuffer, indexBuffer, f irstVertex,
178 firstIndex, this->vertexCount(), this->indexCount() ); 178 firstIndex, this->vertexCount(), this->indexCount() );
179 179
180 } else { 180 } else {
181 vertices.init(this->primitiveType(), vertexBuffer, firstVertex, this->ve rtexCount()); 181 vertices.init(this->primitiveType(), vertexBuffer, firstVertex, this->ve rtexCount());
182 } 182 }
183 batchTarget->draw(vertices); 183 batchTarget->draw(vertices);
184 } 184 }
185 185
186 bool GrDrawVerticesBatch::onCombineIfPossible(GrBatch* t) { 186 bool GrDrawVerticesBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
187 if (!this->pipeline()->isEqual(*t->pipeline())) { 187 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline( ), t->bounds(),
188 caps)) {
188 return false; 189 return false;
189 } 190 }
190 191
191 GrDrawVerticesBatch* that = t->cast<GrDrawVerticesBatch>(); 192 GrDrawVerticesBatch* that = t->cast<GrDrawVerticesBatch>();
192 193
193 if (!this->batchablePrimitiveType() || this->primitiveType() != that->primit iveType()) { 194 if (!this->batchablePrimitiveType() || this->primitiveType() != that->primit iveType()) {
194 return false; 195 return false;
195 } 196 }
196 197
197 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); 198 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords());
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 geometry.fColor = GrRandomColor(random); 340 geometry.fColor = GrRandomColor(random);
340 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, 341 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix,
341 positions.begin(), vertexCount, 342 positions.begin(), vertexCount,
342 indices.begin(), hasIndices ? vertexCount : 0, 343 indices.begin(), hasIndices ? vertexCount : 0,
343 colors.begin(), 344 colors.begin(),
344 texCoords.begin(), 345 texCoords.begin(),
345 bounds); 346 bounds);
346 } 347 }
347 348
348 #endif 349 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698