10#include <CoreGraphics/CoreGraphics.h>
11#elif defined(OS_APPLE)
12#include <ApplicationServices/ApplicationServices.h>
27Size& Size::operator=(
const CGSize&
s) {
34void Size::operator+=(
const Size& size) {
35 Enlarge(size.width(), size.height());
38void Size::operator-=(
const Size& size) {
39 Enlarge(-size.width(), -size.height());
43SIZE Size::ToSIZE()
const {
49#elif defined(OS_APPLE)
50CGSize Size::ToCGSize()
const {
55int Size::GetArea()
const {
56 return GetCheckedArea().ValueOrDie();
65void Size::Enlarge(
int grow_width,
int grow_height) {
66 SetSize(base::ClampAdd(
width(), grow_width),
67 base::ClampAdd(
height(), grow_height));
70void Size::SetToMin(
const Size& other) {
75void Size::SetToMax(
const Size& other) {
80std::string Size::ToString()
const {
85 if (x_scale == 1.f && y_scale == 1.f)
97 if (x_scale == 1.f && y_scale == 1.f)
109 if (x_scale == 1.f && y_scale == 1.f)
constexpr int height() const
constexpr int width() const
std::string StringPrintf(const std::string &format, Args... args)
Size ToFlooredSize(const SizeF &size)
SizeF ScaleSize(const SizeF &s, float x_scale, float y_scale)
Size ToCeiledSize(const SizeF &size)
Size ScaleToCeiledSize(const Size &size, float x_scale, float y_scale)
Size ScaleToFlooredSize(const Size &size, float x_scale, float y_scale)
Size ToRoundedSize(const SizeF &size)
Size ScaleToRoundedSize(const Size &size, float x_scale, float y_scale)