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
14 /* static */ const Array
<
15 DisplayItemType
, nsCSSPropertyIDSet::CompositorAnimatableDisplayItemCount()>
16 LayerAnimationInfo::sDisplayItemTypes
= {
17 DisplayItemType::TYPE_BACKGROUND_COLOR
,
18 DisplayItemType::TYPE_OPACITY
,
19 DisplayItemType::TYPE_TRANSFORM
,
23 DisplayItemType
LayerAnimationInfo::GetDisplayItemTypeForProperty(
24 nsCSSPropertyID 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
;
42 return DisplayItemType::TYPE_ZERO
;
45 } // namespace mozilla