File: FloatToLayoutUnit.h

package info (click to toggle)
chromium-browser 41.0.2272.118-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,189,132 kB
  • sloc: cpp: 9,691,462; ansic: 3,341,451; python: 712,689; asm: 518,779; xml: 208,926; java: 169,820; sh: 119,353; perl: 68,907; makefile: 28,311; yacc: 13,305; objc: 11,385; tcl: 3,186; cs: 2,225; sql: 2,217; lex: 2,215; lisp: 1,349; pascal: 1,256; awk: 407; ruby: 155; sed: 53; php: 14; exp: 11
file content (752 lines) | stat: -rw-r--r-- 19,123 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


// The classes in this file are transitional types intended to facilitate
// moving the LineBox types from float-based units to LayoutUnits. At first,
// these types will be backed by floats, and then swapped to LayoutUnit
// implementations, and eventually removed when LayoutUnits in this code
// are stabilized. See
// https://docs.google.com/a/chromium.org/document/d/1fro9Drq78rYBwr6K9CPK-y0TDSVxlBuXl6A54XnKAyE/edit
// for details.

#ifndef FloatToLayoutUnit_h
#define FloatToLayoutUnit_h

#include "platform/LayoutUnit.h"
#include "platform/geometry/FloatPoint.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/FloatSize.h"
#include "platform/geometry/LayoutPoint.h"
#include "platform/geometry/LayoutRect.h"
#include "platform/geometry/LayoutSize.h"

namespace blink {

class IntPoint;

class FloatLineLayoutUnit {
public:
    FloatLineLayoutUnit() : m_value(0) { }
    FloatLineLayoutUnit(float f) : m_value(f) { }

    FloatLineLayoutUnit(const LayoutUnit &layoutUnit) : m_value(layoutUnit.toFloat()) { }

    operator float() const { return toFloat(); }
    operator LayoutUnit() const { return toLayoutUnit(); }

    float rawValue() const
    {
        return m_value;
    }

    float toFloat() const
    {
        return m_value;
    }

    LayoutUnit toLayoutUnit() const
    {
        return LayoutUnit(m_value);
    }

    int round() const
    {
        return lroundf(m_value);
    }

private:
    float m_value;
};

inline FloatLineLayoutUnit operator-(const FloatLineLayoutUnit& a)
{
    FloatLineLayoutUnit returnVal(-a.rawValue());
    return returnVal;
}

inline bool operator<=(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return a.rawValue() <= b.rawValue();
}

inline bool operator<=(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() <= b;
}

inline bool operator<=(const FloatLineLayoutUnit& a, int b)
{
    return a <= FloatLineLayoutUnit(b);
}

inline bool operator<=(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a <= FloatLineLayoutUnit(b);
}

inline bool operator<=(float a, const FloatLineLayoutUnit& b)
{
    return a <= b.toFloat();
}

inline bool operator<=(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) <= b;
}

inline bool operator<=(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) <= b;
}

inline bool operator>=(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return a.rawValue() >= b.rawValue();
}

inline bool operator>=(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() >= b;
}

inline bool operator>=(const FloatLineLayoutUnit& a, int b)
{
    return a >= FloatLineLayoutUnit(b);
}

inline bool operator>=(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a >= FloatLineLayoutUnit(b);
}

inline bool operator>=(float a, const FloatLineLayoutUnit& b)
{
    return a >= b.toFloat();
}

inline bool operator>=(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) >= b;
}

inline bool operator>=(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) >= b;
}

inline bool operator<(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return a.rawValue() < b.rawValue();
}

inline bool operator<(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() < b;
}

inline bool operator<(const FloatLineLayoutUnit& a, int b)
{
    return a < FloatLineLayoutUnit(b);
}

inline bool operator<(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a < FloatLineLayoutUnit(b);
}

inline bool operator<(float a, const FloatLineLayoutUnit& b)
{
    return a < b.toFloat();
}

inline bool operator<(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) < b;
}

inline bool operator<(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) < b;
}

inline bool operator>(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return a.rawValue() > b.rawValue();
}

inline bool operator>(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() > b;
}

inline bool operator>(const FloatLineLayoutUnit& a, int b)
{
    return a > FloatLineLayoutUnit(b);
}

inline bool operator>(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a > FloatLineLayoutUnit(b);
}

inline bool operator>(float a, const FloatLineLayoutUnit& b)
{
    return a > b.toFloat();
}

inline bool operator>(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) > b;
}

inline bool operator>(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) > b;
}

inline bool operator!=(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return a.rawValue() != b.rawValue();
}

inline bool operator!=(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() != b;
}

inline bool operator!=(const FloatLineLayoutUnit& a, int b)
{
    return a != FloatLineLayoutUnit(b);
}

inline bool operator!=(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a != FloatLineLayoutUnit(b);
}

inline bool operator!=(float a, const FloatLineLayoutUnit& b)
{
    return a != b.toFloat();
}

inline bool operator!=(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) != b;
}

inline bool operator!=(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) != b;
}

inline bool operator==(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return a.rawValue() == b.rawValue();
}

inline bool operator==(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() == b;
}

inline bool operator==(const FloatLineLayoutUnit& a, int b)
{
    return a == FloatLineLayoutUnit(b);
}

inline bool operator==(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a == FloatLineLayoutUnit(b);
}

inline bool operator==(float a, const FloatLineLayoutUnit& b)
{
    return a == b.toFloat();
}

inline bool operator==(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) == b;
}

inline bool operator==(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) == b;
}

inline FloatLineLayoutUnit operator*(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a.rawValue() * b.rawValue());
}

inline float operator*(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() * b;
}

inline FloatLineLayoutUnit operator*(const FloatLineLayoutUnit& a, int b)
{
    return a * FloatLineLayoutUnit(b);
}

inline FloatLineLayoutUnit operator*(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a * FloatLineLayoutUnit(b);
}

inline float operator*(float a, const FloatLineLayoutUnit& b)
{
    return a * b.toFloat();
}

inline FloatLineLayoutUnit operator*(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) * b;
}

inline FloatLineLayoutUnit operator*(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) * b;
}

inline FloatLineLayoutUnit operator/(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a.rawValue() / b.rawValue());
}

inline float operator/(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() / b;
}

inline FloatLineLayoutUnit operator/(const FloatLineLayoutUnit& a, int b)
{
    return a / FloatLineLayoutUnit(b);
}

inline FloatLineLayoutUnit operator/(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a / FloatLineLayoutUnit(b);
}

inline float operator/(float a, const FloatLineLayoutUnit& b)
{
    return a / b.toFloat();
}

inline FloatLineLayoutUnit operator/(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) / b;
}

inline FloatLineLayoutUnit operator/(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) / b;
}

inline FloatLineLayoutUnit operator+(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a.rawValue() + b.rawValue());
}

inline float operator+(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() + b;
}

inline FloatLineLayoutUnit operator+(const FloatLineLayoutUnit& a, int b)
{
    return a + FloatLineLayoutUnit(b);
}

inline FloatLineLayoutUnit operator+(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a + FloatLineLayoutUnit(b);
}

inline float operator+(float a, const FloatLineLayoutUnit& b)
{
    return a + b.toFloat();
}

inline FloatLineLayoutUnit operator+(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) + b;
}

inline FloatLineLayoutUnit operator+(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) + b;
}

inline FloatLineLayoutUnit operator-(const FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a.rawValue() - b.rawValue());
}

inline float operator-(const FloatLineLayoutUnit& a, float b)
{
    return a.toFloat() - b;
}

inline FloatLineLayoutUnit operator-(const FloatLineLayoutUnit& a, int b)
{
    return a - FloatLineLayoutUnit(b);
}

inline FloatLineLayoutUnit operator-(const FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    return a - FloatLineLayoutUnit(b);
}

inline float operator-(float a, const FloatLineLayoutUnit& b)
{
    return a - b.toFloat();
}

inline FloatLineLayoutUnit operator-(int a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) - b;
}

inline FloatLineLayoutUnit operator-(const LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    return FloatLineLayoutUnit(a) - b;
}

inline FloatLineLayoutUnit& operator*=(FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a * b;
    return a;
}

inline FloatLineLayoutUnit& operator*=(FloatLineLayoutUnit& a, float b)
{
    a = a * b;
    return a;
}

inline FloatLineLayoutUnit& operator*=(FloatLineLayoutUnit& a, int b)
{
    a = a * b;
    return a;
}

inline FloatLineLayoutUnit& operator*=(FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    a = a * b;
    return a;
}

inline float& operator*=(float& a, const FloatLineLayoutUnit& b)
{
    a = a * b;
    return a;
}

inline int& operator*=(int& a, const FloatLineLayoutUnit& b)
{
    a = a * b;
    return a;
}

inline LayoutUnit& operator*=(LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a * b;
    return a;
}

inline FloatLineLayoutUnit& operator/=(FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a / b;
    return a;
}

inline FloatLineLayoutUnit& operator/=(FloatLineLayoutUnit& a, float b)
{
    a = a / b;
    return a;
}

inline FloatLineLayoutUnit& operator/=(FloatLineLayoutUnit& a, int b)
{
    a = a / b;
    return a;
}

inline FloatLineLayoutUnit& operator/=(FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    a = a / b;
    return a;
}

inline float& operator/=(float& a, const FloatLineLayoutUnit& b)
{
    a = a / b;
    return a;
}

inline int& operator/=(int& a, const FloatLineLayoutUnit& b)
{
    a = a / b;
    return a;
}

inline LayoutUnit& operator/=(LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a / b;
    return a;
}

inline FloatLineLayoutUnit& operator+=(FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a + b;
    return a;
}

inline FloatLineLayoutUnit& operator+=(FloatLineLayoutUnit& a, float b)
{
    a = a + b;
    return a;
}

inline FloatLineLayoutUnit& operator+=(FloatLineLayoutUnit& a, int b)
{
    a = a + b;
    return a;
}

inline FloatLineLayoutUnit& operator+=(FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    a = a + b;
    return a;
}

inline float& operator+=(float& a, const FloatLineLayoutUnit& b)
{
    a = a + b;
    return a;
}

inline int& operator+=(int& a, const FloatLineLayoutUnit& b)
{
    a = a + b;
    return a;
}

inline LayoutUnit& operator+=(LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a + b;
    return a;
}

inline FloatLineLayoutUnit& operator-=(FloatLineLayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a - b;
    return a;
}

inline FloatLineLayoutUnit& operator-=(FloatLineLayoutUnit& a, float b)
{
    a = a - b;
    return a;
}

inline FloatLineLayoutUnit& operator-=(FloatLineLayoutUnit& a, int b)
{
    a = a - b;
    return a;
}

inline FloatLineLayoutUnit& operator-=(FloatLineLayoutUnit& a, const LayoutUnit& b)
{
    a = a - b;
    return a;
}

inline float& operator-=(float& a, const FloatLineLayoutUnit& b)
{
    a = a - b;
    return a;
}

inline int& operator-=(int& a, const FloatLineLayoutUnit& b)
{
    a = a - b;
    return a;
}

inline LayoutUnit& operator-=(LayoutUnit& a, const FloatLineLayoutUnit& b)
{
    a = a - b;
    return a;
}

class LayoutUnitLineLayoutUnit {
public:
    LayoutUnitLineLayoutUnit() { }
    LayoutUnitLineLayoutUnit(LayoutUnit f) : m_value(f) { }

    float toFloat() const
    {
        return m_value.toFloat();
    }

    LayoutUnit toLayoutUnit() const
    {
        return m_value;
    }

private:
    LayoutUnit m_value;
};

class FloatPointLineLayoutPoint {
public:
    FloatPointLineLayoutPoint() { }
    FloatPointLineLayoutPoint(const FloatPoint& floatPoint) : m_value(floatPoint) { }
    FloatPointLineLayoutPoint(FloatLineLayoutUnit x, FloatLineLayoutUnit y) : m_value(x.toFloat(), y.toFloat()) { }
    FloatPointLineLayoutPoint(const IntPoint& intPoint) : m_value(intPoint) { }
    FloatPointLineLayoutPoint(const LayoutPoint& layoutPoint) : m_value(layoutPoint) { }

    operator FloatPoint() const { return toFloatPoint(); }
    operator LayoutPoint() const { return toLayoutPoint(); }

    FloatPoint toFloatPoint() const
    {
        return m_value;
    }

    LayoutPoint toLayoutPoint() const
    {
        return LayoutPoint(m_value);
    }

    FloatLineLayoutUnit x() const { return FloatLineLayoutUnit(m_value.x()); }
    FloatLineLayoutUnit y() const { return FloatLineLayoutUnit(m_value.y()); }

    void setX(FloatLineLayoutUnit x) { m_value.setX(x.toFloat()); }
    void setY(FloatLineLayoutUnit y) { m_value.setY(y.toFloat()); }
    void set(FloatLineLayoutUnit x, FloatLineLayoutUnit y) { m_value.set(x.toFloat(), y.toFloat()); }

    void move(FloatLineLayoutUnit dx, FloatLineLayoutUnit dy) { m_value.move(dx.toFloat(), dy.toFloat()); }
    void moveBy(const LayoutPoint& layoutPoint) { m_value.moveBy(layoutPoint); }

    void scale(FloatLineLayoutUnit sx, FloatLineLayoutUnit sy) { m_value.scale(sx.toFloat(), sy.toFloat()); }

private:
    FloatPoint m_value;
};

class FloatSizeLineLayoutSize {
public:
    FloatSizeLineLayoutSize() { }
    FloatSizeLineLayoutSize(const FloatSize& floatSize) : m_value(floatSize) { }
    FloatSizeLineLayoutSize(FloatLineLayoutUnit width, FloatLineLayoutUnit height) : m_value(width.toFloat(), height.toFloat()) { }
    FloatSizeLineLayoutSize(const IntSize& size) : m_value(size) { }
    FloatSizeLineLayoutSize(const LayoutSize& size) : m_value(size) { }

    operator FloatSize() const { return toFloatSize(); }
    operator LayoutSize() const { return toLayoutSize(); }

    FloatSize toFloatSize() const
    {
        return m_value;
    }

    LayoutSize toLayoutSize() const
    {
        return LayoutSize(m_value);
    }

    FloatLineLayoutUnit width() const { return FloatLineLayoutUnit(m_value.width()); }
    FloatLineLayoutUnit height() const { return FloatLineLayoutUnit(m_value.height()); }

    void setWidth(FloatLineLayoutUnit width) { m_value.setWidth(width.toFloat()); }
    void setHeight(FloatLineLayoutUnit height) { m_value.setHeight(height.toFloat()); }

private:
    FloatSize m_value;
};

class FloatRectLineLayoutRect {
public:
    FloatRectLineLayoutRect() { }
    FloatRectLineLayoutRect(const FloatRect& floatRect) : m_value(floatRect) { }
    FloatRectLineLayoutRect(const FloatPointLineLayoutPoint& location, const FloatSizeLineLayoutSize& size)
        : m_value(location.toFloatPoint(), size.toFloatSize()) { }
    FloatRectLineLayoutRect(FloatLineLayoutUnit x, FloatLineLayoutUnit y, FloatLineLayoutUnit width, FloatLineLayoutUnit height)
        : m_value(x.toFloat(), y.toFloat(), width.toFloat(), height.toFloat()) { }
    FloatRectLineLayoutRect(const IntRect& rect) : m_value(rect) { }
    FloatRectLineLayoutRect(const LayoutRect& rect) : m_value(rect) { }

    operator FloatRect() const { return toFloatRect(); }
    operator LayoutRect() const { return toLayoutRect(); }

    FloatRect rawValue() const
    {
        return m_value;
    }


    FloatRect toFloatRect() const
    {
        return m_value;
    }

    LayoutRect toLayoutRect() const
    {
        return LayoutRect(m_value);
    }

    FloatPointLineLayoutPoint location() const { return FloatPointLineLayoutPoint(m_value.location()); }
    FloatSizeLineLayoutSize size() const { return FloatSizeLineLayoutSize(m_value.size()); }

    void setLocation(const FloatPointLineLayoutPoint& location) { m_value.setLocation(location.toFloatPoint()); }
    void setSize(const FloatSizeLineLayoutSize& size) { m_value.setSize(size.toFloatSize()); }

    FloatLineLayoutUnit x() const { return FloatLineLayoutUnit(m_value.x()); }
    FloatLineLayoutUnit y() const { return FloatLineLayoutUnit(m_value.y()); }
    FloatLineLayoutUnit maxX() const { return FloatLineLayoutUnit(m_value.maxX()); }
    FloatLineLayoutUnit maxY() const { return FloatLineLayoutUnit(m_value.maxY()); }
    FloatLineLayoutUnit width() const { return FloatLineLayoutUnit(m_value.width()); }
    FloatLineLayoutUnit height() const { return FloatLineLayoutUnit(m_value.height()); }

    void setX(FloatLineLayoutUnit x) { m_value.setX(x.toFloat()); }
    void setY(FloatLineLayoutUnit y) { m_value.setY(y.toFloat()); }
    void setWidth(FloatLineLayoutUnit width) { m_value.setWidth(width.toFloat()); }
    void setHeight(FloatLineLayoutUnit height) { m_value.setHeight(height.toFloat()); }

    void unite(const FloatRectLineLayoutRect& rect) { m_value.unite(rect.toFloatRect()); }

    void scale(FloatLineLayoutUnit s) { m_value.scale(s.toFloat()); }
    void scale(FloatLineLayoutUnit sx, FloatLineLayoutUnit sy) { m_value.scale(sx.toFloat(), sy.toFloat()); }

    bool intersects(const FloatRectLineLayoutRect& rect) const { return m_value.intersects(rect.toFloatRect()); }

private:
    FloatRect m_value;
};

#if ENABLE(LAYOUT_UNIT_IN_INLINE_BOXES)
using LineLayoutUnit = LayoutUnitLineLayoutUnit;
using LineLayoutPoint = LayoutPointLineLayoutPoint;
using LineLayoutRect = LayoutRectLineLayoutRect;
using LineLayoutSize = LayoutSizeLineLayoutSize;
#else // ENABLE(LAYOUT_UNIT_IN_INLINE_BOXES)
using LineLayoutUnit = FloatLineLayoutUnit;
using LineLayoutPoint = FloatPointLineLayoutPoint;
using LineLayoutRect = FloatRectLineLayoutRect;
using LineLayoutSize = FloatSizeLineLayoutSize;
#endif // ENABLE(LAYOUT_UNIT_IN_INLINE_BOXES)

using FloatWillBeLayoutUnit = LineLayoutUnit;
using FloatPointWillBeLayoutPoint = LineLayoutPoint;
using FloatRectWillBeLayoutRect = LineLayoutRect;
using FloatSizeWillBeLayoutSize = LineLayoutSize;

} // namespace blink

#endif // FloatToLayoutUnit_h