OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium 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 #ifndef BackgroundImageGeometry_h | 5 #ifndef BackgroundImageGeometry_h |
6 #define BackgroundImageGeometry_h | 6 #define BackgroundImageGeometry_h |
7 | 7 |
8 #include "core/paint/PaintPhase.h" | 8 #include "core/paint/PaintPhase.h" |
9 #include "platform/geometry/LayoutPoint.h" | 9 #include "platform/geometry/LayoutPoint.h" |
10 #include "platform/geometry/LayoutRect.h" | 10 #include "platform/geometry/LayoutRect.h" |
11 #include "platform/geometry/LayoutSize.h" | 11 #include "platform/geometry/LayoutSize.h" |
12 #include "wtf/Allocator.h" | 12 #include "wtf/Allocator.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class FillLayer; | 16 class FillLayer; |
17 class LayoutBoxModelObject; | 17 class LayoutBoxModelObject; |
18 class LayoutObject; | 18 class LayoutObject; |
19 class LayoutRect; | 19 class LayoutRect; |
20 | 20 |
21 class BackgroundImageGeometry { | 21 class BackgroundImageGeometry { |
22 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 22 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
23 public: | 23 public: |
24 BackgroundImageGeometry() | 24 BackgroundImageGeometry() |
25 : m_hasNonLocalGeometry(false) | 25 : m_hasNonLocalGeometry(false) |
26 { } | 26 { } |
27 | 27 |
28 void calculate(const LayoutBoxModelObject&, const LayoutBoxModelObject* pain
tContainer, | 28 void calculate(const LayoutBoxModelObject&, const LayoutBoxModelObject* pain
tContainer, |
29 const GlobalPaintFlags, const FillLayer&, const LayoutRect& paintRect); | 29 const GlobalPaintFlags, const FillLayer&, const LayoutRect& paintRect, c
onst bool layerIncludesBorders = true); |
30 | 30 |
31 const LayoutRect& destRect() const { return m_destRect; } | 31 const LayoutRect& destRect() const { return m_destRect; } |
32 const LayoutSize& tileSize() const { return m_tileSize; } | 32 const LayoutSize& tileSize() const { return m_tileSize; } |
33 const LayoutPoint& phase() const { return m_phase; } | 33 const LayoutPoint& phase() const { return m_phase; } |
34 // Space-size represents extra width and height that may be added to | 34 // Space-size represents extra width and height that may be added to |
35 // the image if used as a pattern with background-repeat: space. | 35 // the image if used as a pattern with background-repeat: space. |
36 const LayoutSize& spaceSize() const { return m_repeatSpacing; } | 36 const LayoutSize& spaceSize() const { return m_repeatSpacing; } |
37 // Has background-attachment: fixed. Implies that we can't always cheaply co
mpute destRect. | 37 // Has background-attachment: fixed. Implies that we can't always cheaply co
mpute destRect. |
38 bool hasNonLocalGeometry() const { return m_hasNonLocalGeometry; } | 38 bool hasNonLocalGeometry() const { return m_hasNonLocalGeometry; } |
39 | 39 |
(...skipping 19 matching lines...) Expand all Loading... |
59 LayoutRect m_destRect; | 59 LayoutRect m_destRect; |
60 LayoutPoint m_phase; | 60 LayoutPoint m_phase; |
61 LayoutSize m_tileSize; | 61 LayoutSize m_tileSize; |
62 LayoutSize m_repeatSpacing; | 62 LayoutSize m_repeatSpacing; |
63 bool m_hasNonLocalGeometry; | 63 bool m_hasNonLocalGeometry; |
64 }; | 64 }; |
65 | 65 |
66 } // namespace blink | 66 } // namespace blink |
67 | 67 |
68 #endif // BackgroundImageGeometry_h | 68 #endif // BackgroundImageGeometry_h |
OLD | NEW |