diff options
author | Herb Derby <herb@google.com> | 2018-05-07 13:43:54 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-07 18:37:30 +0000 |
commit | 382caaecdfb90ee9c042e9989c0b4c9a21e072cf (patch) | |
tree | e0301f0c9ec5595f0e0c710dc847add97e8a26fd /src | |
parent | a3fde20002ea37e13363fd9ee13f3b10956bbedf (diff) |
Make sure the ScalerContextRec is dense
Make sure that the Rec structure is dense because
the SkDescriptor code takes checksums of this
structure.
Change-Id: Id384ed49e17f4613647da538c810f09a066efd90
Reviewed-on: https://skia-review.googlesource.com/126503
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkScalerContext.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/SkScalerContext.h b/src/core/SkScalerContext.h index 556ec18c67..4a799f90dd 100644 --- a/src/core/SkScalerContext.h +++ b/src/core/SkScalerContext.h @@ -54,7 +54,11 @@ enum SkAxisAlignment { /* * To allow this to be forward-declared, it must be its own typename, rather * than a nested struct inside SkScalerContext (where it started). + * + * SkScalerContextRec must be dense, and all bytes must be set to a know quantity because this + * structure is used to calculate a checksum. */ +SK_BEGIN_REQUIRE_DENSE struct SkScalerContextRec { uint32_t fFontID; SkScalar fTextSize, fPreScaleX, fPreSkewX; @@ -212,6 +216,7 @@ private: fLumBits = c; } }; +SK_END_REQUIRE_DENSE //The following typedef hides from the rest of the implementation the number of //most significant bits to consider when creating mask gamma tables. Two bits |