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

Unified Diff: src/gpu/GrStencilAndCoverTextContext.h

Issue 1375353004: Add TextRun object to nvpr text (Closed) Base URL: https://skia.googlesource.com/skia.git@upload1_simplify
Patch Set: Created 5 years, 3 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/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilAndCoverTextContext.h
diff --git a/src/gpu/GrStencilAndCoverTextContext.h b/src/gpu/GrStencilAndCoverTextContext.h
index 44b33a593dc95f1ce3f09f54aab0f0fa5149d24e..c5c29ad86f6f20a9eceb588015f1364888127786 100644
--- a/src/gpu/GrStencilAndCoverTextContext.h
+++ b/src/gpu/GrStencilAndCoverTextContext.h
@@ -15,7 +15,6 @@
class GrTextStrike;
class GrPath;
class GrPathRange;
-class GrPathRangeDraw;
class SkSurfaceProps;
/*
@@ -30,25 +29,6 @@ public:
virtual ~GrStencilAndCoverTextContext();
private:
- SkScalar fTextRatio;
- float fTextInverseRatio;
- SkGlyphCache* fGlyphCache;
-
- GrPathRange* fGlyphs;
- GrPathRangeDraw* fDraw;
- GrStrokeInfo fStroke;
- SkSTArray<32, uint16_t, true> fFallbackIndices;
- SkSTArray<32, SkPoint, true> fFallbackPositions;
-
- SkMatrix fViewMatrix;
- SkMatrix fLocalMatrix;
- SkAutoTUnref<GrRenderTarget> fRenderTarget;
- GrClip fClip;
- SkIRect fClipRect;
- SkIRect fRegionClipBounds;
- GrPaint fPaint;
- SkPaint fSkPaint;
-
GrStencilAndCoverTextContext(GrContext*, const SkSurfaceProps&);
bool canDraw(const GrRenderTarget*, const GrClip&, const GrPaint&,
@@ -65,11 +45,37 @@ private:
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset, const SkIRect& regionClipBounds) override;
- void init(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint&, size_t textByteLength,
- const SkMatrix& viewMatrix, const SkIRect& regionClipBounds);
- void appendGlyph(const SkGlyph&, const SkPoint&);
- void flush(GrDrawContext* dc);
- void finish(GrDrawContext* dc);
+ class TextRun {
+ public:
+ TextRun(const SkPaint& fontAndStroke);
+ ~TextRun();
+
+ void setText(const char text[], size_t byteLength, SkScalar x, SkScalar y,
+ GrContext*, const SkSurfaceProps*);
+
+ void setPosText(const char text[], size_t byteLength,
+ const SkScalar pos[], int scalarsPerPosition, const SkPoint& offset,
+ GrContext*, const SkSurfaceProps*);
+
+ void draw(GrDrawContext*, GrRenderTarget*, const GrClip&, const GrPaint&, const SkMatrix&,
+ const SkIRect& regionClipBounds, GrTextContext* fallbackTextContext,
+ const SkPaint& originalSkPaint) const;
+
+ private:
+ GrPathRange* createGlyphs(GrContext*, SkGlyphCache*);
+
+ void appendGlyph(const SkGlyph&, const SkPoint&);
+
+ GrStrokeInfo fStroke;
+ SkPaint fFont;
+ SkScalar fTextRatio;
+ float fTextInverseRatio;
+ SkMatrix fLocalMatrix;
+ bool fUsingRawGlyphPaths;
+ SkAutoTUnref<GrPathRangeDraw> fDraw;
+ SkSTArray<32, uint16_t, true> fFallbackIndices;
+ SkSTArray<32, SkPoint, true> fFallbackPositions;
+ };
typedef GrTextContext INHERITED;
};
« no previous file with comments | « no previous file | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698