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

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') | 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 4c833b20ff74aa12c6a14b57c37e4eb071e44dfa..d294126799815284d35e135455263b6d440ccb78 100644
--- a/src/gpu/GrAtlasTextContext.h
+++ b/src/gpu/GrAtlasTextContext.h
@@ -235,13 +235,22 @@ private:
mutable SkScalar fTotalXError;
mutable SkScalar fTotalYError;
#endif
+ SkColor fPaintColor;
SkScalar fX;
SkScalar fY;
- SkColor fPaintColor;
+
+ // We can reuse distance field text, but only if the new viewmatrix would not result in
+ // 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;
uint8_t fTextType;
- BitmapTextBlob() : fTextType(0) {}
+ BitmapTextBlob()
+ : fMaxMinScale(SK_ScalarMax)
+ , fMinMaxScale(SK_ScalarMax)
+ , fTextType(0) {}
static const Key& GetKey(const BitmapTextBlob& blob) {
return blob.fKey;
@@ -357,7 +366,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698