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

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

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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/ProxiedPropertyCounts.cpp
diff --git a/third_party/WebKit/Source/core/dom/ProxiedPropertyCounts.cpp b/third_party/WebKit/Source/core/dom/ProxiedPropertyCounts.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1cf7f079ca3c1fe862d84cda51bb2402ea189765
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/ProxiedPropertyCounts.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/ProxiedPropertyCounts.h"
+
+namespace blink {
+
+PassOwnPtrWillBeRawPtr<ProxiedPropertyCounts> ProxiedPropertyCounts::create()
+{
+ return adoptPtrWillBeNoop(new ProxiedPropertyCounts);
+}
+
+ProxiedPropertyCounts::ProxiedPropertyCounts()
+{
+ memset(m_counts, 0, sizeof(m_counts));
+}
+
+ProxiedPropertyCounts::~ProxiedPropertyCounts() {}
+
+bool ProxiedPropertyCounts::empty() const
+{
+ return !proxiedProperties();
+}
+
+void ProxiedPropertyCounts::increment(uint32_t mutableProperties)
+{
+ for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) {
+ if (mutableProperties & (1 << i))
+ ++m_counts[i];
+ }
+}
+
+void ProxiedPropertyCounts::decrement(uint32_t mutableProperties)
+{
+ for (int i = 0; i < kNumWebCompositorMutableProperties; ++i) {
+ if (mutableProperties & (1 << i)) {
+ ASSERT(m_counts[i]);
+ --m_counts[i];
+ }
+ }
+}
+
+uint32_t ProxiedPropertyCounts::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