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

Unified Diff: third_party/WebKit/Source/core/dom/CompositorProxiedPropertySet.cpp

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698