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

Side by Side Diff: src/gpu/batches/GrDrawAtlasBatch.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/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawVerticesBatch.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 "GrDrawAtlasBatch.h" 8 #include "GrDrawAtlasBatch.h"
9 #include "GrBatchTest.h" 9 #include "GrBatchTest.h"
10 #include "SkGr.h" 10 #include "SkGr.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 bounds.growToInclude(quad[3].fX, quad[3].fY); 149 bounds.growToInclude(quad[3].fX, quad[3].fY);
150 currVertex += vertexStride; 150 currVertex += vertexStride;
151 } 151 }
152 152
153 viewMatrix.mapRect(&bounds); 153 viewMatrix.mapRect(&bounds);
154 // Outset for a half pixel in each direction to account for snapping in non- AA case 154 // Outset for a half pixel in each direction to account for snapping in non- AA case
155 bounds.outset(0.5f, 0.5f); 155 bounds.outset(0.5f, 0.5f);
156 this->setBounds(bounds); 156 this->setBounds(bounds);
157 } 157 }
158 158
159 bool GrDrawAtlasBatch::onCombineIfPossible(GrBatch* t) { 159 bool GrDrawAtlasBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
160 if (!this->pipeline()->isEqual(*t->pipeline())) { 160 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline( ), t->bounds(),
161 caps)) {
161 return false; 162 return false;
162 } 163 }
163 164
164 GrDrawAtlasBatch* that = t->cast<GrDrawAtlasBatch>(); 165 GrDrawAtlasBatch* that = t->cast<GrDrawAtlasBatch>();
165 166
166 // We currently use a uniform viewmatrix for this batch 167 // We currently use a uniform viewmatrix for this batch
167 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) { 168 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) {
168 return false; 169 return false;
169 } 170 }
170 171
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 248
248 SkMatrix viewMatrix = GrTest::TestMatrix(random); 249 SkMatrix viewMatrix = GrTest::TestMatrix(random);
249 250
250 GrDrawAtlasBatch::Geometry geometry; 251 GrDrawAtlasBatch::Geometry geometry;
251 geometry.fColor = GrRandomColor(random); 252 geometry.fColor = GrRandomColor(random);
252 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be gin(), 253 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be gin(),
253 texRects.begin(), colors.begin()); 254 texRects.begin(), colors.begin());
254 } 255 }
255 256
256 #endif 257 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698