Bug 1216030 - Part 6: Add KeyframeEffectReadOnly::IsGeometricProperty. r=bbirtles

This method will be private soon.
This commit is contained in:
Hiroyuki Ikezoe 2015-11-06 02:38:00 +01:00
Родитель 74c73fa482
Коммит 84322d36f1
4 изменённых файлов: 19 добавлений и 19 удалений

Просмотреть файл

@ -1710,6 +1710,23 @@ KeyframeEffectReadOnly::GetFrames(JSContext*& aCx,
}
}
/* static */ bool
KeyframeEffectReadOnly::IsGeometricProperty(
const nsCSSProperty aProperty)
{
switch (aProperty) {
case eCSSProperty_bottom:
case eCSSProperty_height:
case eCSSProperty_left:
case eCSSProperty_right:
case eCSSProperty_top:
case eCSSProperty_width:
return true;
default:
return false;
}
}
/* static */ bool
KeyframeEffectReadOnly::CanAnimateTransformOnCompositor(
const nsIFrame* aFrame,

Просмотреть файл

@ -284,6 +284,7 @@ public:
// If |aContent| is nullptr, no logging is performed
static bool CanAnimateTransformOnCompositor(const nsIFrame* aFrame,
const nsIContent* aContent);
static bool IsGeometricProperty(const nsCSSProperty aProperty);
protected:
virtual ~KeyframeEffectReadOnly();
void ResetIsRunningOnCompositor();

Просмотреть файл

@ -35,22 +35,6 @@ using mozilla::dom::KeyframeEffectReadOnly;
namespace mozilla {
/* static */ bool
IsGeometricProperty(nsCSSProperty aProperty)
{
switch (aProperty) {
case eCSSProperty_bottom:
case eCSSProperty_height:
case eCSSProperty_left:
case eCSSProperty_right:
case eCSSProperty_top:
case eCSSProperty_width:
return true;
default:
return false;
}
}
CommonAnimationManager::CommonAnimationManager(nsPresContext *aPresContext)
: mPresContext(aPresContext)
{
@ -448,7 +432,7 @@ AnimationCollection::CanAnimatePropertyOnCompositor(
{
bool shouldLog = nsLayoutUtils::IsAnimationLoggingEnabled();
if (IsGeometricProperty(aProperty)) {
if (KeyframeEffectReadOnly::IsGeometricProperty(aProperty)) {
if (shouldLog) {
nsCString message;
message.AppendLiteral("Performance warning: Async animation of "

Просмотреть файл

@ -37,8 +37,6 @@ namespace mozilla {
class RestyleTracker;
struct AnimationCollection;
bool IsGeometricProperty(nsCSSProperty aProperty);
class CommonAnimationManager : public nsIStyleRuleProcessor {
public:
explicit CommonAnimationManager(nsPresContext *aPresContext);