|
1 /*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsDisplayListInvalidation.h" |
|
7 #include "nsDisplayList.h" |
|
8 #include "nsIFrame.h" |
|
9 |
|
10 nsDisplayItemGeometry::nsDisplayItemGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
|
11 { |
|
12 MOZ_COUNT_CTOR(nsDisplayItemGeometry); |
|
13 bool snap; |
|
14 mBounds = aItem->GetBounds(aBuilder, &snap); |
|
15 } |
|
16 |
|
17 nsDisplayItemGeometry::~nsDisplayItemGeometry() |
|
18 { |
|
19 MOZ_COUNT_DTOR(nsDisplayItemGeometry); |
|
20 } |
|
21 |
|
22 nsDisplayItemGenericGeometry::nsDisplayItemGenericGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
|
23 : nsDisplayItemGeometry(aItem, aBuilder) |
|
24 , mBorderRect(aItem->GetBorderRect()) |
|
25 {} |
|
26 |
|
27 void |
|
28 nsDisplayItemGenericGeometry::MoveBy(const nsPoint& aOffset) |
|
29 { |
|
30 mBounds.MoveBy(aOffset); |
|
31 mBorderRect.MoveBy(aOffset); |
|
32 } |
|
33 |
|
34 nsDisplayItemBoundsGeometry::nsDisplayItemBoundsGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
|
35 : nsDisplayItemGeometry(aItem, aBuilder) |
|
36 { |
|
37 nscoord radii[8]; |
|
38 mHasRoundedCorners = aItem->Frame()->GetBorderRadii(radii); |
|
39 } |
|
40 |
|
41 void |
|
42 nsDisplayItemBoundsGeometry::MoveBy(const nsPoint& aOffset) |
|
43 { |
|
44 mBounds.MoveBy(aOffset); |
|
45 } |
|
46 |
|
47 nsDisplayBorderGeometry::nsDisplayBorderGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
|
48 : nsDisplayItemGeometry(aItem, aBuilder) |
|
49 , mContentRect(aItem->GetContentRect()) |
|
50 {} |
|
51 |
|
52 void |
|
53 nsDisplayBorderGeometry::MoveBy(const nsPoint& aOffset) |
|
54 { |
|
55 mBounds.MoveBy(aOffset); |
|
56 mContentRect.MoveBy(aOffset); |
|
57 } |
|
58 |
|
59 nsDisplayBackgroundGeometry::nsDisplayBackgroundGeometry(nsDisplayBackgroundImage* aItem, |
|
60 nsDisplayListBuilder* aBuilder) |
|
61 : nsDisplayItemGeometry(aItem, aBuilder) |
|
62 , mPositioningArea(aItem->GetPositioningArea()) |
|
63 {} |
|
64 |
|
65 void |
|
66 nsDisplayBackgroundGeometry::MoveBy(const nsPoint& aOffset) |
|
67 { |
|
68 mBounds.MoveBy(aOffset); |
|
69 mPositioningArea.MoveBy(aOffset); |
|
70 } |
|
71 |
|
72 nsDisplayThemedBackgroundGeometry::nsDisplayThemedBackgroundGeometry(nsDisplayThemedBackground* aItem, |
|
73 nsDisplayListBuilder* aBuilder) |
|
74 : nsDisplayItemGeometry(aItem, aBuilder) |
|
75 , mPositioningArea(aItem->GetPositioningArea()) |
|
76 , mWindowIsActive(aItem->IsWindowActive()) |
|
77 {} |
|
78 |
|
79 void |
|
80 nsDisplayThemedBackgroundGeometry::MoveBy(const nsPoint& aOffset) |
|
81 { |
|
82 mBounds.MoveBy(aOffset); |
|
83 mPositioningArea.MoveBy(aOffset); |
|
84 } |
|
85 |
|
86 nsDisplayBoxShadowInnerGeometry::nsDisplayBoxShadowInnerGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder) |
|
87 : nsDisplayItemGeometry(aItem, aBuilder) |
|
88 , mPaddingRect(aItem->GetPaddingRect()) |
|
89 {} |
|
90 |
|
91 void |
|
92 nsDisplayBoxShadowInnerGeometry::MoveBy(const nsPoint& aOffset) |
|
93 { |
|
94 mBounds.MoveBy(aOffset); |
|
95 mPaddingRect.MoveBy(aOffset); |
|
96 } |
|
97 |