/* * Copyright 2006 The Android Open Source Project * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkMatrix_DEFINED #define SkMatrix_DEFINED #include "include/core/SkPoint.h" #include "include/core/SkRect.h" #include "include/core/SkScalar.h" #include "include/core/SkTypes.h" #include "include/private/base/SkFloatingPoint.h" #include "include/private/base/SkMacros.h" #include "include/private/base/SkTo.h" #include <cstdint> #include <cstring> struct SkPoint3; struct SkRSXform; struct SkSize; // Remove when clients are updated to live without this #define SK_SUPPORT_LEGACY_MATRIX_RECTTORECT /** * When we transform points through a matrix containing perspective (the bottom row is something * other than 0,0,1), the bruteforce math can produce confusing results (since we might divide * by 0, or a negative w value). By default, methods that map rects and paths will apply * perspective clipping, but this can be changed by specifying kYes to those methods. */ enum class SkApplyPerspectiveClip { … }; /** \class SkMatrix SkMatrix holds a 3x3 matrix for transforming coordinates. This allows mapping SkPoint and vectors with translation, scaling, skewing, rotation, and perspective. SkMatrix elements are in row major order. SkMatrix constexpr default constructs to identity. SkMatrix includes a hidden variable that classifies the type of matrix to improve performance. SkMatrix is not thread safe unless getType() is called first. example: https://fiddle.skia.org/c/@Matrix_063 */ SK_BEGIN_REQUIRE_DENSE class SK_API SkMatrix { … }; SK_END_REQUIRE_DENSE #endif