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

Unified Diff: src/gpu/batches/GrDrawAtlasBatch.cpp

Issue 2110853004: Even more hiding of Geometry structs in GrBatch subclasses. (Closed) Base URL: https://chromium.googlesource.com/skia.git@moregeom
Patch Set: Address comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawAtlasBatch.cpp
diff --git a/src/gpu/batches/GrDrawAtlasBatch.cpp b/src/gpu/batches/GrDrawAtlasBatch.cpp
index 5b823a95a166bd1ffe4aa93d66bf321655d7a013..9a8952fa3a574e8991c3830530eb4f8415430af8 100644
--- a/src/gpu/batches/GrDrawAtlasBatch.cpp
+++ b/src/gpu/batches/GrDrawAtlasBatch.cpp
@@ -82,15 +82,16 @@ void GrDrawAtlasBatch::onPrepareDraws(Target* target) const {
helper.recordDraw(target, gp.get());
}
-GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix,
- int spriteCount, const SkRSXform* xforms, const SkRect* rects,
+GrDrawAtlasBatch::GrDrawAtlasBatch(GrColor color, const SkMatrix& viewMatrix, int spriteCount,
+ const SkRSXform* xforms, const SkRect* rects,
const SkColor* colors)
- : INHERITED(ClassID()) {
+ : INHERITED(ClassID()) {
SkASSERT(xforms);
SkASSERT(rects);
fViewMatrix = viewMatrix;
- Geometry& installedGeo = fGeoData.push_back(geometry);
+ Geometry& installedGeo = fGeoData.push_back();
+ installedGeo.fColor = color;
// Figure out stride and offsets
// Order within the vertex is: position [color] texCoord
@@ -188,7 +189,7 @@ bool GrDrawAtlasBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
if (this->color() != that->color()) {
fColor = GrColor_ILLEGAL;
}
- fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
+ fGeoData.push_back_n(that->fGeoData.count(), that->fGeoData.begin());
fQuadCount += that->quadCount();
this->joinBounds(that->bounds());
@@ -256,10 +257,9 @@ DRAW_BATCH_TEST_DEFINE(GrDrawAtlasBatch) {
SkMatrix viewMatrix = GrTest::TestMatrix(random);
- GrDrawAtlasBatch::Geometry geometry;
- geometry.fColor = GrRandomColor(random);
- return GrDrawAtlasBatch::Create(geometry, viewMatrix, spriteCount, xforms.begin(),
- texRects.begin(), hasColors ? colors.begin() : nullptr);
+ GrColor color = GrRandomColor(random);
+ return new GrDrawAtlasBatch(color, viewMatrix, spriteCount, xforms.begin(), texRects.begin(),
+ hasColors ? colors.begin() : nullptr);
}
#endif
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698