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/IntPoint.h" | 9 #include "platform/geometry/IntPoint.h" |
10 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
11 #include "platform/geometry/IntSize.h" | 11 #include "platform/geometry/IntSize.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 STACK_ALLOCATED(); | 22 STACK_ALLOCATED(); |
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, |
| 30 // Used during painting to compensate ScrollRecorders for fixed backgrou
nd |
| 31 const IntPoint& accumulatedScrollOffsetSincePaintContainer = IntPoint(), |
30 LayoutObject* backgroundObject = nullptr); | 32 LayoutObject* backgroundObject = nullptr); |
31 | 33 |
32 IntRect destRect() const { return m_destRect; } | 34 IntRect destRect() const { return m_destRect; } |
33 IntSize tileSize() const { return m_tileSize; } | 35 IntSize tileSize() const { return m_tileSize; } |
34 IntPoint phase() const { return m_phase; } | 36 IntPoint phase() const { return m_phase; } |
35 // Space-size represents extra width and height that may be added to | 37 // Space-size represents extra width and height that may be added to |
36 // the image if used as a pattern with background-repeat: space. | 38 // the image if used as a pattern with background-repeat: space. |
37 IntSize spaceSize() const { return m_repeatSpacing; } | 39 IntSize spaceSize() const { return m_repeatSpacing; } |
38 // Has background-attachment: fixed. Implies that we can't always cheaply co
mpute destRect. | 40 // Has background-attachment: fixed. Implies that we can't always cheaply co
mpute destRect. |
39 bool hasNonLocalGeometry() const { return m_hasNonLocalGeometry; } | 41 bool hasNonLocalGeometry() const { return m_hasNonLocalGeometry; } |
(...skipping 15 matching lines...) Expand all Loading... |
55 IntRect m_destRect; | 57 IntRect m_destRect; |
56 IntPoint m_phase; | 58 IntPoint m_phase; |
57 IntSize m_tileSize; | 59 IntSize m_tileSize; |
58 IntSize m_repeatSpacing; | 60 IntSize m_repeatSpacing; |
59 bool m_hasNonLocalGeometry; | 61 bool m_hasNonLocalGeometry; |
60 }; | 62 }; |
61 | 63 |
62 } // namespace blink | 64 } // namespace blink |
63 | 65 |
64 #endif // BackgroundImageGeometry_h | 66 #endif // BackgroundImageGeometry_h |
OLD | NEW |