| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrAtlasTextContext_DEFINED | 8 #ifndef GrAtlasTextContext_DEFINED |
| 9 #define GrAtlasTextContext_DEFINED | 9 #define GrAtlasTextContext_DEFINED |
| 10 | 10 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 SkRect fVertexBounds; | 145 SkRect fVertexBounds; |
| 146 SkSTArray<kMinSubRuns, SubRunInfo> fSubRunInfo; | 146 SkSTArray<kMinSubRuns, SubRunInfo> fSubRunInfo; |
| 147 SkAutoDescriptor fDescriptor; | 147 SkAutoDescriptor fDescriptor; |
| 148 SkAutoTDelete<SkAutoDescriptor> fOverrideDescriptor; // df propertie
s | 148 SkAutoTDelete<SkAutoDescriptor> fOverrideDescriptor; // df propertie
s |
| 149 GrColor fColor; | 149 GrColor fColor; |
| 150 bool fInitialized; | 150 bool fInitialized; |
| 151 bool fDrawAsPaths; | 151 bool fDrawAsPaths; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 struct BigGlyph { | 154 struct BigGlyph { |
| 155 BigGlyph(const SkPath& path, int vx, int vy) : fPath(path), fVx(vx),
fVy(vy) {} | 155 BigGlyph(const SkPath& path, SkScalar vx, SkScalar vy) |
| 156 : fPath(path) |
| 157 , fVx(vx) |
| 158 , fVy(vy) {} |
| 156 SkPath fPath; | 159 SkPath fPath; |
| 157 int fVx; | 160 SkScalar fVx; |
| 158 int fVy; | 161 SkScalar fVy; |
| 159 }; | 162 }; |
| 160 | 163 |
| 161 struct Key { | 164 struct Key { |
| 162 Key() { | 165 Key() { |
| 163 sk_bzero(this, sizeof(Key)); | 166 sk_bzero(this, sizeof(Key)); |
| 164 } | 167 } |
| 165 uint32_t fUniqueID; | 168 uint32_t fUniqueID; |
| 166 // Color may affect the gamma of the mask we generate, but in a fair
ly limited way. | 169 // Color may affect the gamma of the mask we generate, but in a fair
ly limited way. |
| 167 // Each color is assigned to on of a fixed number of buckets based o
n its | 170 // Each color is assigned to on of a fixed number of buckets based o
n its |
| 168 // luminance. For each luminance bucket there is a "canonical color"
that | 171 // luminance. For each luminance bucket there is a "canonical color"
that |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 inline bool canDrawAsDistanceFields(const SkPaint&, const SkMatrix& viewMatr
ix); | 258 inline bool canDrawAsDistanceFields(const SkPaint&, const SkMatrix& viewMatr
ix); |
| 256 BitmapTextBlob* setupDFBlob(int glyphCount, const SkPaint& origPaint, | 259 BitmapTextBlob* setupDFBlob(int glyphCount, const SkPaint& origPaint, |
| 257 const SkMatrix& viewMatrix, SkGlyphCache** cache
, | 260 const SkMatrix& viewMatrix, SkGlyphCache** cache
, |
| 258 SkPaint* dfPaint, SkScalar* textRatio); | 261 SkPaint* dfPaint, SkScalar* textRatio); |
| 259 void bmpAppendGlyph(BitmapTextBlob*, int runIndex, GrGlyph::PackedID, int le
ft, int top, | 262 void bmpAppendGlyph(BitmapTextBlob*, int runIndex, GrGlyph::PackedID, int le
ft, int top, |
| 260 GrColor color, GrFontScaler*, const SkIRect& clipRect); | 263 GrColor color, GrFontScaler*, const SkIRect& clipRect); |
| 261 bool dfAppendGlyph(BitmapTextBlob*, int runIndex, GrGlyph::PackedID, SkScala
r sx, SkScalar sy, | 264 bool dfAppendGlyph(BitmapTextBlob*, int runIndex, GrGlyph::PackedID, SkScala
r sx, SkScalar sy, |
| 262 GrColor color, GrFontScaler*, const SkIRect& clipRect, Sk
Scalar textRatio, | 265 GrColor color, GrFontScaler*, const SkIRect& clipRect, Sk
Scalar textRatio, |
| 263 const SkMatrix& viewMatrix); | 266 const SkMatrix& viewMatrix); |
| 264 inline void appendGlyphPath(BitmapTextBlob* blob, GrGlyph* glyph, | 267 inline void appendGlyphPath(BitmapTextBlob* blob, GrGlyph* glyph, |
| 265 GrFontScaler* scaler, int x, int y); | 268 GrFontScaler* scaler, SkScalar x, SkScalar y); |
| 266 inline void appendGlyphCommon(BitmapTextBlob*, Run*, Run::SubRunInfo*, | 269 inline void appendGlyphCommon(BitmapTextBlob*, Run*, Run::SubRunInfo*, |
| 267 const SkRect& positions, GrColor color, | 270 const SkRect& positions, GrColor color, |
| 268 size_t vertexStride, bool useVertexColor, | 271 size_t vertexStride, bool useVertexColor, |
| 269 GrGlyph*); | 272 GrGlyph*); |
| 270 | 273 |
| 271 inline void flushRunAsPaths(const SkTextBlob::RunIterator&, const SkPaint&,
SkDrawFilter*, | 274 inline void flushRunAsPaths(const SkTextBlob::RunIterator&, const SkPaint&,
SkDrawFilter*, |
| 272 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, | 275 const SkMatrix& viewMatrix, const SkIRect& clipB
ounds, SkScalar x, |
| 273 SkScalar y); | 276 SkScalar y); |
| 274 inline BitmapTextBatch* createBatch(BitmapTextBlob*, const PerSubRunInfo&, | 277 inline BitmapTextBatch* createBatch(BitmapTextBlob*, const PerSubRunInfo&, |
| 275 int glyphCount, int run, int subRun, | 278 int glyphCount, int run, int subRun, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 friend class BitmapTextBatch; | 388 friend class BitmapTextBatch; |
| 386 | 389 |
| 387 #ifdef GR_TEST_UTILS | 390 #ifdef GR_TEST_UTILS |
| 388 BATCH_TEST_FRIEND(TextBlob); | 391 BATCH_TEST_FRIEND(TextBlob); |
| 389 #endif | 392 #endif |
| 390 | 393 |
| 391 typedef GrTextContext INHERITED; | 394 typedef GrTextContext INHERITED; |
| 392 }; | 395 }; |
| 393 | 396 |
| 394 #endif | 397 #endif |
| OLD | NEW |