Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: core/fxcrt/include/fx_coordinates.h

Issue 2307953003: Remove CFX_Matrix::Copy() in favor of assignment (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdftext/cpdf_textpage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FXCRT_INCLUDE_FX_COORDINATES_H_ 7 #ifndef CORE_FXCRT_INCLUDE_FX_COORDINATES_H_
8 #define CORE_FXCRT_INCLUDE_FX_COORDINATES_H_ 8 #define CORE_FXCRT_INCLUDE_FX_COORDINATES_H_
9 9
10 #include "core/fxcrt/include/fx_basic.h" 10 #include "core/fxcrt/include/fx_basic.h"
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 void Concat(FX_FLOAT a, 575 void Concat(FX_FLOAT a,
576 FX_FLOAT b, 576 FX_FLOAT b,
577 FX_FLOAT c, 577 FX_FLOAT c,
578 FX_FLOAT d, 578 FX_FLOAT d,
579 FX_FLOAT e, 579 FX_FLOAT e,
580 FX_FLOAT f, 580 FX_FLOAT f,
581 FX_BOOL bPrepended = FALSE); 581 FX_BOOL bPrepended = FALSE);
582 void Concat(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE); 582 void Concat(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE);
583 void ConcatInverse(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE); 583 void ConcatInverse(const CFX_Matrix& m, FX_BOOL bPrepended = FALSE);
584 584
585 void Copy(const CFX_Matrix& m) { *this = m; }
586
587 FX_BOOL IsIdentity() const { 585 FX_BOOL IsIdentity() const {
588 return a == 1 && b == 0 && c == 0 && d == 1 && e == 0 && f == 0; 586 return a == 1 && b == 0 && c == 0 && d == 1 && e == 0 && f == 0;
589 } 587 }
588
590 FX_BOOL IsInvertible() const; 589 FX_BOOL IsInvertible() const;
591
592 FX_BOOL Is90Rotated() const; 590 FX_BOOL Is90Rotated() const;
593
594 FX_BOOL IsScaled() const; 591 FX_BOOL IsScaled() const;
595 592
596 void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE); 593 void Translate(FX_FLOAT x, FX_FLOAT y, FX_BOOL bPrepended = FALSE);
597
598 void TranslateI(int32_t x, int32_t y, FX_BOOL bPrepended = FALSE) { 594 void TranslateI(int32_t x, int32_t y, FX_BOOL bPrepended = FALSE) {
599 Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended); 595 Translate((FX_FLOAT)x, (FX_FLOAT)y, bPrepended);
600 } 596 }
601 597
602 void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended = FALSE); 598 void Scale(FX_FLOAT sx, FX_FLOAT sy, FX_BOOL bPrepended = FALSE);
603
604 void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended = FALSE); 599 void Rotate(FX_FLOAT fRadian, FX_BOOL bPrepended = FALSE);
605
606 void RotateAt(FX_FLOAT fRadian, 600 void RotateAt(FX_FLOAT fRadian,
607 FX_FLOAT x, 601 FX_FLOAT x,
608 FX_FLOAT y, 602 FX_FLOAT y,
609 FX_BOOL bPrepended = FALSE); 603 FX_BOOL bPrepended = FALSE);
610 604
611 void Shear(FX_FLOAT fAlphaRadian, 605 void Shear(FX_FLOAT fAlphaRadian,
612 FX_FLOAT fBetaRadian, 606 FX_FLOAT fBetaRadian,
613 FX_BOOL bPrepended = FALSE); 607 FX_BOOL bPrepended = FALSE);
614 608
615 void MatchRect(const CFX_FloatRect& dest, const CFX_FloatRect& src); 609 void MatchRect(const CFX_FloatRect& dest, const CFX_FloatRect& src);
616
617 FX_FLOAT GetXUnit() const; 610 FX_FLOAT GetXUnit() const;
618
619 FX_FLOAT GetYUnit() const; 611 FX_FLOAT GetYUnit() const;
620 void GetUnitRect(CFX_RectF& rect) const; 612 void GetUnitRect(CFX_RectF& rect) const;
621
622 CFX_FloatRect GetUnitRect() const; 613 CFX_FloatRect GetUnitRect() const;
623 614
624 FX_FLOAT GetUnitArea() const; 615 FX_FLOAT GetUnitArea() const;
625 FX_FLOAT TransformXDistance(FX_FLOAT dx) const; 616 FX_FLOAT TransformXDistance(FX_FLOAT dx) const;
626 int32_t TransformXDistance(int32_t dx) const; 617 int32_t TransformXDistance(int32_t dx) const;
627 FX_FLOAT TransformYDistance(FX_FLOAT dy) const; 618 FX_FLOAT TransformYDistance(FX_FLOAT dy) const;
628 int32_t TransformYDistance(int32_t dy) const; 619 int32_t TransformYDistance(int32_t dy) const;
629 FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const; 620 FX_FLOAT TransformDistance(FX_FLOAT dx, FX_FLOAT dy) const;
630 int32_t TransformDistance(int32_t dx, int32_t dy) const; 621 int32_t TransformDistance(int32_t dx, int32_t dy) const;
631 FX_FLOAT TransformDistance(FX_FLOAT distance) const; 622 FX_FLOAT TransformDistance(FX_FLOAT distance) const;
632 623
633 void TransformPoint(FX_FLOAT& x, FX_FLOAT& y) const; 624 void TransformPoint(FX_FLOAT& x, FX_FLOAT& y) const;
634 void TransformPoint(int32_t& x, int32_t& y) const; 625 void TransformPoint(int32_t& x, int32_t& y) const;
635 626
636 void Transform(FX_FLOAT& x, FX_FLOAT& y) const { TransformPoint(x, y); } 627 void Transform(FX_FLOAT& x, FX_FLOAT& y) const { TransformPoint(x, y); }
637 void Transform(FX_FLOAT x, FX_FLOAT y, FX_FLOAT& x1, FX_FLOAT& y1) const { 628 void Transform(FX_FLOAT x, FX_FLOAT y, FX_FLOAT& x1, FX_FLOAT& y1) const {
638 x1 = x, y1 = y; 629 x1 = x, y1 = y;
639 TransformPoint(x1, y1); 630 TransformPoint(x1, y1);
640 } 631 }
641 632
642 void TransformVector(CFX_VectorF& v) const; 633 void TransformVector(CFX_VectorF& v) const;
643 void TransformVector(CFX_Vector& v) const; 634 void TransformVector(CFX_Vector& v) const;
644 void TransformRect(CFX_RectF& rect) const; 635 void TransformRect(CFX_RectF& rect) const;
645 void TransformRect(CFX_Rect& rect) const; 636 void TransformRect(CFX_Rect& rect) const;
646
647 void TransformRect(FX_FLOAT& left, 637 void TransformRect(FX_FLOAT& left,
648 FX_FLOAT& right, 638 FX_FLOAT& right,
649 FX_FLOAT& top, 639 FX_FLOAT& top,
650 FX_FLOAT& bottom) const; 640 FX_FLOAT& bottom) const;
651 void TransformRect(CFX_FloatRect& rect) const { 641 void TransformRect(CFX_FloatRect& rect) const {
652 TransformRect(rect.left, rect.right, rect.top, rect.bottom); 642 TransformRect(rect.left, rect.right, rect.top, rect.bottom);
653 } 643 }
654 644
655 FX_FLOAT GetA() const { return a; } 645 FX_FLOAT GetA() const { return a; }
656 FX_FLOAT GetB() const { return b; } 646 FX_FLOAT GetB() const { return b; }
657 FX_FLOAT GetC() const { return c; } 647 FX_FLOAT GetC() const { return c; }
658 FX_FLOAT GetD() const { return d; } 648 FX_FLOAT GetD() const { return d; }
659 FX_FLOAT GetE() const { return e; } 649 FX_FLOAT GetE() const { return e; }
660 FX_FLOAT GetF() const { return f; } 650 FX_FLOAT GetF() const { return f; }
661 651
662 public: 652 public:
663 FX_FLOAT a; 653 FX_FLOAT a;
664 FX_FLOAT b; 654 FX_FLOAT b;
665 FX_FLOAT c; 655 FX_FLOAT c;
666 FX_FLOAT d; 656 FX_FLOAT d;
667 FX_FLOAT e; 657 FX_FLOAT e;
668 FX_FLOAT f; 658 FX_FLOAT f;
669 }; 659 };
670 660
671 #endif // CORE_FXCRT_INCLUDE_FX_COORDINATES_H_ 661 #endif // CORE_FXCRT_INCLUDE_FX_COORDINATES_H_
OLDNEW
« no previous file with comments | « core/fpdftext/cpdf_textpage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698