#include "pdf/pdf_ink_transform.h"
#include <array>
#include "pdf/ink/ink_affine_transform.h"
#include "pdf/page_orientation.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/vector2d_f.h"
namespace chrome_pdf {
namespace {
constexpr gfx::Size kPageSizePortrait(50, 60);
constexpr gfx::Size kPageSizePortrait2x(kPageSizePortrait.width() * 2,
kPageSizePortrait.height() * 2);
constexpr gfx::Size kPageSizeLandscape(kPageSizePortrait.height(),
kPageSizePortrait.width());
constexpr gfx::Size kPageSizeLandscape2x(kPageSizeLandscape.width() * 2,
kPageSizeLandscape.height() * 2);
constexpr float kScaleFactor1x = …;
constexpr float kScaleFactor2x = …;
constexpr gfx::Rect kPageContentAreaPortraitNoOffset(gfx::Point(),
kPageSizePortrait);
constexpr gfx::Rect kPageContentAreaPortraitNoOffset2x(gfx::Point(),
kPageSizePortrait2x);
constexpr gfx::Rect kPageContentAreaLandscapeNoOffset(gfx::Point(),
kPageSizeLandscape);
constexpr gfx::Vector2dF kViewportOriginOffsetNone;
constexpr gfx::PointF kInputPositionTopLeft;
constexpr gfx::PointF kInputPositionPortraitBottomRight(49.0f, 59.0f);
constexpr gfx::PointF kInputPositionLandscapeBottomRight(59.0f, 49.0f);
constexpr gfx::PointF kInputPositionPortraitBottomRight2x(99.0f, 119.0f);
constexpr gfx::PointF kInputPositionLandscapeBottomRight2x(119.0f, 99.0f);
constexpr gfx::PointF kInputPositionInterior(40.0f, 16.0f);
constexpr gfx::PointF kInputPositionInterior2x(80.0f, 32.0f);
constexpr gfx::PointF kCanonicalPositionTopLeft;
constexpr gfx::PointF kCanonicalPositionTopRight(49.0f, 0.0f);
constexpr gfx::PointF kCanonicalPositionBottomLeft(0.0f, 59.0f);
constexpr gfx::PointF kCanonicalPositionBottomRight(49.0f, 59.0f);
constexpr gfx::Vector2dF kCanonicalPositionHalf(0.5f, 0.5f);
constexpr gfx::Vector2dF kCanonicalPositionHalfX(0.5f, 0.0f);
constexpr gfx::Vector2dF kCanonicalPositionHalfY(0.0f, 0.5f);
struct InputOutputPair { … };
}
TEST(PdfInkTransformTest, EventPositionToCanonicalPositionIdentity) { … }
TEST(PdfInkTransformTest, EventPositionToCanonicalPositionZoom) { … }
TEST(PdfInkTransformTest, EventPositionToCanonicalPositionRotateClockwise90) { … }
TEST(PdfInkTransformTest, EventPositionToCanonicalPositionRotateClockwise180) { … }
TEST(PdfInkTransformTest, EventPositionToCanonicalPositionRotateClockwise270) { … }
TEST(PdfInkTransformTest, EventPositionToCanonicalPositionScrolled) { … }
TEST(PdfInkTransformTest,
EventPositionToCanonicalPositionZoomScrolledClockwise90) { … }
TEST(PdfInkTransformTest, RenderTransformIdentity) { … }
TEST(PdfInkTransformTest, RenderTransformZoom) { … }
TEST(PdfInkTransformTest, RenderTransformRotateClockwise90) { … }
TEST(PdfInkTransformTest, RenderTransformRotateClockwise180) { … }
TEST(PdfInkTransformTest, RenderTransformRotateClockwise270) { … }
TEST(PdfInkTransformTest, RenderTransformScrolled) { … }
TEST(PdfInkTransformTest, RenderTransformOffsetScrolled) { … }
TEST(PdfInkTransformTest, RenderTransformZoomScrolledClockwise90) { … }
TEST(PdfInkTransformTest, RenderTransformOffsetZoomScrolledClockwise90) { … }
}