OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | |
3 * | |
4 * Redistribution and use in source and binary forms, with or without | |
5 * modification, are permitted provided that the following conditions | |
6 * are met: | |
7 * 1. Redistributions of source code must retain the above copyright | |
8 * notice, this list of conditions and the following disclaimer. | |
9 * 2. Redistributions in binary form must reproduce the above copyright | |
10 * notice, this list of conditions and the following disclaimer in the | |
11 * documentation and/or other materials provided with the distribution. | |
12 * | |
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND AN Y | |
jamesr
2013/05/17 00:10:20
wrong copyright header. Look for an email from da
| |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR AN Y | |
17 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | |
18 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
19 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND O N | |
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | |
22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
23 */ | |
24 | |
25 #ifndef WebCompositingReasons_h | |
26 #define WebCompositingReasons_h | |
27 | |
28 #if WEBKIT_IMPLEMENTATION | |
29 #include "core/rendering/RenderLayer.h" | |
jamesr
2013/05/17 00:10:20
we shouldn't do this
| |
30 #endif | |
31 | |
32 // This define will go away after landing both chromium and blink sides. | |
33 #define USE_WEB_COMPOSITING_REASONS 1 | |
34 | |
35 namespace WebKit { | |
36 | |
37 // This is a clone of CompositingReasons enum in RenderLayer.h, | |
38 // with some additional reasons that correspond to the hidden internal | |
39 // hierarchies in RenderLayerBacking and GraphicsLayer. | |
40 enum { | |
41 CompositingReasonUnknown = 0, | |
42 CompositingReason3DTransform = 1 << 0, | |
43 CompositingReasonVideo = 1 << 1, | |
44 CompositingReasonCanvas = 1 << 2, | |
45 CompositingReasonPlugin = 1 << 3, | |
46 CompositingReasonIFrame = 1 << 4, | |
47 CompositingReasonBackfaceVisibilityHidden = 1 << 5, | |
48 CompositingReasonAnimation = 1 << 6, | |
49 CompositingReasonFilters = 1 << 7, | |
50 CompositingReasonPositionFixed = 1 << 8, | |
51 CompositingReasonPositionSticky = 1 << 9, | |
52 CompositingReasonOverflowScrollingTouch = 1 << 10, | |
53 CompositingReasonBlending = 1 << 11, | |
54 CompositingReasonAssumedOverlap = 1 << 12, | |
55 CompositingReasonOverlap = 1 << 13, | |
56 CompositingReasonNegativeZIndexChildren = 1 << 14, | |
57 CompositingReasonTransformWithCompositedDescendants = 1 << 15, | |
58 CompositingReasonOpacityWithCompositedDescendants = 1 << 16, | |
59 CompositingReasonMaskWithCompositedDescendants = 1 << 17, | |
60 CompositingReasonReflectionWithCompositedDescendants = 1 << 18, | |
61 CompositingReasonFilterWithCompositedDescendants = 1 << 19, | |
62 CompositingReasonBlendingWithCompositedDescendants = 1 << 20, | |
63 CompositingReasonClipsCompositingDescendants = 1 << 21, | |
64 CompositingReasonPerspective = 1 << 22, | |
65 CompositingReasonPreserve3D = 1 << 23, | |
66 CompositingReasonReflectionOfCompositedParent = 1 << 24, | |
67 CompositingReasonRoot = 1 << 25, | |
68 CompositingReasonLayerForClip = 1 << 26, | |
69 CompositingReasonLayerForDescendantClip = 1 << 27, | |
70 CompositingReasonLayerForScrollbar = 1 << 28, | |
71 CompositingReasonsLayerForScrollingContainer = 1 << 29, | |
72 CompositingReasonsLayerForForeground = 1 << 30 | |
73 | |
74 // FIXME: Change this enum to a list of 64-bit constants so that we can | |
jamesr
2013/05/17 00:10:20
An enum is not a signed type, so I'm not sure what
| |
75 // handle more than 32 reasons. There are already more than 32 reason s, | |
76 // just not yet captured here. | |
77 }; | |
78 | |
79 // It is a typedef to allow bitwise operators to be used without type casts. | |
80 typedef unsigned WebCompositingReasons; | |
81 | |
82 // Aggressively try to catch any mismatch between this enum and the WebCore enum . | |
83 #if WEBKIT_IMPLEMENTATION | |
84 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonUnknown) == static _cast<unsigned>(WebCore::CompositingReasonNone), WebCompositingReasons_enum_does _not_match_webcore); | |
jamesr
2013/05/17 00:10:20
no - put these in AssertMatchingEnums
| |
85 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReason3DTransform) == st atic_cast<unsigned>(WebCore::CompositingReason3DTransform), WebCompositingReason s_enum_does_not_match_webcore); | |
86 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonVideo) == static_c ast<unsigned>(WebCore::CompositingReasonVideo), WebCompositingReasons_enum_does_ not_match_webcore); | |
87 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonCanvas) == static_ cast<unsigned>(WebCore::CompositingReasonCanvas), WebCompositingReasons_enum_doe s_not_match_webcore); | |
88 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonPlugin) == static_ cast<unsigned>(WebCore::CompositingReasonPlugin), WebCompositingReasons_enum_doe s_not_match_webcore); | |
89 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonIFrame) == static_ cast<unsigned>(WebCore::CompositingReasonIFrame), WebCompositingReasons_enum_doe s_not_match_webcore); | |
90 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonBackfaceVisibility Hidden) == static_cast<unsigned>(WebCore::CompositingReasonBackfaceVisibilityHid den), WebCompositingReasons_enum_does_not_match_webcore); | |
91 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonAnimation) == stat ic_cast<unsigned>(WebCore::CompositingReasonAnimation), WebCompositingReasons_en um_does_not_match_webcore); | |
92 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonFilters) == static _cast<unsigned>(WebCore::CompositingReasonFilters), WebCompositingReasons_enum_d oes_not_match_webcore); | |
93 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonPositionFixed) == static_cast<unsigned>(WebCore::CompositingReasonPositionFixed), WebCompositingRe asons_enum_does_not_match_webcore); | |
94 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonPositionSticky) == static_cast<unsigned>(WebCore::CompositingReasonPositionSticky), WebCompositing Reasons_enum_does_not_match_webcore); | |
95 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonOverflowScrollingT ouch) == static_cast<unsigned>(WebCore::CompositingReasonOverflowScrollingTouch) , WebCompositingReasons_enum_does_not_match_webcore); | |
96 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonBlending) == stati c_cast<unsigned>(WebCore::CompositingReasonBlending), WebCompositingReasons_enum _does_not_match_webcore); | |
97 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonAssumedOverlap) == static_cast<unsigned>(WebCore::CompositingReasonAssumedOverlap), WebCompositing Reasons_enum_does_not_match_webcore); | |
98 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonOverlap) == static _cast<unsigned>(WebCore::CompositingReasonOverlap), WebCompositingReasons_enum_d oes_not_match_webcore); | |
99 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonNegativeZIndexChil dren) == static_cast<unsigned>(WebCore::CompositingReasonNegativeZIndexChildren) , WebCompositingReasons_enum_does_not_match_webcore); | |
100 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonTransformWithCompo sitedDescendants) == static_cast<unsigned>(WebCore::CompositingReasonTransformWi thCompositedDescendants), WebCompositingReasons_enum_does_not_match_webcore); | |
101 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonOpacityWithComposi tedDescendants) == static_cast<unsigned>(WebCore::CompositingReasonOpacityWithCo mpositedDescendants), WebCompositingReasons_enum_does_not_match_webcore); | |
102 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonMaskWithComposited Descendants) == static_cast<unsigned>(WebCore::CompositingReasonMaskWithComposit edDescendants), WebCompositingReasons_enum_does_not_match_webcore); | |
103 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonReflectionWithComp ositedDescendants) == static_cast<unsigned>(WebCore::CompositingReasonReflection WithCompositedDescendants), WebCompositingReasons_enum_does_not_match_webcore); | |
104 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonFilterWithComposit edDescendants) == static_cast<unsigned>(WebCore::CompositingReasonFilterWithComp ositedDescendants), WebCompositingReasons_enum_does_not_match_webcore); | |
105 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonBlendingWithCompos itedDescendants) == static_cast<unsigned>(WebCore::CompositingReasonBlendingWith CompositedDescendants), WebCompositingReasons_enum_does_not_match_webcore); | |
106 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonClipsCompositingDe scendants) == static_cast<unsigned>(WebCore::CompositingReasonClipsCompositingDe scendants), WebCompositingReasons_enum_does_not_match_webcore); | |
107 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonPerspective) == st atic_cast<unsigned>(WebCore::CompositingReasonPerspective), WebCompositingReason s_enum_does_not_match_webcore); | |
108 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonPreserve3D) == sta tic_cast<unsigned>(WebCore::CompositingReasonPreserve3D), WebCompositingReasons_ enum_does_not_match_webcore); | |
109 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonReflectionOfCompos itedParent) == static_cast<unsigned>(WebCore::CompositingReasonReflectionOfCompo sitedParent), WebCompositingReasons_enum_does_not_match_webcore); | |
110 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonRoot) == static_ca st<unsigned>(WebCore::CompositingReasonRoot), WebCompositingReasons_enum_does_no t_match_webcore); | |
111 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonLayerForClip) == s tatic_cast<unsigned>(WebCore::CompositingReasonLayerForClip), WebCompositingReas ons_enum_does_not_match_webcore); | |
112 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonLayerForDescendant Clip) == static_cast<unsigned>(WebCore::CompositingReasonLayerForDescendantClip) , WebCompositingReasons_enum_does_not_match_webcore); | |
113 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonLayerForScrollbar) == static_cast<unsigned>(WebCore::CompositingReasonLayerForScrollbar), WebCompo sitingReasons_enum_does_not_match_webcore); | |
114 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonsLayerForScrolling Container) == static_cast<unsigned>(WebCore::CompositingReasonsLayerForScrolling Container), WebCompositingReasons_enum_does_not_match_webcore); | |
115 COMPILE_ASSERT(static_cast<unsigned>(WebKit::CompositingReasonsLayerForForegroun d) == static_cast<unsigned>(WebCore::CompositingReasonsLayerForForeground), WebC ompositingReasons_enum_does_not_match_webcore); | |
116 #endif | |
117 | |
118 } // namespace WebKit | |
119 | |
120 #endif // WebCompositingReasons_h | |
OLD | NEW |