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

Side by Side Diff: src/gpu/batches/GrRectBatch.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/GrRectBatch.h ('k') | src/gpu/batches/GrStrokeRectBatch.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 "GrRectBatch.h" 8 #include "GrRectBatch.h"
9 9
10 #include "GrBatchTarget.h" 10 #include "GrBatchTarget.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 GrColor* vertColor = reinterpret_cast<GrColor*>(offset + kColorOffset); 73 GrColor* vertColor = reinterpret_cast<GrColor*>(offset + kColorOffset);
74 for (int j = 0; j < 4; ++j) { 74 for (int j = 0; j < 4; ++j) {
75 *vertColor = geom.fColor; 75 *vertColor = geom.fColor;
76 vertColor = (GrColor*) ((intptr_t) vertColor + vertexStride); 76 vertColor = (GrColor*) ((intptr_t) vertColor + vertexStride);
77 } 77 }
78 } 78 }
79 79
80 helper.issueDraw(batchTarget); 80 helper.issueDraw(batchTarget);
81 } 81 }
82 82
83 bool GrRectBatch::onCombineIfPossible(GrBatch* t) { 83 bool GrRectBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
84 if (!this->pipeline()->isEqual(*t->pipeline())) { 84 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline( ), t->bounds(),
85 caps)) {
85 return false; 86 return false;
86 } 87 }
87 88
88 GrRectBatch* that = t->cast<GrRectBatch>(); 89 GrRectBatch* that = t->cast<GrRectBatch>();
89 90
90 if (this->hasLocalRect() != that->hasLocalRect()) { 91 if (this->hasLocalRect() != that->hasLocalRect()) {
91 return false; 92 return false;
92 } 93 }
93 94
94 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); 95 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords());
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 166
166 geometry.fHasLocalMatrix = random->nextBool(); 167 geometry.fHasLocalMatrix = random->nextBool();
167 if (geometry.fHasLocalMatrix) { 168 if (geometry.fHasLocalMatrix) {
168 geometry.fLocalMatrix = GrTest::TestMatrix(random); 169 geometry.fLocalMatrix = GrTest::TestMatrix(random);
169 } 170 }
170 171
171 return GrRectBatch::Create(geometry); 172 return GrRectBatch::Create(geometry);
172 } 173 }
173 174
174 #endif 175 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrRectBatch.h ('k') | src/gpu/batches/GrStrokeRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698