aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/text/GrTextUtils.h
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-04-07 06:25:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-07 06:25:45 -0700
commit32f7782706fbf692c613457a74d080e18e27b15a (patch)
tree82809ba263a6dc89982e467dfb9ecc72de861bb4 /src/gpu/text/GrTextUtils.h
parent044d3c185876f9960f07b88f068cf08d78311e33 (diff)
sRGB text fake-gamma progress:
Determine if we should use fake-gamma based on the render target format and paint parameters (ie will gamma-correct blending happen?). Plumb that down to the appropriate places in the bitmap text rendering for now. Still need to alter the behavior of the DF text renderer (using the same cue, most likely?). Also, this still doesn't account for the contrast hack. The end result of this change is a pleasant normalizing of weight when viewing text in the gpusrgb config. (Dark text gets heavier, light text gets lighter). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1865953003 Review URL: https://codereview.chromium.org/1865953003
Diffstat (limited to 'src/gpu/text/GrTextUtils.h')
-rw-r--r--src/gpu/text/GrTextUtils.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gpu/text/GrTextUtils.h b/src/gpu/text/GrTextUtils.h
index 096434b69f..52b3ab4c54 100644
--- a/src/gpu/text/GrTextUtils.h
+++ b/src/gpu/text/GrTextUtils.h
@@ -9,6 +9,7 @@
#define GrTextUtils_DEFINED
#include "GrColor.h"
+#include "SkPaint.h"
#include "SkScalar.h"
class GrAtlasTextBlob;
@@ -22,7 +23,6 @@ class GrShaderCaps;
class SkGlyph;
class SkMatrix;
struct SkIRect;
-class SkPaint;
struct SkPoint;
class SkGlyphCache;
class SkSurfaceProps;
@@ -38,13 +38,13 @@ public:
static void DrawBmpText(GrAtlasTextBlob*, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&,
const SkPaint&,
- GrColor, const SkMatrix& viewMatrix,
+ GrColor, SkPaint::FakeGamma, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y);
static void DrawBmpPosText(GrAtlasTextBlob*, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&, const SkPaint&,
- GrColor, const SkMatrix& viewMatrix,
+ GrColor, SkPaint::FakeGamma, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset);
@@ -55,14 +55,14 @@ public:
static void DrawDFText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&,
- const SkPaint& skPaint, GrColor color,
+ const SkPaint& skPaint, GrColor color, SkPaint::FakeGamma,
const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
SkScalar x, SkScalar y);
static void DrawDFPosText(GrAtlasTextBlob* blob, int runIndex,
GrBatchFontCache*, const SkSurfaceProps&, const SkPaint&,
- GrColor color, const SkMatrix& viewMatrix,
+ GrColor color, SkPaint::FakeGamma, const SkMatrix& viewMatrix,
const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset);