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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 } | 507 } |
510 | 508 |
511 void WebLayerImpl::setElementId(uint64_t id) { | 509 void WebLayerImpl::setElementId(uint64_t id) { |
512 layer_->SetElementId(id); | 510 layer_->SetElementId(id); |
513 } | 511 } |
514 | 512 |
515 uint64_t WebLayerImpl::elementId() const { | 513 uint64_t WebLayerImpl::elementId() const { |
516 return layer_->element_id(); | 514 return layer_->element_id(); |
517 } | 515 } |
518 | 516 |
519 static_assert( | |
520 static_cast<cc::MutableProperty>(blink::WebCompositorMutablePropertyNone) == | |
521 cc::kMutablePropertyNone, | |
522 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
523 | |
524 static_assert( | |
525 static_cast<cc::MutableProperty>( | |
526 blink::WebCompositorMutablePropertyOpacity) == | |
527 cc::kMutablePropertyOpacity, | |
528 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
529 | |
530 static_assert( | |
531 static_cast<cc::MutableProperty>( | |
532 blink::WebCompositorMutablePropertyScrollLeft) == | |
533 cc::kMutablePropertyScrollLeft, | |
534 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
535 | |
536 static_assert( | |
537 static_cast<cc::MutableProperty>( | |
538 blink::WebCompositorMutablePropertyScrollTop) == | |
539 cc::kMutablePropertyScrollTop, | |
540 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
541 | |
542 static_assert( | |
543 static_cast<cc::MutableProperty>( | |
544 blink::WebCompositorMutablePropertyTransform) == | |
545 cc::kMutablePropertyTransform, | |
546 "MutableProperty and WebCompositorMutableProperty enums must match"); | |
547 | |
548 void WebLayerImpl::setCompositorMutableProperties(uint32_t properties) { | 517 void WebLayerImpl::setCompositorMutableProperties(uint32_t properties) { |
549 layer_->SetMutableProperties(properties); | 518 layer_->SetMutableProperties(properties); |
550 } | 519 } |
551 | 520 |
552 uint32_t WebLayerImpl::compositorMutableProperties() const { | 521 uint32_t WebLayerImpl::compositorMutableProperties() const { |
553 return layer_->mutable_properties(); | 522 return layer_->mutable_properties(); |
554 } | 523 } |
555 | 524 |
556 void WebLayerImpl::setScrollParent(blink::WebLayer* parent) { | 525 void WebLayerImpl::setScrollParent(blink::WebLayer* parent) { |
557 cc::Layer* scroll_parent = nullptr; | 526 cc::Layer* scroll_parent = nullptr; |
(...skipping 11 matching lines...) Expand all Loading... |
569 | 538 |
570 Layer* WebLayerImpl::layer() const { | 539 Layer* WebLayerImpl::layer() const { |
571 return layer_.get(); | 540 return layer_.get(); |
572 } | 541 } |
573 | 542 |
574 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { | 543 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { |
575 contents_opaque_is_fixed_ = fixed; | 544 contents_opaque_is_fixed_ = fixed; |
576 } | 545 } |
577 | 546 |
578 } // namespace cc_blink | 547 } // namespace cc_blink |
OLD | NEW |