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

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

Issue 1279343004: Revise DrawAtlasBatch to get rid of one copy when generating the batch. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Picky picky Windows 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/batches/GrDrawAtlasBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawAtlasBatch.h
diff --git a/src/gpu/batches/GrDrawAtlasBatch.h b/src/gpu/batches/GrDrawAtlasBatch.h
index 6db0c94a4d28d05bbf1a5ba1a60338811e69b31b..bc882b2bfa55289191c02d8c07d13809acf809b6 100644
--- a/src/gpu/batches/GrDrawAtlasBatch.h
+++ b/src/gpu/batches/GrDrawAtlasBatch.h
@@ -15,18 +15,14 @@
class GrDrawAtlasBatch : public GrBatch {
public:
struct Geometry {
- GrColor fColor;
- SkTDArray<SkPoint> fPositions;
- SkTDArray<GrColor> fColors;
- SkTDArray<SkPoint> fLocalCoords;
+ GrColor fColor;
+ SkTArray<uint8_t, true> fVerts;
};
- static GrBatch* Create(const Geometry& geometry, const SkMatrix& viewMatrix,
- const SkPoint* positions, int vertexCount,
- const GrColor* colors, const SkPoint* localCoords,
- const SkRect& bounds) {
- return SkNEW_ARGS(GrDrawAtlasBatch, (geometry, viewMatrix, positions,
- vertexCount, colors, localCoords, bounds));
+ static GrBatch* Create(const Geometry& geometry, const SkMatrix& viewMatrix, int spriteCount,
+ const SkRSXform* xforms, const SkRect* rects, const SkColor* colors) {
+ return SkNEW_ARGS(GrDrawAtlasBatch, (geometry, viewMatrix, spriteCount,
+ xforms, rects, colors));
}
const char* name() const override { return "DrawAtlasBatch"; }
@@ -50,15 +46,14 @@ public:
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
private:
- GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix,
- const SkPoint* positions, int vertexCount,
- const GrColor* colors, const SkPoint* localCoords, const SkRect& bounds);
+ GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, int spriteCount,
+ const SkRSXform* xforms, const SkRect* rects, const SkColor* colors);
GrColor color() const { return fColor; }
bool colorIgnored() const { return fColorIgnored; }
const SkMatrix& viewMatrix() const { return fViewMatrix; }
bool hasColors() const { return fHasColors; }
- int vertexCount() const { return fVertexCount; }
+ int quadCount() const { return fQuadCount; }
bool coverageIgnored() const { return fCoverageIgnored; }
bool onCombineIfPossible(GrBatch* t) override;
@@ -66,7 +61,7 @@ private:
SkMatrix fViewMatrix;
GrColor fColor;
- int fVertexCount;
+ int fQuadCount;
bool fColorIgnored;
bool fCoverageIgnored;
bool fHasColors;
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/batches/GrDrawAtlasBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698