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

Unified Diff: cc/blink/mutation_conversions.cc

Issue 1547893003: WIP - compositor worker mega patch. 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
« no previous file with comments | « cc/blink/mutation_conversions.h ('k') | cc/blink/web_compositor_mutable_state_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/mutation_conversions.cc
diff --git a/cc/blink/mutation_conversions.cc b/cc/blink/mutation_conversions.cc
new file mode 100644
index 0000000000000000000000000000000000000000..32d4d6d6e0fe3c77f24ee538e2c9a05f1172d8da
--- /dev/null
+++ b/cc/blink/mutation_conversions.cc
@@ -0,0 +1,41 @@
+// 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 "cc/blink/mutation_conversions.h"
+
+namespace cc_blink {
+
+void convertToBlinkMutations(const cc::LayerTreeMutationMap& source,
+ blink::WebMutationMap* destination) {
+ for (const auto& iter : source) {
+ const cc::LayerTreeMutation& src_mutation = iter.second;
+ blink::WebMutation& dest_mutation = (*destination)[iter.first];
+ if (src_mutation.is_opacity_mutated())
+ dest_mutation.setOpacity(src_mutation.opacity());
+ if (src_mutation.is_scroll_left_mutated())
+ dest_mutation.setScrollLeft(src_mutation.scroll_left());
+ if (src_mutation.is_scroll_top_mutated())
+ dest_mutation.setScrollTop(src_mutation.scroll_top());
+ if (src_mutation.is_transform_mutated())
+ dest_mutation.setTransform(src_mutation.transform());
+ }
+}
+
+void convertFromBlinkMutations(const blink::WebMutationMap& source,
+ cc::LayerTreeMutationMap* destination) {
+ for (const auto& iter : source) {
+ const blink::WebMutation& src_mutation = iter.second;
+ cc::LayerTreeMutation& dest_mutation = (*destination)[iter.first];
+ if (src_mutation.isOpacityMutated())
+ dest_mutation.SetOpacity(src_mutation.opacity());
+ if (src_mutation.isScrollLeftMutated())
+ dest_mutation.SetScrollLeft(src_mutation.scrollLeft());
+ if (src_mutation.isScrollTopMutated())
+ dest_mutation.SetScrollTop(src_mutation.scrollTop());
+ if (src_mutation.isTransformMutated())
+ dest_mutation.SetTransform(src_mutation.transform());
+ }
+}
+
+} // namespace cc_blink
« no previous file with comments | « cc/blink/mutation_conversions.h ('k') | cc/blink/web_compositor_mutable_state_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698