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

Unified Diff: src/gpu/text/GrDistanceFieldAdjustTable.h

Issue 1885613002: sRGB support for distance field text. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Break long line Created 4 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/text/GrDistanceFieldAdjustTable.h
diff --git a/src/gpu/text/GrDistanceFieldAdjustTable.h b/src/gpu/text/GrDistanceFieldAdjustTable.h
index f7d8bee0897a4fc37d602e9f7cefbacd125f0b23..f9b5161e95a7b3739d8aa7ae9161b592631820ea 100644
--- a/src/gpu/text/GrDistanceFieldAdjustTable.h
+++ b/src/gpu/text/GrDistanceFieldAdjustTable.h
@@ -15,17 +15,21 @@
// Because the GrAtlasTextContext can go out of scope before the final flush, this needs to be
// refcnted and malloced
struct GrDistanceFieldAdjustTable : public SkNVRefCnt<GrDistanceFieldAdjustTable> {
- GrDistanceFieldAdjustTable() { this->buildDistanceAdjustTable(); }
- ~GrDistanceFieldAdjustTable() { delete[] fTable; }
+ GrDistanceFieldAdjustTable() { this->buildDistanceAdjustTables(); }
+ ~GrDistanceFieldAdjustTable() {
+ delete[] fTable;
+ delete[] fSRGBTable;
+ }
- const SkScalar& operator[] (int i) const {
- return fTable[i];
+ const SkScalar& getAdjustment(int i, bool useSRGBTable) const {
+ return useSRGBTable ? fSRGBTable[i] : fTable[i];
}
private:
- void buildDistanceAdjustTable();
+ void buildDistanceAdjustTables();
SkScalar* fTable;
+ SkScalar* fSRGBTable;
};
#endif

Powered by Google App Engine
This is Rietveld 408576698