Bug 1642579 [wpt PR 23909] - [COOP access reporting] Preliminary WPT tests., a=testonly
[gecko.git] / layout / style / LayerAnimationInfo.cpp
blob0da503f52633d5fc791b53bb3c8f52a91d9765a4
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "LayerAnimationInfo.h"
9 #include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
10 #include "nsCSSPropertyIDSet.h" // For nsCSSPropertyIDSet::CompositorAnimatable
12 namespace mozilla {
14 /* static */ const Array<
15 DisplayItemType, nsCSSPropertyIDSet::CompositorAnimatableDisplayItemCount()>
16 LayerAnimationInfo::sDisplayItemTypes = {
17 DisplayItemType::TYPE_BACKGROUND_COLOR,
18 DisplayItemType::TYPE_OPACITY,
19 DisplayItemType::TYPE_TRANSFORM,
22 /* static */
23 DisplayItemType LayerAnimationInfo::GetDisplayItemTypeForProperty(
24 nsCSSPropertyID aProperty) {
25 switch (aProperty) {
26 case eCSSProperty_background_color:
27 return DisplayItemType::TYPE_BACKGROUND_COLOR;
28 case eCSSProperty_opacity:
29 return DisplayItemType::TYPE_OPACITY;
30 case eCSSProperty_transform:
31 case eCSSProperty_translate:
32 case eCSSProperty_scale:
33 case eCSSProperty_rotate:
34 case eCSSProperty_offset_path:
35 case eCSSProperty_offset_distance:
36 case eCSSProperty_offset_rotate:
37 case eCSSProperty_offset_anchor:
38 return DisplayItemType::TYPE_TRANSFORM;
39 default:
40 break;
42 return DisplayItemType::TYPE_ZERO;
45 } // namespace mozilla