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

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

Issue 1698503002: Remove last bit of privacy violation for GrAtlasTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase + nits Created 4 years, 10 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/GrBatchAtlas.h ('k') | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrAtlasTextBatch.h
diff --git a/src/gpu/batches/GrAtlasTextBatch.h b/src/gpu/batches/GrAtlasTextBatch.h
index 05d6afdb5184a44eab6affd7c4eed2d68a9e1169..d90aa194c3e7d536cffc36ce8dc11ec3ea3a6093 100644
--- a/src/gpu/batches/GrAtlasTextBatch.h
+++ b/src/gpu/batches/GrAtlasTextBatch.h
@@ -21,8 +21,6 @@ public:
static const int kIndicesPerGlyph = 6;
typedef GrAtlasTextBlob Blob;
- typedef Blob::Run Run;
- typedef Run::SubRunInfo TextInfo;
struct Geometry {
Blob* fBlob;
int fRun;
@@ -140,13 +138,6 @@ private:
kLCDDistanceField_MaskType == fMaskType;
}
- template <bool regenTexCoords, bool regenPos, bool regenCol, bool regenGlyphs>
- inline void regenBlob(Target* target, FlushInfo* flushInfo, Blob* blob, Run* run,
- TextInfo* info, SkGlyphCache** cache,
- SkTypeface** typeface, GrFontScaler** scaler, const SkDescriptor** desc,
- const GrGeometryProcessor* gp, int glyphCount, size_t vertexStride,
- GrColor color, SkScalar transX, SkScalar transY) const;
-
inline void flush(GrVertexBatch::Target* target, FlushInfo* flushInfo) const;
GrColor color() const { return fBatch.fColor; }
@@ -191,7 +182,37 @@ private:
SkAutoTUnref<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
SkColor fFilteredColor;
+ friend class GrBlobRegenHelper; // Needs to trigger flushes
+
typedef GrVertexBatch INHERITED;
};
+/*
+ * A simple helper class to abstract the interface GrAtlasTextBlob needs to regenerate itself.
+ * It'd be nicer if this was nested, but we need to forward declare it in GrAtlasTextBlob.h
+ */
+class GrBlobRegenHelper {
+public:
+ GrBlobRegenHelper(const GrAtlasTextBatch* batch,
+ GrVertexBatch::Target* target,
+ GrAtlasTextBatch::FlushInfo* flushInfo,
+ const GrGeometryProcessor* gp)
+ : fBatch(batch)
+ , fTarget(target)
+ , fFlushInfo(flushInfo)
+ , fGP(gp) {}
+
+ void flush();
+
+ void incGlyphCount(int glyphCount = 1) {
+ fFlushInfo->fGlyphsToFlush += glyphCount;
+ }
+
+private:
+ const GrAtlasTextBatch* fBatch;
+ GrVertexBatch::Target* fTarget;
+ GrAtlasTextBatch::FlushInfo* fFlushInfo;
+ const GrGeometryProcessor* fGP;
+};
+
#endif
« no previous file with comments | « src/gpu/GrBatchAtlas.h ('k') | src/gpu/batches/GrAtlasTextBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698