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

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

Issue 1374853004: Fix caching of nvpr glyphs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: MSVC warnings Created 5 years, 2 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/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawPathBatch.h
diff --git a/src/gpu/batches/GrDrawPathBatch.h b/src/gpu/batches/GrDrawPathBatch.h
index 91e0e41ee475ecf9b0f623dd62da034fa18678eb..d6d071122eaebc478af1fc6703ec74e7d2ab9aaa 100644
--- a/src/gpu/batches/GrDrawPathBatch.h
+++ b/src/gpu/batches/GrDrawPathBatch.h
@@ -95,9 +95,8 @@ class GrPathRangeDraw : public GrNonAtomicRef {
public:
typedef GrPathRendering::PathTransformType TransformType;
- static GrPathRangeDraw* Create(GrPathRange* range, TransformType transformType,
- int reserveCnt) {
- return new GrPathRangeDraw(range, transformType, reserveCnt);
+ static GrPathRangeDraw* Create(TransformType transformType, int reserveCnt) {
+ return new GrPathRangeDraw(transformType, reserveCnt);
}
void append(uint16_t index, float transform[]) {
@@ -113,20 +112,13 @@ public:
const uint16_t* indices() const { return fIndices.begin(); }
- const GrPathRange* range() const { return fPathRange.get(); }
-
- void loadGlyphPathsIfNeeded() {
- fPathRange.get()->loadPathsIfNeeded<uint16_t>(fIndices.begin(), fIndices.count());
- }
-
static bool CanMerge(const GrPathRangeDraw& a, const GrPathRangeDraw& b) {
- return a.transformType() == b.transformType() && a.range() == b.range();
+ return a.transformType() == b.transformType();
}
private:
- GrPathRangeDraw(GrPathRange* range, TransformType transformType, int reserveCnt)
- : fPathRange(range)
- , fTransformType(transformType)
+ GrPathRangeDraw(TransformType transformType, int reserveCnt)
+ : fTransformType(transformType)
, fIndices(reserveCnt)
, fTransforms(reserveCnt * GrPathRendering::PathTransformSize(transformType)) {
SkDEBUGCODE(fUsedInBatch = false;)
@@ -136,7 +128,6 @@ private:
static const int kIndexReserveCnt = 64;
static const int kTransformBufferReserveCnt = 2 * 64;
- GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange;
GrPathRendering::PathTransformType fTransformType;
SkSTArray<kIndexReserveCnt, uint16_t, true> fIndices;
SkSTArray<kTransformBufferReserveCnt, float, true> fTransforms;
@@ -157,8 +148,8 @@ public:
// This can't return a more abstract type because we install the stencil settings late :(
static GrDrawPathBatchBase* Create(const SkMatrix& viewMatrix, const SkMatrix& localMatrix,
- GrColor color, GrPathRangeDraw* pathRangeDraw) {
- return new GrDrawPathRangeBatch(viewMatrix, localMatrix, color, pathRangeDraw);
+ GrColor color, GrPathRange* range, GrPathRangeDraw* draw) {
+ return new GrDrawPathRangeBatch(viewMatrix, localMatrix, color, range, draw);
}
~GrDrawPathRangeBatch() override;
@@ -171,7 +162,7 @@ private:
inline bool isWinding() const;
GrDrawPathRangeBatch(const SkMatrix& viewMatrix, const SkMatrix& localMatrix, GrColor color,
- GrPathRangeDraw* pathRangeDraw);
+ GrPathRange* range, GrPathRangeDraw* draw);
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override;
@@ -179,10 +170,12 @@ private:
void onDraw(GrBatchFlushState* state) override;
+ typedef GrPendingIOResource<const GrPathRange, kRead_GrIOType> PendingPathRange;
typedef SkTLList<GrPathRangeDraw*> DrawList;
- DrawList fDraws;
- int fTotalPathCount;
- SkMatrix fLocalMatrix;
+ PendingPathRange fPathRange;
+ DrawList fDraws;
+ int fTotalPathCount;
+ SkMatrix fLocalMatrix;
typedef GrDrawPathBatchBase INHERITED;
};
« no previous file with comments | « src/gpu/GrStencilAndCoverTextContext.cpp ('k') | src/gpu/batches/GrDrawPathBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698