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

Side by Side Diff: src/gpu/GrStencilAndCoverTextContext.h

Issue 1381873003: Use SkTextBlob for nvpr color bitmap fallbacks (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_textrun
Patch Set: Fix msvc build 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrStencilAndCoverTextContext_DEFINED 8 #ifndef GrStencilAndCoverTextContext_DEFINED
9 #define GrStencilAndCoverTextContext_DEFINED 9 #define GrStencilAndCoverTextContext_DEFINED
10 10
(...skipping 27 matching lines...) Expand all
38 const SkMatrix& viewMatrix, 38 const SkMatrix& viewMatrix,
39 const char text[], size_t byteLength, 39 const char text[], size_t byteLength,
40 SkScalar x, SkScalar y, const SkIRect& regionClipBounds) ove rride; 40 SkScalar x, SkScalar y, const SkIRect& regionClipBounds) ove rride;
41 void onDrawPosText(GrDrawContext*, GrRenderTarget*, 41 void onDrawPosText(GrDrawContext*, GrRenderTarget*,
42 const GrClip&, const GrPaint&, const SkPaint&, 42 const GrClip&, const GrPaint&, const SkPaint&,
43 const SkMatrix& viewMatrix, 43 const SkMatrix& viewMatrix,
44 const char text[], size_t byteLength, 44 const char text[], size_t byteLength,
45 const SkScalar pos[], int scalarsPerPosition, 45 const SkScalar pos[], int scalarsPerPosition,
46 const SkPoint& offset, const SkIRect& regionClipBounds) o verride; 46 const SkPoint& offset, const SkIRect& regionClipBounds) o verride;
47 47
48 class FallbackBlobBuilder;
49
48 class TextRun { 50 class TextRun {
49 public: 51 public:
50 TextRun(const SkPaint& fontAndStroke); 52 TextRun(const SkPaint& fontAndStroke);
51 ~TextRun(); 53 ~TextRun();
52 54
53 void setText(const char text[], size_t byteLength, SkScalar x, SkScalar y, 55 void setText(const char text[], size_t byteLength, SkScalar x, SkScalar y,
54 GrContext*, const SkSurfaceProps*); 56 GrContext*, const SkSurfaceProps*);
55 57
56 void setPosText(const char text[], size_t byteLength, 58 void setPosText(const char text[], size_t byteLength,
57 const SkScalar pos[], int scalarsPerPosition, const SkPo int& offset, 59 const SkScalar pos[], int scalarsPerPosition, const SkPo int& offset,
58 GrContext*, const SkSurfaceProps*); 60 GrContext*, const SkSurfaceProps*);
59 61
60 void draw(GrDrawContext*, GrRenderTarget*, const GrClip&, const GrPaint& , const SkMatrix&, 62 void draw(GrDrawContext*, GrRenderTarget*, const GrClip&, const GrPaint& , const SkMatrix&,
61 const SkIRect& regionClipBounds, GrTextContext* fallbackTextCo ntext, 63 const SkIRect& regionClipBounds, GrTextContext* fallbackTextCo ntext,
62 const SkPaint& originalSkPaint) const; 64 const SkPaint& originalSkPaint) const;
63 65
64 private: 66 private:
65 GrPathRange* createGlyphs(GrContext*, SkGlyphCache*); 67 GrPathRange* createGlyphs(GrContext*, SkGlyphCache*);
66 68
67 void appendGlyph(const SkGlyph&, const SkPoint&); 69 void appendGlyph(const SkGlyph&, const SkPoint&, FallbackBlobBuilder*);
68 70
69 GrStrokeInfo fStroke; 71 GrStrokeInfo fStroke;
70 SkPaint fFont; 72 SkPaint fFont;
71 SkScalar fTextRatio; 73 SkScalar fTextRatio;
72 float fTextInverseRatio; 74 float fTextInverseRatio;
73 SkMatrix fLocalMatrix; 75 SkMatrix fLocalMatrix;
74 bool fUsingRawGlyphPaths; 76 bool fUsingRawGlyphPaths;
75 SkAutoTUnref<GrPathRangeDraw> fDraw; 77 SkAutoTUnref<GrPathRangeDraw> fDraw;
76 SkSTArray<32, uint16_t, true> fFallbackIndices; 78 SkAutoTUnref<const SkTextBlob> fFallbackTextBlob;
77 SkSTArray<32, SkPoint, true> fFallbackPositions;
78 }; 79 };
79 80
80 typedef GrTextContext INHERITED; 81 typedef GrTextContext INHERITED;
81 }; 82 };
82 83
83 #endif 84 #endif
OLDNEW
« 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