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

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

Issue 1483103003: Make onPrepareDraws const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: merge Created 5 years 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/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('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 * 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 "GrBatchFlushState.h" 9 #include "GrBatchFlushState.h"
10 #include "GrBatchTest.h" 10 #include "GrBatchTest.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 Color gpColor(color); 44 Color gpColor(color);
45 if (hasColors) { 45 if (hasColors) {
46 gpColor.fType = Color::kAttribute_Type; 46 gpColor.fType = Color::kAttribute_Type;
47 } 47 }
48 48
49 Coverage coverage(coverageIgnored ? Coverage::kNone_Type : Coverage::kSolid_ Type); 49 Coverage coverage(coverageIgnored ? Coverage::kNone_Type : Coverage::kSolid_ Type);
50 LocalCoords localCoords(LocalCoords::kHasExplicit_Type); 50 LocalCoords localCoords(LocalCoords::kHasExplicit_Type);
51 return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewM atrix); 51 return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewM atrix);
52 } 52 }
53 53
54 void GrDrawAtlasBatch::onPrepareDraws(Target* target) { 54 void GrDrawAtlasBatch::onPrepareDraws(Target* target) const {
55 // Setup geometry processor 55 // Setup geometry processor
56 SkAutoTUnref<const GrGeometryProcessor> gp(set_vertex_attributes(this->hasCo lors(), 56 SkAutoTUnref<const GrGeometryProcessor> gp(set_vertex_attributes(this->hasCo lors(),
57 this->color (), 57 this->color (),
58 this->viewM atrix(), 58 this->viewM atrix(),
59 this->cover ageIgnored())); 59 this->cover ageIgnored()));
60 60
61 target->initDraw(gp, this->pipeline()); 61 target->initDraw(gp, this->pipeline());
62 62
63 int instanceCount = fGeoData.count(); 63 int instanceCount = fGeoData.count();
64 size_t vertexStride = gp->getVertexStride(); 64 size_t vertexStride = gp->getVertexStride();
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 SkMatrix viewMatrix = GrTest::TestMatrix(random); 259 SkMatrix viewMatrix = GrTest::TestMatrix(random);
260 260
261 GrDrawAtlasBatch::Geometry geometry; 261 GrDrawAtlasBatch::Geometry geometry;
262 geometry.fColor = GrRandomColor(random); 262 geometry.fColor = GrRandomColor(random);
263 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be gin(), 263 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be gin(),
264 texRects.begin(), hasColors ? colors.begin() : nullptr); 264 texRects.begin(), hasColors ? colors.begin() : nullptr);
265 } 265 }
266 266
267 #endif 267 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698