| 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
|
|
|