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

Side by Side 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: fix rebase error. 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698