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

Side by Side Diff: src/gpu/GrAALinearizingConvexPathRenderer.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/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAALinearizingConvexPathRenderer.h" 9 #include "GrAALinearizingConvexPathRenderer.h"
10 10
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 AAFlatteningConvexPathBatch(const Geometry& geometry) { 254 AAFlatteningConvexPathBatch(const Geometry& geometry) {
255 this->initClassID<AAFlatteningConvexPathBatch>(); 255 this->initClassID<AAFlatteningConvexPathBatch>();
256 fGeoData.push_back(geometry); 256 fGeoData.push_back(geometry);
257 257
258 // compute bounds 258 // compute bounds
259 fBounds = geometry.fPath.getBounds(); 259 fBounds = geometry.fPath.getBounds();
260 geometry.fViewMatrix.mapRect(&fBounds); 260 geometry.fViewMatrix.mapRect(&fBounds);
261 } 261 }
262 262
263 bool onCombineIfPossible(GrBatch* t) override { 263 bool onCombineIfPossible(GrBatch* t) override {
264 if (!this->pipeline()->isEqual(*t->pipeline())) {
265 return false;
266 }
267
264 AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch> (); 268 AAFlatteningConvexPathBatch* that = t->cast<AAFlatteningConvexPathBatch> ();
265 269
266 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords()); 270 SkASSERT(this->usesLocalCoords() == that->usesLocalCoords());
267 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi ewMatrix())) { 271 if (this->usesLocalCoords() && !this->viewMatrix().cheapEqualTo(that->vi ewMatrix())) {
268 return false; 272 return false;
269 } 273 }
270 274
271 // In the event of two batches, one who can tweak, one who cannot, we ju st fall back to 275 // In the event of two batches, one who can tweak, one who cannot, we ju st fall back to
272 // not tweaking 276 // not tweaking
273 if (this->canTweakAlphaForCoverage() != that->canTweakAlphaForCoverage() ) { 277 if (this->canTweakAlphaForCoverage() != that->canTweakAlphaForCoverage() ) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { 334 BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) {
331 AAFlatteningConvexPathBatch::Geometry geometry; 335 AAFlatteningConvexPathBatch::Geometry geometry;
332 geometry.fColor = GrRandomColor(random); 336 geometry.fColor = GrRandomColor(random);
333 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); 337 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random);
334 geometry.fPath = GrTest::TestPathConvex(random); 338 geometry.fPath = GrTest::TestPathConvex(random);
335 339
336 return AAFlatteningConvexPathBatch::Create(geometry); 340 return AAFlatteningConvexPathBatch::Create(geometry);
337 } 341 }
338 342
339 #endif 343 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAARectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698