Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3620)

Unified Diff: cc/animation/animation.cc

Issue 1700653002: CC Animation: Expose TargetProperty enum to be aliased in Blink Platform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/animation.h ('k') | cc/animation/animation_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation.cc
diff --git a/cc/animation/animation.cc b/cc/animation/animation.cc
index dfdaeb70e9c0f3ed4c9260547357ccd071223a9e..5c6fcd0f2a14048871980070547161ebacce640b 100644
--- a/cc/animation/animation.cc
+++ b/cc/animation/animation.cc
@@ -27,27 +27,14 @@ static_assert(static_cast<int>(cc::Animation::LAST_RUN_STATE) + 1 ==
"RunStateEnumSize should equal the number of elements in "
"s_runStateNames");
-// This should match the TargetProperty enum.
-static const char* const s_targetPropertyNames[] = {"TRANSFORM",
- "OPACITY",
- "FILTER",
- "SCROLL_OFFSET",
- "BACKGROUND_COLOR"};
-
-static_assert(static_cast<int>(cc::Animation::LAST_TARGET_PROPERTY) + 1 ==
- arraysize(s_targetPropertyNames),
- "TargetPropertyEnumSize should equal the number of elements in "
- "s_targetPropertyNames");
-
} // namespace
namespace cc {
-scoped_ptr<Animation> Animation::Create(
- scoped_ptr<AnimationCurve> curve,
- int animation_id,
- int group_id,
- TargetProperty target_property) {
+scoped_ptr<Animation> Animation::Create(scoped_ptr<AnimationCurve> curve,
+ int animation_id,
+ int group_id,
+ TargetProperty::Type target_property) {
return make_scoped_ptr(
new Animation(std::move(curve), animation_id, group_id, target_property));
}
@@ -55,7 +42,7 @@ scoped_ptr<Animation> Animation::Create(
Animation::Animation(scoped_ptr<AnimationCurve> curve,
int animation_id,
int group_id,
- TargetProperty target_property)
+ TargetProperty::Type target_property)
: curve_(std::move(curve)),
id_(animation_id),
group_(group_id),
@@ -85,11 +72,8 @@ void Animation::SetRunState(RunState run_state,
return;
char name_buffer[256];
- base::snprintf(name_buffer,
- sizeof(name_buffer),
- "%s-%d",
- s_targetPropertyNames[target_property_],
- group_);
+ base::snprintf(name_buffer, sizeof(name_buffer), "%s-%d",
+ TargetProperty::GetName(target_property_), group_);
bool is_waiting_to_start =
run_state_ == WAITING_FOR_TARGET_AVAILABILITY || run_state_ == STARTING;
« no previous file with comments | « cc/animation/animation.h ('k') | cc/animation/animation_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698