/* * Copyright 2019 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkSGTransformPriv_DEFINED #define SkSGTransformPriv_DEFINED #include "SkSGTransform.h" namespace sksg { // Helper for accessing implementation-private Transform methods. class TransformPriv final { public: static bool Is44(const sk_sp&t) { return t->is44(); } template ::value || std::is_same::value >> static T As(const sk_sp&); private: TransformPriv() = delete; }; template <> inline SkMatrix TransformPriv::As(const sk_sp& t) { return t->asMatrix(); } template <> inline SkMatrix44 TransformPriv::As(const sk_sp& t) { return t->asMatrix44(); } } // namespace sksg #endif // SkSGTransformPriv_DEFINED