diff --git a/include/private/SkTLogic.h b/include/private/SkTLogic.h index 542cb99dbc..8cf8c284f1 100644 --- a/include/private/SkTLogic.h +++ b/include/private/SkTLogic.h @@ -41,9 +41,6 @@ template using result_of_t = typename std::result_of::type; template using common_type_t = typename std::common_type::type; -template using aligned_union_t - = typename std::aligned_union::type; - template struct index_sequence { using type = index_sequence; using value_type = std::size_t; diff --git a/src/gpu/text/GrTextBlob.cpp b/src/gpu/text/GrTextBlob.cpp index 6db65fc6f5..793c848c08 100644 --- a/src/gpu/text/GrTextBlob.cpp +++ b/src/gpu/text/GrTextBlob.cpp @@ -223,9 +223,11 @@ sk_sp GrTextBlob::Make(int glyphCount, GrColor color, bool forceWForDistanceFields) { - size_t vertexSize = sizeof(skstd::aligned_union_t<0, Mask2DVertex, ARGB2DVertex>); + static_assert(sizeof(ARGB2DVertex) <= sizeof(Mask2DVertex)); + size_t vertexSize = sizeof(Mask2DVertex); if (viewMatrix.hasPerspective() || forceWForDistanceFields) { - vertexSize = sizeof(skstd::aligned_union_t<0, SDFT3DVertex, ARGB3DVertex>); + static_assert(sizeof(ARGB3DVertex) <= sizeof(SDFT3DVertex)); + vertexSize = sizeof(SDFT3DVertex); } size_t quadSize = kVerticesPerGlyph * vertexSize;