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

Unified Diff: src/gpu/GrAtlasTextContext.h

Issue 1128153005: Add unit tests to text context (Closed) Base URL: https://skia.googlesource.com/skia.git@randbatch9
Patch Set: windows warning Created 5 years, 7 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 | « no previous file | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.h
diff --git a/src/gpu/GrAtlasTextContext.h b/src/gpu/GrAtlasTextContext.h
index c6e1d2f0b2d16b7966c4f9b7a426f3ebb38aec0b..55597cfcccd13e52c7c65eb962c636ae70d4fae4 100644
--- a/src/gpu/GrAtlasTextContext.h
+++ b/src/gpu/GrAtlasTextContext.h
@@ -19,6 +19,11 @@
#include "SkTextBlob.h"
#include "SkTInternalLList.h"
+#ifdef GR_TEST_UTILS
+#include "GrBatchTest.h"
+#endif
+
+class BitmapTextBatch;
class GrPipelineBuilder;
class GrTextBlobCache;
@@ -265,6 +270,10 @@ private:
inline void flushRunAsPaths(const SkTextBlob::RunIterator&, const SkPaint&, SkDrawFilter*,
const SkMatrix& viewMatrix, const SkIRect& clipBounds, SkScalar x,
SkScalar y);
+ inline BitmapTextBatch* createBatch(BitmapTextBlob*, const PerSubRunInfo&,
+ int glyphCount, int run, int subRun,
+ GrColor, SkScalar transX, SkScalar transY,
+ const SkPaint&);
inline void flushRun(GrDrawTarget*, GrPipelineBuilder*, BitmapTextBlob*, int run, GrColor,
SkScalar transX, SkScalar transY, const SkPaint&);
inline void flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRenderTarget* rt,
@@ -332,6 +341,20 @@ private:
inline void initDistanceFieldPaint(BitmapTextBlob*, SkPaint*, SkScalar* textRatio,
const SkMatrix&);
+ // Test methods
+ // TODO this is really ugly. It'd be much nicer if positioning could be moved to batch
+ inline BitmapTextBlob* createDrawTextBlob(GrRenderTarget*, const GrClip&, const GrPaint&,
+ const SkPaint&, const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength,
+ SkScalar x, SkScalar y,
+ const SkIRect& regionClipBounds);
+ inline BitmapTextBlob* createDrawPosTextBlob(GrRenderTarget*, const GrClip&, const GrPaint&,
+ const SkPaint&, const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength,
+ const SkScalar pos[], int scalarsPerPosition,
+ const SkPoint& offset,
+ const SkIRect& regionClipBounds);
+
// Distance field text needs this table to compute a value for use in the fragment shader.
// Because the GrAtlasTextContext can go out of scope before the final flush, this needs to be
// refcnted and malloced
@@ -360,6 +383,10 @@ private:
friend class GrTextBlobCache;
friend class BitmapTextBatch;
+#ifdef GR_TEST_UTILS
+ BATCH_TEST_FRIEND(TextBlob);
+#endif
+
typedef GrTextContext INHERITED;
};
« no previous file with comments | « no previous file | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698