OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "core/dom/CompositorProxiedPropertySet.h" |
| 7 |
| 8 namespace blink { |
| 9 |
| 10 PassOwnPtrWillBeRawPtr<CompositorProxiedPropertySet> CompositorProxiedPropertySe
t::create() |
| 11 { |
| 12 return adoptPtrWillBeNoop(new CompositorProxiedPropertySet); |
| 13 } |
| 14 |
| 15 CompositorProxiedPropertySet::CompositorProxiedPropertySet() |
| 16 { |
| 17 memset(m_counts, 0, sizeof(m_counts)); |
| 18 } |
| 19 |
| 20 CompositorProxiedPropertySet::~CompositorProxiedPropertySet() {} |
| 21 |
| 22 bool CompositorProxiedPropertySet::isEmpty() const |
| 23 { |
| 24 return !proxiedProperties(); |
| 25 } |
| 26 |
| 27 void CompositorProxiedPropertySet::increment(uint32_t mutableProperties) |
| 28 { |
| 29 for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) { |
| 30 if (mutableProperties & (1 << i)) |
| 31 ++m_counts[i]; |
| 32 } |
| 33 } |
| 34 |
| 35 void CompositorProxiedPropertySet::decrement(uint32_t mutableProperties) |
| 36 { |
| 37 for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) { |
| 38 if (mutableProperties & (1 << i)) { |
| 39 ASSERT(m_counts[i]); |
| 40 --m_counts[i]; |
| 41 } |
| 42 } |
| 43 } |
| 44 |
| 45 uint32_t CompositorProxiedPropertySet::proxiedProperties() const |
| 46 { |
| 47 uint32_t properties = WebCompositorMutablePropertyNone; |
| 48 for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) { |
| 49 if (m_counts[i]) |
| 50 properties |= 1 << i; |
| 51 } |
| 52 return properties; |
| 53 } |
| 54 |
| 55 } // namespace blink |
OLD | NEW |