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

Side by Side Diff: src/gpu/batches/GrDrawVerticesBatch.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/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrNinePatch.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 * 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 "GrDrawVerticesBatch.h" 8 #include "GrDrawVerticesBatch.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 fGeoData[0].fColor = overrideColor; 85 fGeoData[0].fColor = overrideColor;
86 fGeoData[0].fColors.reset(); 86 fGeoData[0].fColors.reset();
87 fVariableColor = false; 87 fVariableColor = false;
88 } 88 }
89 fCoverageIgnored = !overrides.readsCoverage(); 89 fCoverageIgnored = !overrides.readsCoverage();
90 if (!overrides.readsLocalCoords()) { 90 if (!overrides.readsLocalCoords()) {
91 fGeoData[0].fLocalCoords.reset(); 91 fGeoData[0].fLocalCoords.reset();
92 } 92 }
93 } 93 }
94 94
95 void GrDrawVerticesBatch::onPrepareDraws(Target* target) { 95 void GrDrawVerticesBatch::onPrepareDraws(Target* target) const {
96 bool hasLocalCoords = !fGeoData[0].fLocalCoords.isEmpty(); 96 bool hasLocalCoords = !fGeoData[0].fLocalCoords.isEmpty();
97 int colorOffset = -1, texOffset = -1; 97 int colorOffset = -1, texOffset = -1;
98 SkAutoTUnref<const GrGeometryProcessor> gp( 98 SkAutoTUnref<const GrGeometryProcessor> gp(
99 set_vertex_attributes(hasLocalCoords, &colorOffset, &texOffset, fViewMat rix, 99 set_vertex_attributes(hasLocalCoords, &colorOffset, &texOffset, fViewMat rix,
100 fCoverageIgnored)); 100 fCoverageIgnored));
101 target->initDraw(gp, this->pipeline()); 101 target->initDraw(gp, this->pipeline());
102 102
103 size_t vertexStride = gp->getVertexStride(); 103 size_t vertexStride = gp->getVertexStride();
104 104
105 SkASSERT(vertexStride == sizeof(SkPoint) + (hasLocalCoords ? sizeof(SkPoint) : 0) 105 SkASSERT(vertexStride == sizeof(SkPoint) + (hasLocalCoords ? sizeof(SkPoint) : 0)
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 geometry.fColor = GrRandomColor(random); 318 geometry.fColor = GrRandomColor(random);
319 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, 319 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix,
320 positions.begin(), vertexCount, 320 positions.begin(), vertexCount,
321 indices.begin(), hasIndices ? vertexCount : 0, 321 indices.begin(), hasIndices ? vertexCount : 0,
322 colors.begin(), 322 colors.begin(),
323 texCoords.begin(), 323 texCoords.begin(),
324 bounds); 324 bounds);
325 } 325 }
326 326
327 #endif 327 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrNinePatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698