#include "pdf/pdf_transform.h"
#include <algorithm>
#include <utility>
#include "base/notreached.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size_f.h"
namespace chrome_pdf {
namespace {
void SwapPdfRectangleValuesIfNeeded(PdfRectangle* rect) { … }
}
float CalculateScaleFactor(const gfx::Rect& content_rect,
const gfx::SizeF& src_size,
bool rotated) { … }
void SetDefaultClipBox(bool rotated, PdfRectangle* clip_box) { … }
void CalculateMediaBoxAndCropBox(bool rotated,
bool has_media_box,
bool has_crop_box,
PdfRectangle* media_box,
PdfRectangle* crop_box) { … }
PdfRectangle CalculateClipBoxBoundary(const PdfRectangle& media_box,
const PdfRectangle& crop_box) { … }
void ScalePdfRectangle(float scale_factor, PdfRectangle* rect) { … }
gfx::PointF CalculateScaledClipBoxOffset(const gfx::Rect& content_rect,
const PdfRectangle& source_clip_box) { … }
gfx::PointF CalculateNonScaledClipBoxOffset(
int rotation,
int page_width,
int page_height,
const PdfRectangle& source_clip_box) { … }
}