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

Unified Diff: src/gpu/GrAtlasTextContext.h

Issue 1076593002: Start canonicalizing color for all A8 textblobs (Closed) Base URL: https://skia.googlesource.com/skia.git@atcachemasks
Patch Set: adding gm 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
Index: src/gpu/GrAtlasTextContext.h
diff --git a/src/gpu/GrAtlasTextContext.h b/src/gpu/GrAtlasTextContext.h
index c999e1f0afb34642eea402b2f8864c6f790e4957..4157e24bdf0a35f2c71bcc8f1244dcdd0993b874 100644
--- a/src/gpu/GrAtlasTextContext.h
+++ b/src/gpu/GrAtlasTextContext.h
@@ -127,8 +127,8 @@ private:
mutable SkScalar fTotalXError;
mutable SkScalar fTotalYError;
#endif
+ SkColor fPaintColor;
SkTArray<BigGlyph> fBigGlyphs;
- GrColor fColor; // the original color on the paint
SkMatrix fViewMatrix;
SkScalar fX;
SkScalar fY;
@@ -154,6 +154,10 @@ private:
uint32_t fUniqueID;
SkPaint::Style fStyle;
bool fHasBlur;
reed1 2015/04/13 17:05:51 I know there is a memset(0) at the beginning (btw
+ // Color may affect the gamma of the mask we generate, but in a fairly limited way.
+ // There are a certain number of buckets, and within those buckets we can reassign the
bsalomon 2015/04/13 15:16:38 Replace second sentence with Each color is assign
+ // color as desired. This functionality is currently only supported for A8
+ SkColor fCanonicalColor;
bool operator==(const Key& other) const {
return 0 == memcmp(this, &other, sizeof(Key));
@@ -207,23 +211,27 @@ private:
const GrPaint&, const GrClip&, const SkMatrix& viewMatrix);
void internalDrawText(BitmapTextBlob*, int runIndex, SkGlyphCache*, const SkPaint&,
- const SkMatrix& viewMatrix, const char text[], size_t byteLength,
+ GrColor color, const SkMatrix& viewMatrix,
+ const char text[], size_t byteLength,
SkScalar x, SkScalar y, const SkIRect& clipRect);
void internalDrawPosText(BitmapTextBlob*, int runIndex, SkGlyphCache*, const SkPaint&,
- const SkMatrix& viewMatrix,
+ GrColor color, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset, const SkIRect& clipRect);
// sets up the descriptor on the blob and returns a detached cache. Client must attach
+ inline static GrColor ComputeCanonicalColor(const SkPaint&, bool lcd);
inline SkGlyphCache* setupCache(Run*, const SkPaint&, const SkMatrix& viewMatrix);
static inline bool MustRegenerateBlob(SkScalar* outTransX, SkScalar* outTransY,
const BitmapTextBlob&, const SkPaint&,
const SkMaskFilter::BlurRec&,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y);
- void regenerateTextBlob(BitmapTextBlob* bmp, const SkPaint& skPaint, const SkMatrix& viewMatrix,
+ void regenerateTextBlob(BitmapTextBlob* bmp, const SkPaint& skPaint, GrColor,
+ const SkMatrix& viewMatrix,
const SkTextBlob* blob, SkScalar x, SkScalar y,
SkDrawFilter* drawFilter, const SkIRect& clipRect);
+ inline static bool HasLCD(const SkTextBlob*);
GrBatchTextStrike* fCurrStrike;
GrTextBlobCache* fCache;

Powered by Google App Engine
This is Rietveld 408576698