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

Side by Side Diff: src/gpu/batches/GrDrawAtlasBatch.cpp

Issue 1285593002: Wire up testcreate function for GrDrawAtlasBatch (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/GrBatchTest.cpp ('k') | no next file » | 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 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrDrawAtlasBatch.h" 8 #include "GrDrawAtlasBatch.h"
9 #include "GrBatchTest.h" 9 #include "GrBatchTest.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
11 11
12 void GrDrawAtlasBatch::initBatchTracker(const GrPipelineInfo& init) { 12 void GrDrawAtlasBatch::initBatchTracker(const GrPipelineInfo& init) {
13 // Handle any color overrides 13 // Handle any color overrides
14 if (!init.readsColor()) { 14 if (!init.readsColor()) {
15 fGeoData[0].fColor = GrColor_ILLEGAL; 15 fGeoData[0].fColor = GrColor_ILLEGAL;
16 } 16 }
17 init.getOverrideColorIfSet(&fGeoData[0].fColor); 17 init.getOverrideColorIfSet(&fGeoData[0].fColor);
18 18
19 // setup batch properties 19 // setup batch properties
20 fColorIgnored = !init.readsColor(); 20 fColorIgnored = !init.readsColor();
21 fColor = fGeoData[0].fColor; 21 fColor = fGeoData[0].fColor;
22 SkASSERT(init.readsLocalCoords()); 22 // We'd like to assert this, but we can't because of GLPrograms test
23 //SkASSERT(init.readsLocalCoords());
23 fCoverageIgnored = !init.readsCoverage(); 24 fCoverageIgnored = !init.readsCoverage();
24 } 25 }
25 26
26 static const GrGeometryProcessor* set_vertex_attributes(bool hasLocalCoords, 27 static const GrGeometryProcessor* set_vertex_attributes(bool hasLocalCoords,
27 bool hasColors, 28 bool hasColors,
28 int* colorOffset, 29 int* colorOffset,
29 int* texOffset, 30 int* texOffset,
30 GrColor color, 31 GrColor color,
31 const SkMatrix& viewMatr ix, 32 const SkMatrix& viewMatr ix,
32 bool coverageIgnored) { 33 bool coverageIgnored) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 GrDrawAtlasBatch::Geometry geometry; 203 GrDrawAtlasBatch::Geometry geometry;
203 geometry.fColor = GrRandomColor(random); 204 geometry.fColor = GrRandomColor(random);
204 return GrDrawAtlasBatch::Create(geometry, viewMatrix, 205 return GrDrawAtlasBatch::Create(geometry, viewMatrix,
205 positions.begin(), vertexCount, 206 positions.begin(), vertexCount,
206 colors.begin(), 207 colors.begin(),
207 texCoords.begin(), 208 texCoords.begin(),
208 bounds); 209 bounds);
209 } 210 }
210 211
211 #endif 212 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrBatchTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698