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

Unified Diff: cc/animation/layer_tree_mutation.h

Issue 1447893002: compositor-worker: Introduce WebCompositorMutableState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review feedback. Created 4 years, 11 months 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
« no previous file with comments | « no previous file | cc/blink/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/layer_tree_mutation.h
diff --git a/cc/animation/layer_tree_mutation.h b/cc/animation/layer_tree_mutation.h
new file mode 100644
index 0000000000000000000000000000000000000000..0fdd592f823b1f0f48f04106a23025188334890a
--- /dev/null
+++ b/cc/animation/layer_tree_mutation.h
@@ -0,0 +1,63 @@
+// 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.
+
+#ifndef CC_ANIMATION_LAYER_TREE_MUTATION_H_
+#define CC_ANIMATION_LAYER_TREE_MUTATION_H_
+
+#include "base/containers/hash_tables.h"
+#include "cc/animation/mutable_properties.h"
+#include "third_party/skia/include/utils/SkMatrix44.h"
+
+namespace cc {
+
+class LayerTreeMutation {
+ public:
+ void SetOpacity(float opacity) {
+ mutated_flags_ |= kMutablePropertyOpacity;
+ opacity_ = opacity;
+ }
+ void SetScrollLeft(float scroll_left) {
+ mutated_flags_ |= kMutablePropertyScrollLeft;
+ scroll_left_ = scroll_left;
+ }
+ void SetScrollTop(float scroll_top) {
+ mutated_flags_ |= kMutablePropertyScrollTop;
+ scroll_top_ = scroll_top;
+ }
+ void SetTransform(const SkMatrix44& transform) {
+ mutated_flags_ |= kMutablePropertyTransform;
+ transform_ = transform;
+ }
+
+ bool is_opacity_mutated() const {
+ return !!(mutated_flags_ & kMutablePropertyOpacity);
+ }
+ bool is_scroll_left_mutated() const {
+ return !!(mutated_flags_ & kMutablePropertyScrollLeft);
+ }
+ bool is_scroll_top_mutated() const {
+ return !!(mutated_flags_ & kMutablePropertyScrollTop);
+ }
+ bool is_transform_mutated() const {
+ return !!(mutated_flags_ & kMutablePropertyTransform);
+ }
+
+ float opacity() const { return opacity_; }
+ float scroll_left() const { return scroll_left_; }
+ float scroll_top() const { return scroll_top_; }
+ SkMatrix44 transform() const { return transform_; }
+
+ private:
+ uint32_t mutated_flags_ = 0;
+ float opacity_ = 0;
+ float scroll_left_ = 0;
+ float scroll_top_ = 0;
+ SkMatrix44 transform_;
+};
+
+typedef base::hash_map<uint64_t, LayerTreeMutation> LayerTreeMutationMap;
+
+} // namespace cc
+
+#endif // CC_ANIMATION_LAYER_TREE_MUTATION_H_
« no previous file with comments | « no previous file | cc/blink/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698