aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkMaskGamma.h
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2017-08-25 15:15:13 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-25 19:50:07 +0000
commit54ef7c057ac9cc8ff9cb18eba864686dd59c2d93 (patch)
tree1e8e4bb556f0a01e13820d8648b1ecfe0c5a00ce /src/core/SkMaskGamma.h
parent9b0b32fda4871776eb9afdf9553e523e5c28aa63 (diff)
Don't use uninitialized gamma data for adjusting SDF distance.
If the gamma is linear, the corresponding LUT for adjusting colors is not initialized. This change takes that into account when computing distance adjustments for SDF text. Change-Id: I7ca1410bb27cf29ef08ccd666297bf5c3cd3dcdd Reviewed-on: https://skia-review.googlesource.com/38940 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/core/SkMaskGamma.h')
-rw-r--r--src/core/SkMaskGamma.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkMaskGamma.h b/src/core/SkMaskGamma.h
index f90f75a878..3142534152 100644
--- a/src/core/SkMaskGamma.h
+++ b/src/core/SkMaskGamma.h
@@ -146,10 +146,11 @@ public:
/**
* Provides direct access to the full table set, so it can be uploaded
- * into a texture.
+ * into a texture or analyzed in other ways.
+ * Returns nullptr if fGammaTables hasn't been initialized.
*/
const uint8_t* getGammaTables() const {
- return (const uint8_t*) fGammaTables;
+ return fIsLinear ? nullptr : (const uint8_t*) fGammaTables;
}
private: