mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:17:45 +00:00
LibGfx: Inline some AffineTransform functions
Asking if an AffineTransform is identity or translate-only can be done inline and avoid the cost of a function call in tight loops.
This commit is contained in:
parent
2dacd1252c
commit
e46deec846
2 changed files with 9 additions and 12 deletions
|
@ -25,8 +25,15 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
bool is_identity() const;
|
||||
bool is_identity_or_translation() const;
|
||||
[[nodiscard]] bool is_identity() const
|
||||
{
|
||||
return m_values[0] == 1 && m_values[1] == 0 && m_values[2] == 0 && m_values[3] == 1 && m_values[4] == 0 && m_values[5] == 0;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool is_identity_or_translation() const
|
||||
{
|
||||
return m_values[0] == 1 && m_values[1] == 0 && m_values[2] == 0 && m_values[3] == 1;
|
||||
}
|
||||
|
||||
void map(float unmapped_x, float unmapped_y, float& mapped_x, float& mapped_y) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue