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/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
16 #include "base/trace_event/trace_event_impl.h" | 16 #include "base/trace_event/trace_event_impl.h" |
17 #include "cc/base/region.h" | 17 #include "cc/base/region.h" |
18 #include "cc/base/switches.h" | 18 #include "cc/base/switches.h" |
19 #include "cc/blink/web_blend_mode.h" | 19 #include "cc/blink/web_blend_mode.h" |
20 #include "cc/layers/layer.h" | 20 #include "cc/layers/layer.h" |
21 #include "cc/layers/layer_position_constraint.h" | 21 #include "cc/layers/layer_position_constraint.h" |
22 #include "cc/layers/layer_settings.h" | |
23 #include "cc/trees/layer_tree_host.h" | 22 #include "cc/trees/layer_tree_host.h" |
24 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 23 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
25 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 24 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
26 #include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h" | 25 #include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h" |
27 #include "third_party/WebKit/public/platform/WebLayerScrollClient.h" | 26 #include "third_party/WebKit/public/platform/WebLayerScrollClient.h" |
28 #include "third_party/WebKit/public/platform/WebSize.h" | 27 #include "third_party/WebKit/public/platform/WebSize.h" |
29 #include "third_party/skia/include/utils/SkMatrix44.h" | 28 #include "third_party/skia/include/utils/SkMatrix44.h" |
30 #include "ui/gfx/geometry/rect_conversions.h" | 29 #include "ui/gfx/geometry/rect_conversions.h" |
31 #include "ui/gfx/geometry/vector2d_conversions.h" | 30 #include "ui/gfx/geometry/vector2d_conversions.h" |
32 | 31 |
33 using cc::Layer; | 32 using cc::Layer; |
34 using blink::WebLayer; | 33 using blink::WebLayer; |
35 using blink::WebFloatPoint; | 34 using blink::WebFloatPoint; |
36 using blink::WebVector; | 35 using blink::WebVector; |
37 using blink::WebRect; | 36 using blink::WebRect; |
38 using blink::WebSize; | 37 using blink::WebSize; |
39 using blink::WebColor; | 38 using blink::WebColor; |
40 | 39 |
41 namespace cc_blink { | 40 namespace cc_blink { |
42 | 41 |
43 WebLayerImpl::WebLayerImpl() | 42 WebLayerImpl::WebLayerImpl() |
44 : layer_(Layer::Create(cc::LayerSettings())), | 43 : layer_(Layer::Create()), contents_opaque_is_fixed_(false) {} |
45 contents_opaque_is_fixed_(false) {} | |
46 | 44 |
47 WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) | 45 WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) |
48 : layer_(layer), contents_opaque_is_fixed_(false) { | 46 : layer_(layer), contents_opaque_is_fixed_(false) { |
49 } | 47 } |
50 | 48 |
51 WebLayerImpl::~WebLayerImpl() { | 49 WebLayerImpl::~WebLayerImpl() { |
52 layer_->SetLayerClient(nullptr); | 50 layer_->SetLayerClient(nullptr); |
53 } | 51 } |
54 | 52 |
55 int WebLayerImpl::id() const { | 53 int WebLayerImpl::id() const { |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 446 |
449 Layer* WebLayerImpl::layer() const { | 447 Layer* WebLayerImpl::layer() const { |
450 return layer_.get(); | 448 return layer_.get(); |
451 } | 449 } |
452 | 450 |
453 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { | 451 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { |
454 contents_opaque_is_fixed_ = fixed; | 452 contents_opaque_is_fixed_ = fixed; |
455 } | 453 } |
456 | 454 |
457 } // namespace cc_blink | 455 } // namespace cc_blink |
OLD | NEW |