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

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

Issue 1124733004: Move DrawInfo out from GrDrawTarget and rename to GrVertices. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment changes Created 5 years, 7 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 // TODO remove this when batch is everywhere 500 // TODO remove this when batch is everywhere
501 GrPipelineInfo init; 501 GrPipelineInfo init;
502 init.fColorIgnored = fBatch.fColorIgnored; 502 init.fColorIgnored = fBatch.fColorIgnored;
503 init.fOverrideColor = GrColor_ILLEGAL; 503 init.fOverrideColor = GrColor_ILLEGAL;
504 init.fCoverageIgnored = fBatch.fCoverageIgnored; 504 init.fCoverageIgnored = fBatch.fCoverageIgnored;
505 init.fUsesLocalCoords = this->usesLocalCoords(); 505 init.fUsesLocalCoords = this->usesLocalCoords();
506 dfProcessor->initBatchTracker(batchTarget->currentBatchTracker(), init); 506 dfProcessor->initBatchTracker(batchTarget->currentBatchTracker(), init);
507 } 507 }
508 508
509 void flush(GrBatchTarget* batchTarget, FlushInfo* flushInfo) { 509 void flush(GrBatchTarget* batchTarget, FlushInfo* flushInfo) {
510 GrDrawTarget::DrawInfo drawInfo; 510 GrVertices vertices;
511 int instancesToFlush = flushInfo->fInstancesToFlush; 511 int instancesToFlush = flushInfo->fInstancesToFlush;
512 int maxInstancesPerDraw = flushInfo->fIndexBuffer->maxQuads(); 512 int maxInstancesPerDraw = flushInfo->fIndexBuffer->maxQuads();
513 drawInfo.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuf fer, 513 vertices.initInstanced(kTriangles_GrPrimitiveType, flushInfo->fVertexBuf fer,
514 flushInfo->fIndexBuffer, flushInfo->fVertexOffset, kVerticesPerQuad, 514 flushInfo->fIndexBuffer, flushInfo->fVertexOffset, kVerticesPerQuad,
515 kIndicesPerQuad, &instancesToFlush, maxInstancesPerDraw); 515 kIndicesPerQuad, &instancesToFlush, maxInstancesPerDraw);
516 do { 516 do {
517 batchTarget->draw(drawInfo); 517 batchTarget->draw(vertices);
518 } while (drawInfo.nextInstances(&instancesToFlush, maxInstancesPerDraw)) ; 518 } while (vertices.nextInstances(&instancesToFlush, maxInstancesPerDraw)) ;
519 flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFl ush; 519 flushInfo->fVertexOffset += kVerticesPerQuad * flushInfo->fInstancesToFl ush;
520 flushInfo->fInstancesToFlush = 0; 520 flushInfo->fInstancesToFlush = 0;
521 } 521 }
522 522
523 GrColor color() const { return fBatch.fColor; } 523 GrColor color() const { return fBatch.fColor; }
524 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; } 524 const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
525 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; } 525 bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
526 526
527 bool onCombineIfPossible(GrBatch* t) override { 527 bool onCombineIfPossible(GrBatch* t) override {
528 AADistanceFieldPathBatch* that = t->cast<AADistanceFieldPathBatch>(); 528 AADistanceFieldPathBatch* that = t->cast<AADistanceFieldPathBatch>();
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 geometry.fPath = path; 596 geometry.fPath = path;
597 geometry.fAntiAlias = antiAlias; 597 geometry.fAntiAlias = antiAlias;
598 598
599 SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color , viewMatrix, 599 SkAutoTUnref<GrBatch> batch(AADistanceFieldPathBatch::Create(geometry, color , viewMatrix,
600 fAtlas, &fPathC ache, &fPathList)); 600 fAtlas, &fPathC ache, &fPathList));
601 target->drawBatch(pipelineBuilder, batch); 601 target->drawBatch(pipelineBuilder, batch);
602 602
603 return true; 603 return true;
604 } 604 }
605 605
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