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

Side by Side Diff: src/gpu/GrAADistanceFieldPathRenderer.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/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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 kIndicesPerQuad, flushInfo->fInstancesToFlush, maxInstancesPerDraw); 485 kIndicesPerQuad, flushInfo->fInstancesToFlush, maxInstancesPerDraw);
486 batchTarget->draw(vertices); 486 batchTarget->draw(vertices);
487 flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFl ush; 487 flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFl ush;
488 flushInfo->fInstancesToFlush = 0; 488 flushInfo->fInstancesToFlush = 0;
489 } 489 }
490 490
491 GrColor color() const { return fBatch.fColor; } 491 GrColor color() const { return fBatch.fColor; }
492 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } 492 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
493 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 493 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
494 494
495 bool onCombineIfPossible(GrBatch* t) override { 495 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
496 if (!this->pipeline()->isEqual(*t->pipeline())) { 496 if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipel ine(), t->bounds(),
497 caps)) {
497 return false; 498 return false;
498 } 499 }
499 500
500 AADistanceFieldPathBatch* that = t->cast<AADistanceFieldPathBatch>(); 501 AADistanceFieldPathBatch* that = t->cast<AADistanceFieldPathBatch>();
501 502
502 // TODO we could actually probably do a bunch of this work on the CPU, i e map viewMatrix, 503 // TODO we could actually probably do a bunch of this work on the CPU, i e map viewMatrix,
503 // maybe upload color via attribute 504 // maybe upload color via attribute
504 if (this->color() != that->color()) { 505 if (this->color() != that->color()) {
505 return false; 506 return false;
506 } 507 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 geometry.fPath = GrTest::TestPath(random); 626 geometry.fPath = GrTest::TestPath(random);
626 geometry.fAntiAlias = random->nextBool(); 627 geometry.fAntiAlias = random->nextBool();
627 628
628 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix, 629 return AADistanceFieldPathBatch::Create(geometry, color, viewMatrix,
629 gTestStruct.fAtlas, 630 gTestStruct.fAtlas,
630 &gTestStruct.fPathCache, 631 &gTestStruct.fPathCache,
631 &gTestStruct.fPathList); 632 &gTestStruct.fPathList);
632 } 633 }
633 634
634 #endif 635 #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