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

Side by Side Diff: src/gpu/GrAADistanceFieldPathRenderer.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/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.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 2014 Google Inc. 3 * Copyright 2014 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 "GrAADistanceFieldPathRenderer.h" 9 #include "GrAADistanceFieldPathRenderer.h"
10 10
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 batchTarget->draw(vertices); 494 batchTarget->draw(vertices);
495 flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFl ush; 495 flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFl ush;
496 flushInfo->fInstancesToFlush = 0; 496 flushInfo->fInstancesToFlush = 0;
497 } 497 }
498 498
499 GrColor color() const { return fBatch.fColor; } 499 GrColor color() const { return fBatch.fColor; }
500 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } 500 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
501 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 501 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
502 502
503 bool onCombineIfPossible(GrBatch* t) override { 503 bool onCombineIfPossible(GrBatch* t) override {
504 if (!this->pipeline()->isEqual(*t->pipeline())) {
505 return false;
506 }
507
504 AADistanceFieldPathBatch* that = t->cast<AADistanceFieldPathBatch>(); 508 AADistanceFieldPathBatch* that = t->cast<AADistanceFieldPathBatch>();
505 509
506 // TODO we could actually probably do a bunch of this work on the CPU, i e map viewMatrix, 510 // TODO we could actually probably do a bunch of this work on the CPU, i e map viewMatrix,
507 // maybe upload color via attribute 511 // maybe upload color via attribute
508 if (this->color() != that->color()) { 512 if (this->color() != that->color()) {
509 return false; 513 return false;
510 } 514 }
511 515
512 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) { 516 if (!this->viewMatrix().cheapEqualTo(that->viewMatrix())) {
513 return false; 517 return false;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 geometry.fPath = GrTest::TestPath(random); 655 geometry.fPath = GrTest::TestPath(random);
652 geometry.fAntiAlias = random->nextBool(); 656 geometry.fAntiAlias = random->nextBool();
653 657
654 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, 658 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix,
655 gTestStruct.fAtlas, 659 gTestStruct.fAtlas,
656 &gTestStruct.fPathCache, 660 &gTestStruct.fPathCache,
657 &gTestStruct.fPathList); 661 &gTestStruct.fPathList);
658 } 662 }
659 663
660 #endif 664 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAAConvexPathRenderer.cpp ('k') | src/gpu/GrAAHairLinePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698