From 382caaecdfb90ee9c042e9989c0b4c9a21e072cf Mon Sep 17 00:00:00 2001 From: Herb Derby Date: Mon, 7 May 2018 13:43:54 -0400 Subject: 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 Reviewed-by: Mike Klein --- src/core/SkScalerContext.h | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit v1.2.3