2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2015-09-03 23:59:00 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "LayerAnimationInfo.h"
|
|
|
|
|
|
|
|
#include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
|
2018-11-07 00:00:50 +03:00
|
|
|
#include "nsCSSPropertyIDSet.h" // For nsCSSPropertyIDSet::CompositorAnimatable
|
2015-09-03 23:59:00 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2019-03-18 21:05:00 +03:00
|
|
|
/* static */ const Array<
|
|
|
|
DisplayItemType, nsCSSPropertyIDSet::CompositorAnimatableDisplayItemCount()>
|
2018-11-13 13:22:24 +03:00
|
|
|
LayerAnimationInfo::sDisplayItemTypes = {
|
2018-11-28 03:58:46 +03:00
|
|
|
DisplayItemType::TYPE_BACKGROUND_COLOR,
|
2018-11-13 13:22:24 +03:00
|
|
|
DisplayItemType::TYPE_OPACITY,
|
|
|
|
DisplayItemType::TYPE_TRANSFORM,
|
|
|
|
};
|
|
|
|
|
2019-02-26 01:09:24 +03:00
|
|
|
/* static */
|
|
|
|
DisplayItemType LayerAnimationInfo::GetDisplayItemTypeForProperty(
|
2018-11-07 00:02:18 +03:00
|
|
|
nsCSSPropertyID aProperty) {
|
|
|
|
switch (aProperty) {
|
2018-11-28 03:58:46 +03:00
|
|
|
case eCSSProperty_background_color:
|
|
|
|
return DisplayItemType::TYPE_BACKGROUND_COLOR;
|
2018-11-07 00:02:18 +03:00
|
|
|
case eCSSProperty_opacity:
|
|
|
|
return DisplayItemType::TYPE_OPACITY;
|
|
|
|
case eCSSProperty_transform:
|
2019-03-18 21:05:00 +03:00
|
|
|
case eCSSProperty_translate:
|
|
|
|
case eCSSProperty_scale:
|
|
|
|
case eCSSProperty_rotate:
|
2019-10-31 23:07:45 +03:00
|
|
|
case eCSSProperty_offset_path:
|
|
|
|
case eCSSProperty_offset_distance:
|
|
|
|
case eCSSProperty_offset_rotate:
|
|
|
|
case eCSSProperty_offset_anchor:
|
2023-06-07 00:40:52 +03:00
|
|
|
case eCSSProperty_offset_position:
|
2018-11-07 00:02:18 +03:00
|
|
|
return DisplayItemType::TYPE_TRANSFORM;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return DisplayItemType::TYPE_ZERO;
|
|
|
|
}
|
|
|
|
|
2015-09-03 23:59:00 +03:00
|
|
|
} // namespace mozilla
|