OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 15 matching lines...) Expand all Loading... |
26 #ifndef LayerFragment_h | 26 #ifndef LayerFragment_h |
27 #define LayerFragment_h | 27 #define LayerFragment_h |
28 | 28 |
29 #include "core/rendering/ClipRect.h" | 29 #include "core/rendering/ClipRect.h" |
30 #include "wtf/Vector.h" | 30 #include "wtf/Vector.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 struct LayerFragment { | 34 struct LayerFragment { |
35 public: | 35 public: |
36 LayerFragment() | |
37 : shouldPaintContent(false) | |
38 { | |
39 } | |
40 | |
41 void setRects(const LayoutRect& bounds, const ClipRect& background, const Cl
ipRect& foreground, const ClipRect& outline) | 36 void setRects(const LayoutRect& bounds, const ClipRect& background, const Cl
ipRect& foreground, const ClipRect& outline) |
42 { | 37 { |
43 layerBounds = bounds; | 38 layerBounds = bounds; |
44 backgroundRect = background; | 39 backgroundRect = background; |
45 foregroundRect = foreground; | 40 foregroundRect = foreground; |
46 outlineRect = outline; | 41 outlineRect = outline; |
47 } | 42 } |
48 | 43 |
49 void moveBy(const LayoutPoint& offset) | 44 void moveBy(const LayoutPoint& offset) |
50 { | 45 { |
51 layerBounds.moveBy(offset); | 46 layerBounds.moveBy(offset); |
52 backgroundRect.moveBy(offset); | 47 backgroundRect.moveBy(offset); |
53 foregroundRect.moveBy(offset); | 48 foregroundRect.moveBy(offset); |
54 outlineRect.moveBy(offset); | 49 outlineRect.moveBy(offset); |
55 paginationClip.moveBy(offset); | 50 paginationClip.moveBy(offset); |
56 } | 51 } |
57 | 52 |
58 void intersect(const LayoutRect& rect) | 53 void intersect(const LayoutRect& rect) |
59 { | 54 { |
60 backgroundRect.intersect(rect); | 55 backgroundRect.intersect(rect); |
61 foregroundRect.intersect(rect); | 56 foregroundRect.intersect(rect); |
62 outlineRect.intersect(rect); | 57 outlineRect.intersect(rect); |
63 } | 58 } |
64 | 59 |
65 bool shouldPaintContent; | |
66 LayoutRect layerBounds; | 60 LayoutRect layerBounds; |
67 ClipRect backgroundRect; | 61 ClipRect backgroundRect; |
68 ClipRect foregroundRect; | 62 ClipRect foregroundRect; |
69 ClipRect outlineRect; | 63 ClipRect outlineRect; |
70 | 64 |
71 // Unique to paginated fragments. The physical translation to apply to shift
the layer when painting/hit-testing. | 65 // Unique to paginated fragments. The physical translation to apply to shift
the layer when painting/hit-testing. |
72 LayoutPoint paginationOffset; | 66 LayoutPoint paginationOffset; |
73 | 67 |
74 // Also unique to paginated fragments. An additional clip that applies to th
e layer. It is in layer-local | 68 // Also unique to paginated fragments. An additional clip that applies to th
e layer. It is in layer-local |
75 // (physical) coordinates. | 69 // (physical) coordinates. |
76 LayoutRect paginationClip; | 70 LayoutRect paginationClip; |
77 }; | 71 }; |
78 | 72 |
79 typedef Vector<LayerFragment, 1> LayerFragments; | 73 typedef Vector<LayerFragment, 1> LayerFragments; |
80 | 74 |
81 } // namespace blink | 75 } // namespace blink |
82 | 76 |
83 #endif // LayerFragment_h | 77 #endif // LayerFragment_h |
OLD | NEW |