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/text/GrTextUtils.h

Issue 1521633002: Move distance field text positioning into GrTextUtils (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanuptext15
Patch Set: tweaks Created 4 years, 11 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/text/GrAtlasTextContext.cpp ('k') | src/gpu/text/GrTextUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/text/GrTextUtils.h
diff --git a/src/gpu/text/GrTextUtils.h b/src/gpu/text/GrTextUtils.h
index 0996f655a37a316d58fc741dba7bbd71d94e57e2..d6b7e94ea2381ccd7580a43fa042ac801ecc0012 100644
--- a/src/gpu/text/GrTextUtils.h
+++ b/src/gpu/text/GrTextUtils.h
@@ -18,6 +18,7 @@ class GrClip;
class GrContext;
class GrDrawContext;
class GrFontScaler;
+class GrShaderCaps;
class SkGlyph;
class SkMatrix;
struct SkIRect;
@@ -48,6 +49,24 @@ public:
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset);
+ // functions for appending distance field text
+ static bool CanDrawAsDistanceFields(const SkPaint& skPaint, const SkMatrix& viewMatrix,
+ const SkSurfaceProps& props, const GrShaderCaps& caps);
+
+ static void DrawDFText(GrAtlasTextBlob* blob, int runIndex,
+ GrBatchFontCache*, const SkSurfaceProps&,
+ const SkPaint& skPaint, GrColor color,
+ const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength,
+ SkScalar x, SkScalar y);
+
+ static void DrawDFPosText(GrAtlasTextBlob* blob, int runIndex,
+ GrBatchFontCache*, const SkSurfaceProps&, const SkPaint&,
+ GrColor color, const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength,
+ const SkScalar pos[], int scalarsPerPosition,
+ const SkPoint& offset);
+
// Functions for drawing text as paths
static void DrawTextAsPath(GrContext*, GrDrawContext*, const GrClip& clip,
const SkPaint& origPaint, const SkMatrix& viewMatrix,
@@ -63,9 +82,20 @@ public:
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset, const SkIRect& clipBounds);
private:
+ static void InitDistanceFieldPaint(GrAtlasTextBlob* blob,
+ SkPaint* skPaint,
+ SkScalar* textRatio,
+ const SkMatrix& viewMatrix);
+
static void BmpAppendGlyph(GrAtlasTextBlob*, int runIndex, GrBatchFontCache*,
GrBatchTextStrike**, const SkGlyph&, int left, int top,
GrColor color, GrFontScaler*);
+
+ static bool DfAppendGlyph(GrAtlasTextBlob*, int runIndex, GrBatchFontCache*,
+ GrBatchTextStrike**, const SkGlyph&,
+ SkScalar sx, SkScalar sy, GrColor color,
+ GrFontScaler* scaler,
+ SkScalar textRatio, const SkMatrix& viewMatrix);
};
#endif
« no previous file with comments | « src/gpu/text/GrAtlasTextContext.cpp ('k') | src/gpu/text/GrTextUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698