| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "core/dom/CompositorProxiedPropertySet.h" | 5 #include "core/dom/CompositorProxiedPropertySet.h" |
| 6 | 6 |
| 7 #include "wtf/PassOwnPtr.h" | 7 #include "wtf/PassOwnPtr.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 PassOwnPtr<CompositorProxiedPropertySet> CompositorProxiedPropertySet::create() | 11 PassOwnPtr<CompositorProxiedPropertySet> CompositorProxiedPropertySet::create() |
| 12 { | 12 { |
| 13 return adoptPtr(new CompositorProxiedPropertySet); | 13 return adoptPtr(new CompositorProxiedPropertySet); |
| 14 } | 14 } |
| 15 | 15 |
| 16 CompositorProxiedPropertySet::CompositorProxiedPropertySet() | 16 CompositorProxiedPropertySet::CompositorProxiedPropertySet() |
| 17 { | 17 { |
| 18 memset(m_counts, 0, sizeof(m_counts)); | 18 memset(m_counts, 0, sizeof(m_counts)); |
| 19 } | 19 } |
| 20 | 20 |
| 21 CompositorProxiedPropertySet::~CompositorProxiedPropertySet() {} | 21 CompositorProxiedPropertySet::~CompositorProxiedPropertySet() {} |
| 22 | 22 |
| 23 bool CompositorProxiedPropertySet::isEmpty() const | 23 bool CompositorProxiedPropertySet::isEmpty() const |
| 24 { | 24 { |
| 25 return !proxiedProperties(); | 25 return !proxiedProperties(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void CompositorProxiedPropertySet::increment(uint32_t mutableProperties) | 28 void CompositorProxiedPropertySet::increment(uint32_t mutableProperties) |
| 29 { | 29 { |
| 30 for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) { | 30 for (int i = 0; i < CompositorMutableProperty::kNumProperties; ++i) { |
| 31 if (mutableProperties & (1 << i)) | 31 if (mutableProperties & (1 << i)) |
| 32 ++m_counts[i]; | 32 ++m_counts[i]; |
| 33 } | 33 } |
| 34 } | 34 } |
| 35 | 35 |
| 36 void CompositorProxiedPropertySet::decrement(uint32_t mutableProperties) | 36 void CompositorProxiedPropertySet::decrement(uint32_t mutableProperties) |
| 37 { | 37 { |
| 38 for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) { | 38 for (int i = 0; i < CompositorMutableProperty::kNumProperties; ++i) { |
| 39 if (mutableProperties & (1 << i)) { | 39 if (mutableProperties & (1 << i)) { |
| 40 ASSERT(m_counts[i]); | 40 ASSERT(m_counts[i]); |
| 41 --m_counts[i]; | 41 --m_counts[i]; |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 uint32_t CompositorProxiedPropertySet::proxiedProperties() const | 46 uint32_t CompositorProxiedPropertySet::proxiedProperties() const |
| 47 { | 47 { |
| 48 uint32_t properties = WebCompositorMutablePropertyNone; | 48 uint32_t properties = CompositorMutableProperty::kNone; |
| 49 for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) { | 49 for (int i = 0; i < CompositorMutableProperty::kNumProperties; ++i) { |
| 50 if (m_counts[i]) | 50 if (m_counts[i]) |
| 51 properties |= 1 << i; | 51 properties |= 1 << i; |
| 52 } | 52 } |
| 53 return properties; | 53 return properties; |
| 54 } | 54 } |
| 55 | 55 |
| 56 } // namespace blink | 56 } // namespace blink |
| OLD | NEW |