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

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

Issue 1352813003: add a ClassID function to GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 3 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/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawBatch.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 size_t allocSize = args.fVerts.count(); 71 size_t allocSize = args.fVerts.count();
72 memcpy(vertPtr, args.fVerts.begin(), allocSize); 72 memcpy(vertPtr, args.fVerts.begin(), allocSize);
73 vertPtr += allocSize; 73 vertPtr += allocSize;
74 } 74 }
75 helper.recordDraw(target); 75 helper.recordDraw(target);
76 } 76 }
77 77
78 GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie wMatrix, 78 GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& vie wMatrix,
79 int spriteCount, const SkRSXform* xforms, con st SkRect* rects, 79 int spriteCount, const SkRSXform* xforms, con st SkRect* rects,
80 const SkColor* colors) { 80 const SkColor* colors)
81 this->initClassID<GrDrawAtlasBatch>(); 81 : INHERITED(ClassID()) {
82 SkASSERT(xforms); 82 SkASSERT(xforms);
83 SkASSERT(rects); 83 SkASSERT(rects);
84 84
85 fViewMatrix = viewMatrix; 85 fViewMatrix = viewMatrix;
86 Geometry& installedGeo = fGeoData.push_back(geometry); 86 Geometry& installedGeo = fGeoData.push_back(geometry);
87 87
88 // Figure out stride and offsets 88 // Figure out stride and offsets
89 // Order within the vertex is: position [color] texCoord 89 // Order within the vertex is: position [color] texCoord
90 size_t texOffset = sizeof(SkPoint); 90 size_t texOffset = sizeof(SkPoint);
91 size_t vertexStride = 2*sizeof(SkPoint); 91 size_t vertexStride = 2*sizeof(SkPoint);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 249
250 SkMatrix viewMatrix = GrTest::TestMatrix(random); 250 SkMatrix viewMatrix = GrTest::TestMatrix(random);
251 251
252 GrDrawAtlasBatch::Geometry geometry; 252 GrDrawAtlasBatch::Geometry geometry;
253 geometry.fColor = GrRandomColor(random); 253 geometry.fColor = GrRandomColor(random);
254 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be gin(), 254 return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.be gin(),
255 texRects.begin(), hasColors ? colors.begin() : nullptr); 255 texRects.begin(), hasColors ? colors.begin() : nullptr);
256 } 256 }
257 257
258 #endif 258 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698