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

Side by Side Diff: cc/animation/target_property.cc

Issue 2357533002: CC Animation: Use std::bitset to update animation state. (Closed)
Patch Set: Reparent. Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « cc/animation/target_property.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/animation/target_property.h" 5 #include "cc/animation/target_property.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 namespace { 11 namespace {
12 12
13 static_assert(TargetProperty::FIRST_TARGET_PROPERTY == 0,
14 "TargetProperty must be 0-based enum");
15
13 // This should match the TargetProperty enum. 16 // This should match the TargetProperty enum.
14 static const char* const s_targetPropertyNames[] = { 17 static const char* const s_targetPropertyNames[] = {
15 "TRANSFORM", "OPACITY", "FILTER", "SCROLL_OFFSET", "BACKGROUND_COLOR"}; 18 "TRANSFORM", "OPACITY", "FILTER", "SCROLL_OFFSET", "BACKGROUND_COLOR"};
16 19
17 static_assert(static_cast<int>(TargetProperty::LAST_TARGET_PROPERTY) + 1 == 20 static_assert(static_cast<int>(TargetProperty::LAST_TARGET_PROPERTY) + 1 ==
18 arraysize(s_targetPropertyNames), 21 arraysize(s_targetPropertyNames),
19 "TargetPropertyEnumSize should equal the number of elements in " 22 "TargetPropertyEnumSize should equal the number of elements in "
20 "s_targetPropertyNames"); 23 "s_targetPropertyNames");
21 24
22 } // namespace 25 } // namespace
23 26
24 const char* TargetProperty::GetName(TargetProperty::Type property) { 27 const char* TargetProperty::GetName(TargetProperty::Type property) {
25 return s_targetPropertyNames[property]; 28 return s_targetPropertyNames[property];
26 } 29 }
27 30
28 } // namespace cc 31 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/target_property.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698