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

Unified Diff: src/gpu/GrAtlasTextContext.h

Issue 1092283002: Add support for rotating / scaling / translating gpu cached distance field textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@atdfopt3
Patch Set: adding comment 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') | src/gpu/GrAtlasTextContext.cpp » ('J')
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 567bf1ca42833ce824855b511320246142be6aa4..104085d7482cd19b44ba1d9c0f99c96c26b6bd72 100644
--- a/src/gpu/GrAtlasTextContext.h
+++ b/src/gpu/GrAtlasTextContext.h
@@ -230,14 +230,24 @@ private:
mutable SkScalar fTotalXError;
mutable SkScalar fTotalYError;
#endif
+ SkColor fPaintColor;
SkScalar fX;
SkScalar fY;
- SkColor fPaintColor;
+
+ // We can regenerate distance field text, but only if the new viewmatrix would not result in
jvanverth1 2015/04/21 15:29:47 s/regenerate/reuse/ ?
+ // a mip change. Because there can be multiple runs in a blob, we track the overall
+ // maximum minimum scale, and minimum maximum scale, we can support before we need to regen
+ SkScalar fMaxMinScale;
+ SkScalar fMinMaxScale;
int fRunCount;
bool fHasDistanceField;
bool fHasBitmap;
- BitmapTextBlob() : fHasDistanceField(false), fHasBitmap(false) {}
+ BitmapTextBlob()
+ : fMaxMinScale(SK_ScalarMax)
+ , fMinMaxScale(SK_ScalarMax)
+ , fHasDistanceField(false)
+ , fHasBitmap(false) {}
static const Key& GetKey(const BitmapTextBlob& blob) {
return blob.fKey;
@@ -348,7 +358,8 @@ private:
SkDrawFilter* drawFilter, const SkIRect& clipRect, GrRenderTarget*,
const GrClip&, const GrPaint&);
inline static bool HasLCD(const SkTextBlob*);
- inline void initDistanceFieldPaint(SkPaint*, SkScalar* textRatio, const SkMatrix&);
+ inline void initDistanceFieldPaint(BitmapTextBlob*, SkPaint*, SkScalar* textRatio,
+ const SkMatrix&);
// Distance field text needs this table to compute a value for use in the fragment shader.
// Because the GrAtlasTextContext can go out of scope before the final flush, this needs to be
« no previous file with comments | « no previous file | src/gpu/GrAtlasTextContext.cpp » ('j') | src/gpu/GrAtlasTextContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698