| OLD | NEW |
| 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/trees/target_property.h" | 5 #include "cc/trees/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, | 13 static_assert(TargetProperty::FIRST_TARGET_PROPERTY == 0, |
| 14 "TargetProperty must be 0-based enum"); | 14 "TargetProperty must be 0-based enum"); |
| 15 | 15 |
| 16 // This should match the TargetProperty enum. | 16 // This should match the TargetProperty enum. |
| 17 static const char* const s_targetPropertyNames[] = { | 17 static const char* const s_targetPropertyNames[] = { |
| 18 "TRANSFORM", "OPACITY", "FILTER", "SCROLL_OFFSET", "BACKGROUND_COLOR"}; | 18 "TRANSFORM", "OPACITY", "FILTER", |
| 19 "SCROLL_OFFSET", "BACKGROUND_COLOR", "BOUNDS"}; |
| 19 | 20 |
| 20 static_assert(static_cast<int>(TargetProperty::LAST_TARGET_PROPERTY) + 1 == | 21 static_assert(static_cast<int>(TargetProperty::LAST_TARGET_PROPERTY) + 1 == |
| 21 arraysize(s_targetPropertyNames), | 22 arraysize(s_targetPropertyNames), |
| 22 "TargetPropertyEnumSize should equal the number of elements in " | 23 "TargetPropertyEnumSize should equal the number of elements in " |
| 23 "s_targetPropertyNames"); | 24 "s_targetPropertyNames"); |
| 24 | 25 |
| 25 } // namespace | 26 } // namespace |
| 26 | 27 |
| 27 const char* TargetProperty::GetName(TargetProperty::Type property) { | 28 const char* TargetProperty::GetName(TargetProperty::Type property) { |
| 28 return s_targetPropertyNames[property]; | 29 return s_targetPropertyNames[property]; |
| 29 } | 30 } |
| 30 | 31 |
| 31 } // namespace cc | 32 } // namespace cc |
| OLD | NEW |