OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/blink/web_layer_impl.h" | 5 #include "cc/blink/web_layer_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
17 #include "base/trace_event/trace_event_impl.h" | 17 #include "base/trace_event/trace_event_impl.h" |
18 #include "cc/animation/animation.h" | 18 #include "cc/animation/animation.h" |
19 #include "cc/animation/mutable_properties.h" | |
20 #include "cc/base/region.h" | 19 #include "cc/base/region.h" |
21 #include "cc/base/switches.h" | 20 #include "cc/base/switches.h" |
22 #include "cc/blink/web_animation_impl.h" | 21 #include "cc/blink/web_animation_impl.h" |
23 #include "cc/blink/web_blend_mode.h" | 22 #include "cc/blink/web_blend_mode.h" |
24 #include "cc/blink/web_filter_operations_impl.h" | 23 #include "cc/blink/web_filter_operations_impl.h" |
25 #include "cc/blink/web_to_cc_animation_delegate_adapter.h" | 24 #include "cc/blink/web_to_cc_animation_delegate_adapter.h" |
26 #include "cc/layers/layer.h" | 25 #include "cc/layers/layer.h" |
27 #include "cc/layers/layer_position_constraint.h" | 26 #include "cc/layers/layer_position_constraint.h" |
28 #include "cc/layers/layer_settings.h" | 27 #include "cc/layers/layer_settings.h" |
29 #include "cc/trees/layer_tree_host.h" | 28 #include "cc/trees/layer_tree_host.h" |
30 #include "third_party/WebKit/public/platform/WebCompositorMutableProperties.h" | |
31 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 29 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
32 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 30 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
33 #include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h" | 31 #include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h" |
34 #include "third_party/WebKit/public/platform/WebLayerScrollClient.h" | 32 #include "third_party/WebKit/public/platform/WebLayerScrollClient.h" |
35 #include "third_party/WebKit/public/platform/WebSize.h" | 33 #include "third_party/WebKit/public/platform/WebSize.h" |
36 #include "third_party/skia/include/utils/SkMatrix44.h" | 34 #include "third_party/skia/include/utils/SkMatrix44.h" |
37 #include "ui/gfx/geometry/rect_conversions.h" | 35 #include "ui/gfx/geometry/rect_conversions.h" |
38 #include "ui/gfx/geometry/vector2d_conversions.h" | 36 #include "ui/gfx/geometry/vector2d_conversions.h" |
39 | 37 |
40 using cc::Animation; | 38 using cc::Animation; |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } | 554 } |
557 | 555 |
558 void WebLayerImpl::setElementId(uint64_t id) { | 556 void WebLayerImpl::setElementId(uint64_t id) { |
559 layer_->SetElementId(id); | 557 layer_->SetElementId(id); |
560 } | 558 } |
561 | 559 |
562 uint64_t WebLayerImpl::elementId() const { | 560 uint64_t WebLayerImpl::elementId() const { |
563 return layer_->element_id(); | 561 return layer_->element_id(); |
564 } | 562 } |
565 | 563 |
566 static_assert( | |
567 static_cast<cc::MutableProperty>(blink::WebCompositorMutablePropertyNone) == | |
568 cc::kMutablePropertyNone, | |
569 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
570 | |
571 static_assert( | |
572 static_cast<cc::MutableProperty>( | |
573 blink::WebCompositorMutablePropertyOpacity) == | |
574 cc::kMutablePropertyOpacity, | |
575 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
576 | |
577 static_assert( | |
578 static_cast<cc::MutableProperty>( | |
579 blink::WebCompositorMutablePropertyScrollLeft) == | |
580 cc::kMutablePropertyScrollLeft, | |
581 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
582 | |
583 static_assert( | |
584 static_cast<cc::MutableProperty>( | |
585 blink::WebCompositorMutablePropertyScrollTop) == | |
586 cc::kMutablePropertyScrollTop, | |
587 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
588 | |
589 static_assert( | |
590 static_cast<cc::MutableProperty>( | |
591 blink::WebCompositorMutablePropertyTransform) == | |
592 cc::kMutablePropertyTransform, | |
593 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
594 | |
595 void WebLayerImpl::setCompositorMutableProperties(uint32_t properties) { | 564 void WebLayerImpl::setCompositorMutableProperties(uint32_t properties) { |
596 layer_->SetMutableProperties(properties); | 565 layer_->SetMutableProperties(properties); |
597 } | 566 } |
598 | 567 |
599 uint32_t WebLayerImpl::compositorMutableProperties() const { | 568 uint32_t WebLayerImpl::compositorMutableProperties() const { |
600 return layer_->mutable_properties(); | 569 return layer_->mutable_properties(); |
601 } | 570 } |
602 | 571 |
603 void WebLayerImpl::setScrollParent(blink::WebLayer* parent) { | 572 void WebLayerImpl::setScrollParent(blink::WebLayer* parent) { |
604 cc::Layer* scroll_parent = nullptr; | 573 cc::Layer* scroll_parent = nullptr; |
(...skipping 11 matching lines...) Expand all Loading... |
616 | 585 |
617 Layer* WebLayerImpl::layer() const { | 586 Layer* WebLayerImpl::layer() const { |
618 return layer_.get(); | 587 return layer_.get(); |
619 } | 588 } |
620 | 589 |
621 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { | 590 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { |
622 contents_opaque_is_fixed_ = fixed; | 591 contents_opaque_is_fixed_ = fixed; |
623 } | 592 } |
624 | 593 |
625 } // namespace cc_blink | 594 } // namespace cc_blink |
OLD | NEW |