Flutter Engine
 
Loading...
Searching...
No Matches
rstransform.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
8
9namespace impeller {
10
12 return scaled_cos == 0.0f || scaled_sin == 0.0f;
13}
14
16 // clang-format off
19 0.0f, 0.0f, 1.0f, 0.0f,
20 0.0f, 0.0f, 0.0f, 1.0f);
21 // clang-format on
22}
23
25 Point origin = {translate_x, translate_y};
28 quad = {
29 // Ordered in the same Z pattern as Rect::GetPoints()
30 origin,
31 origin + dx,
32 origin + dy,
33 origin + dx + dy,
34 };
35}
36
38 Quad quad;
39 GetQuad(width, height, quad);
40 return quad;
41}
42
44 Quad quad;
45 GetQuad(size.width, size.height, quad);
46 return quad;
47}
48
52
53std::optional<Rect> RSTransform::GetBounds(Size size) const {
54 return Rect::MakePointBounds(GetQuad(size));
55}
56
57} // namespace impeller
float Scalar
Definition scalar.h:19
std::array< Point, 4 > Quad
Definition point.h:332
int32_t height
int32_t width
A 4x4 matrix using column-major storage.
Definition matrix.h:37
static constexpr Matrix MakeRow(Scalar m0, Scalar m1, Scalar m2, Scalar m3, Scalar m4, Scalar m5, Scalar m6, Scalar m7, Scalar m8, Scalar m9, Scalar m10, Scalar m11, Scalar m12, Scalar m13, Scalar m14, Scalar m15)
Definition matrix.h:83
std::optional< Rect > GetBounds(Scalar width, Scalar height) const
Matrix GetMatrix() const
void GetQuad(Scalar width, Scalar height, Quad &quad) const
bool IsAxisAligned() const
static constexpr std::optional< TRect > MakePointBounds(const U &value)
Definition rect.h:165