summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_coordinates.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-15 22:21:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-15 22:21:16 +0000
commit3e360453cded5f2f435195923ede0935f6847194 (patch)
tree3859e6c723af6fd87f4a9afb420bc9706365d7f8 /core/fxcrt/fx_coordinates.h
parentb6e3d231ef2c28df1e5149cb16ad7046ebb0714e (diff)
downloadpdfium-3e360453cded5f2f435195923ede0935f6847194.tar.xz
Remove optional prepend argument from matrix transformations.
Callers always want one form or the other, so split into separate methods. This may save some branching. Remove forms that are not used. Put more helpful helper function in .cpp file. Change-Id: I4e025de7f69ce3f323cd290a5dc8202dd4f8ca07 Reviewed-on: https://pdfium-review.googlesource.com/40270 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_coordinates.h')
-rw-r--r--core/fxcrt/fx_coordinates.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/core/fxcrt/fx_coordinates.h b/core/fxcrt/fx_coordinates.h
index 0b98ff2e43..f84c5ee220 100644
--- a/core/fxcrt/fx_coordinates.h
+++ b/core/fxcrt/fx_coordinates.h
@@ -592,8 +592,10 @@ class CFX_Matrix {
CFX_Matrix GetInverse() const;
- void Concat(const CFX_Matrix& m, bool bPrepended = false);
- void ConcatInverse(const CFX_Matrix& m, bool bPrepended = false);
+ void Concat(const CFX_Matrix& right);
+ void ConcatPrepend(const CFX_Matrix& left);
+ void ConcatInverse(const CFX_Matrix& m);
+ void ConcatInversePrepend(const CFX_Matrix& m);
bool IsIdentity() const {
return a == 1 && b == 0 && c == 0 && d == 1 && e == 0 && f == 0;
@@ -603,18 +605,18 @@ class CFX_Matrix {
bool IsScaled() const;
bool WillScale() const { return a != 1.0f || b != 0 || c != 0 || d != 1.0f; }
- void Translate(float x, float y, bool bPrepended = false);
- void Translate(int32_t x, int32_t y, bool bPrepended = false) {
- Translate(static_cast<float>(x), static_cast<float>(y), bPrepended);
+ void Translate(float x, float y);
+ void TranslatePrepend(float x, float y);
+ void Translate(int32_t x, int32_t y) {
+ Translate(static_cast<float>(x), static_cast<float>(y));
+ }
+ void TranslatePrepend(int32_t x, int32_t y) {
+ TranslatePrepend(static_cast<float>(x), static_cast<float>(y));
}
- void Scale(float sx, float sy, bool bPrepended = false);
- void Rotate(float fRadian, bool bPrepended = false);
-
- // Rotates counterclockwise around the (x, y) point.
- void RotateAt(float fRadian, float x, float y, bool bPrepended = false);
-
- void Shear(float fAlphaRadian, float fBetaRadian, bool bPrepended = false);
+ void Scale(float sx, float sy);
+ void Rotate(float fRadian);
+ void Shear(float fAlphaRadian, float fBetaRadian);
void MatchRect(const CFX_FloatRect& dest, const CFX_FloatRect& src);
@@ -641,9 +643,6 @@ class CFX_Matrix {
float d;
float e;
float f;
-
- private:
- void ConcatInternal(const CFX_Matrix& other, bool prepend);
};
#endif // CORE_FXCRT_FX_COORDINATES_H_