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

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

Issue 1275083002: Don't pass pipeline to GrBatch::generateGeometry() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrImmediateDrawTarget.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 "GrAARectRenderer.h" 9 #include "GrAARectRenderer.h"
10 #include "GrAtlasTextContext.h" 10 #include "GrAtlasTextContext.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 } 439 }
440 init.getOverrideColorIfSet(&fGeoData[0].fColor); 440 init.getOverrideColorIfSet(&fGeoData[0].fColor);
441 441
442 // setup batch properties 442 // setup batch properties
443 fBatch.fColorIgnored = !init.readsColor(); 443 fBatch.fColorIgnored = !init.readsColor();
444 fBatch.fColor = fGeoData[0].fColor; 444 fBatch.fColor = fGeoData[0].fColor;
445 fBatch.fUsesLocalCoords = init.readsLocalCoords(); 445 fBatch.fUsesLocalCoords = init.readsLocalCoords();
446 fBatch.fCoverageIgnored = !init.readsCoverage(); 446 fBatch.fCoverageIgnored = !init.readsCoverage();
447 } 447 }
448 448
449 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline ) override { 449 void generateGeometry(GrBatchTarget* batchTarget) override {
450 int colorOffset = -1, texOffset = -1; 450 int colorOffset = -1, texOffset = -1;
451 SkAutoTUnref<const GrGeometryProcessor> gp( 451 SkAutoTUnref<const GrGeometryProcessor> gp(
452 set_vertex_attributes(this->hasLocalCoords(), this->hasColors(), &colorOffset, 452 set_vertex_attributes(this->hasLocalCoords(), this->hasColors(), &colorOffset,
453 &texOffset, this->color(), this->viewMatri x(), 453 &texOffset, this->color(), this->viewMatri x(),
454 this->coverageIgnored())); 454 this->coverageIgnored()));
455 455
456 batchTarget->initDraw(gp, pipeline); 456 batchTarget->initDraw(gp, this->pipeline());
457 457
458 size_t vertexStride = gp->getVertexStride(); 458 size_t vertexStride = gp->getVertexStride();
459 459
460 SkASSERT(vertexStride == sizeof(SkPoint) + (this->hasLocalCoords() ? siz eof(SkPoint) : 0) 460 SkASSERT(vertexStride == sizeof(SkPoint) + (this->hasLocalCoords() ? siz eof(SkPoint) : 0)
461 + (this->hasColors() ? sizeof(G rColor) : 0)); 461 + (this->hasColors() ? sizeof(G rColor) : 0));
462 462
463 int instanceCount = fGeoData.count(); 463 int instanceCount = fGeoData.count();
464 464
465 const GrVertexBuffer* vertexBuffer; 465 const GrVertexBuffer* vertexBuffer;
466 int firstVertex; 466 int firstVertex;
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 return DrawVerticesBatch::Create(geometry, type, viewMatrix, 1134 return DrawVerticesBatch::Create(geometry, type, viewMatrix,
1135 positions.begin(), vertexCount, 1135 positions.begin(), vertexCount,
1136 indices.begin(), hasIndices ? vertexCount : 0, 1136 indices.begin(), hasIndices ? vertexCount : 0,
1137 colors.begin(), 1137 colors.begin(),
1138 texCoords.begin(), 1138 texCoords.begin(),
1139 bounds); 1139 bounds);
1140 } 1140 }
1141 1141
1142 #endif 1142 #endif
1143 1143
OLDNEW
« no previous file with comments | « src/gpu/GrDefaultPathRenderer.cpp ('k') | src/gpu/GrImmediateDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698