| Index: third_party/WebKit/Source/core/dom/CompositorProxiedPropertySet.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/CompositorProxiedPropertySet.cpp b/third_party/WebKit/Source/core/dom/CompositorProxiedPropertySet.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..51a63bd64910964a318c320f6ecb436a0e8e2598
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/dom/CompositorProxiedPropertySet.cpp
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "config.h"
|
| +#include "core/dom/CompositorProxiedPropertySet.h"
|
| +
|
| +namespace blink {
|
| +
|
| +PassOwnPtrWillBeRawPtr<CompositorProxiedPropertySet> CompositorProxiedPropertySet::create()
|
| +{
|
| + return adoptPtrWillBeNoop(new CompositorProxiedPropertySet);
|
| +}
|
| +
|
| +CompositorProxiedPropertySet::CompositorProxiedPropertySet()
|
| +{
|
| + memset(m_counts, 0, sizeof(m_counts));
|
| +}
|
| +
|
| +CompositorProxiedPropertySet::~CompositorProxiedPropertySet() {}
|
| +
|
| +bool CompositorProxiedPropertySet::isEmpty() const
|
| +{
|
| + return !proxiedProperties();
|
| +}
|
| +
|
| +void CompositorProxiedPropertySet::increment(uint32_t mutableProperties)
|
| +{
|
| + for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) {
|
| + if (mutableProperties & (1 << i))
|
| + ++m_counts[i];
|
| + }
|
| +}
|
| +
|
| +void CompositorProxiedPropertySet::decrement(uint32_t mutableProperties)
|
| +{
|
| + for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) {
|
| + if (mutableProperties & (1 << i)) {
|
| + ASSERT(m_counts[i]);
|
| + --m_counts[i];
|
| + }
|
| + }
|
| +}
|
| +
|
| +uint32_t CompositorProxiedPropertySet::proxiedProperties() const
|
| +{
|
| + uint32_t properties = WebCompositorMutablePropertyNone;
|
| + for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) {
|
| + if (m_counts[i])
|
| + properties |= 1 << i;
|
| + }
|
| + return properties;
|
| +}
|
| +
|
| +} // namespace blink
|
|
|