| OLD | NEW |
| (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 "cc/blink/mutation_conversions.h" |
| 6 |
| 7 namespace cc_blink { |
| 8 |
| 9 void convertToBlinkMutations(const cc::LayerTreeMutationMap& source, |
| 10 blink::WebMutationMap* destination) { |
| 11 for (const auto& iter : source) { |
| 12 const cc::LayerTreeMutation& src_mutation = iter.second; |
| 13 blink::WebMutation& dest_mutation = (*destination)[iter.first]; |
| 14 if (src_mutation.is_opacity_mutated()) |
| 15 dest_mutation.setOpacity(src_mutation.opacity()); |
| 16 if (src_mutation.is_scroll_left_mutated()) |
| 17 dest_mutation.setScrollLeft(src_mutation.scroll_left()); |
| 18 if (src_mutation.is_scroll_top_mutated()) |
| 19 dest_mutation.setScrollTop(src_mutation.scroll_top()); |
| 20 if (src_mutation.is_transform_mutated()) |
| 21 dest_mutation.setTransform(src_mutation.transform()); |
| 22 } |
| 23 } |
| 24 |
| 25 void convertFromBlinkMutations(const blink::WebMutationMap& source, |
| 26 cc::LayerTreeMutationMap* destination) { |
| 27 for (const auto& iter : source) { |
| 28 const blink::WebMutation& src_mutation = iter.second; |
| 29 cc::LayerTreeMutation& dest_mutation = (*destination)[iter.first]; |
| 30 if (src_mutation.isOpacityMutated()) |
| 31 dest_mutation.SetOpacity(src_mutation.opacity()); |
| 32 if (src_mutation.isScrollLeftMutated()) |
| 33 dest_mutation.SetScrollLeft(src_mutation.scrollLeft()); |
| 34 if (src_mutation.isScrollTopMutated()) |
| 35 dest_mutation.SetScrollTop(src_mutation.scrollTop()); |
| 36 if (src_mutation.isTransformMutated()) |
| 37 dest_mutation.SetTransform(src_mutation.transform()); |
| 38 } |
| 39 } |
| 40 |
| 41 } // namespace cc_blink |
| OLD | NEW |