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

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

Issue 1242033002: All batches do their own pipeline compare (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add quick accept to pipeline compare Created 5 years, 5 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/GrPipeline.cpp ('k') | src/gpu/effects/GrDashingEffect.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 "GrRectBatch.h" 8 #include "GrRectBatch.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 GrColor color() const { return fBatch.fColor; } 166 GrColor color() const { return fBatch.fColor; }
167 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 167 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
168 bool colorIgnored() const { return fBatch.fColorIgnored; } 168 bool colorIgnored() const { return fBatch.fColorIgnored; }
169 const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; } 169 const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
170 const SkMatrix& localMatrix() const { return fGeoData[0].fLocalMatrix; } 170 const SkMatrix& localMatrix() const { return fGeoData[0].fLocalMatrix; }
171 bool hasLocalRect() const { return fGeoData[0].fHasLocalRect; } 171 bool hasLocalRect() const { return fGeoData[0].fHasLocalRect; }
172 bool hasLocalMatrix() const { return fGeoData[0].fHasLocalMatrix; } 172 bool hasLocalMatrix() const { return fGeoData[0].fHasLocalMatrix; }
173 bool coverageIgnored() const { return fBatch.fCoverageIgnored; } 173 bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
174 174
175 bool onCombineIfPossible(GrBatch* t) override { 175 bool onCombineIfPossible(GrBatch* t) override {
176 if (!this->pipeline()->isEqual(*t->pipeline())) {
177 return false;
178 }
179
176 RectBatch* that = t->cast<RectBatch>(); 180 RectBatch* that = t->cast<RectBatch>();
177 181
178 if (this->hasLocalRect() != that->hasLocalRect()) { 182 if (this->hasLocalRect() != that->hasLocalRect()) {
179 return false; 183 return false;
180 } 184 }
181 185
182 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); 186 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords());
183 if (!this->hasLocalRect() && this->usesLocalCoords()) { 187 if (!this->hasLocalRect() && this->usesLocalCoords()) {
184 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) { 188 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) {
185 return false; 189 return false;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 if (hasLocalMatrix) { 272 if (hasLocalMatrix) {
269 localMatrix = GrTest::TestMatrix(random); 273 localMatrix = GrTest::TestMatrix(random);
270 } 274 }
271 275
272 return GrRectBatch::Create(color, viewMatrix, rect, 276 return GrRectBatch::Create(color, viewMatrix, rect,
273 hasLocalRect ? &localRect : NULL, 277 hasLocalRect ? &localRect : NULL,
274 hasLocalMatrix ? &localMatrix : NULL); 278 hasLocalMatrix ? &localMatrix : NULL);
275 } 279 }
276 280
277 #endif 281 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrPipeline.cpp ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698