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

Unified Diff: src/gpu/GrAtlasTextContext.h

Issue 1098653005: A small patch to enable distance field text in textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@atdfnow2
Patch Set: windows warnings Created 5 years, 8 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 cf2ba6bcc2cb947152e7a31fa2b075275fbf2a41..ec39ef5023edc94712f311219466f709c30f460d 100644
--- a/src/gpu/GrAtlasTextContext.h
+++ b/src/gpu/GrAtlasTextContext.h
@@ -210,6 +210,14 @@ private:
StrokeInfo fStrokeInfo;
GrMemoryPool* fPool;
+ enum TextType {
+ kHasDistanceField_TextType = 0x1,
+ kHasBitmap_TextType = 0x2,
+ };
+ uint8_t fTextType;
+
+ BitmapTextBlob() : fTextType(0) {}
+
// all glyph / vertex offsets are into these pools.
unsigned char* fVertices;
GrGlyph::PackedID* fGlyphIDs;
@@ -255,6 +263,11 @@ private:
void operator delete(void* target, void* placement) {
::operator delete(target, placement);
}
+
+ bool hasDistanceField() const { return SkToBool(fTextType & kHasDistanceField_TextType); }
+ bool hasBitmap() const { return SkToBool(fTextType & kHasBitmap_TextType); }
+ void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; }
+ void setHasBitmap() { fTextType |= kHasBitmap_TextType; }
};
typedef BitmapTextBlob::Run Run;
@@ -293,7 +306,8 @@ private:
const GrPaint&, const GrClip&);
// A helper for drawing BitmapText in a run of distance fields
- inline void fallbackDrawPosText(BitmapTextBlob*, GrRenderTarget*, const GrClip&,
+ inline void fallbackDrawPosText(BitmapTextBlob*, int runIndex,
+ GrRenderTarget*, const GrClip&,
const GrPaint&,
const SkPaint&, const SkMatrix& viewMatrix,
const SkTDArray<char>& fallbackTxt,
@@ -339,7 +353,8 @@ private:
void regenerateTextBlob(BitmapTextBlob* bmp, const SkPaint& skPaint, GrColor,
const SkMatrix& viewMatrix,
const SkTextBlob* blob, SkScalar x, SkScalar y,
- SkDrawFilter* drawFilter, const SkIRect& clipRect);
+ SkDrawFilter* drawFilter, const SkIRect& clipRect, GrRenderTarget*,
+ const GrClip&, const GrPaint&);
inline static bool HasLCD(const SkTextBlob*);
inline void initDistanceFieldPaint(SkPaint*, SkScalar* textRatio, const SkMatrix&);
« 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