OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "webkit/renderer/compositor_bindings/web_layer_impl.h" | 5 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/base/region.h" | 9 #include "cc/base/region.h" |
10 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
11 #include "cc/layers/layer_position_constraint.h" | 11 #include "cc/layers/layer_position_constraint.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebCompositingReaso
ns.h" | |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerPositionCon
straint.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerPositionCon
straint.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
17 #include "third_party/skia/include/utils/SkMatrix44.h" | 16 #include "third_party/skia/include/utils/SkMatrix44.h" |
18 #include "webkit/renderer/compositor_bindings/web_animation_impl.h" | 17 #include "webkit/renderer/compositor_bindings/web_animation_impl.h" |
19 | 18 |
20 using cc::Animation; | 19 using cc::Animation; |
21 using cc::Layer; | 20 using cc::Layer; |
22 using WebKit::WebLayer; | 21 using WebKit::WebLayer; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 163 |
165 void WebLayerImpl::setFilter(SkImageFilter* filter) { | 164 void WebLayerImpl::setFilter(SkImageFilter* filter) { |
166 layer_->SetFilter(skia::SharePtr(filter)); | 165 layer_->SetFilter(skia::SharePtr(filter)); |
167 } | 166 } |
168 | 167 |
169 void WebLayerImpl::setDebugName(WebKit::WebString name) { | 168 void WebLayerImpl::setDebugName(WebKit::WebString name) { |
170 layer_->SetDebugName( | 169 layer_->SetDebugName( |
171 UTF16ToASCII(base::string16(name.data(), name.length()))); | 170 UTF16ToASCII(base::string16(name.data(), name.length()))); |
172 } | 171 } |
173 | 172 |
174 void WebLayerImpl::setCompositingReasons( | |
175 WebKit::WebCompositingReasons reasons) { | |
176 layer_->SetCompositingReasons(reasons); | |
177 } | |
178 | |
179 void WebLayerImpl::setAnimationDelegate( | 173 void WebLayerImpl::setAnimationDelegate( |
180 WebKit::WebAnimationDelegate* delegate) { | 174 WebKit::WebAnimationDelegate* delegate) { |
181 layer_->set_layer_animation_delegate(delegate); | 175 layer_->set_layer_animation_delegate(delegate); |
182 } | 176 } |
183 | 177 |
184 bool WebLayerImpl::addAnimation(WebKit::WebAnimation* animation) { | 178 bool WebLayerImpl::addAnimation(WebKit::WebAnimation* animation) { |
185 return layer_->AddAnimation( | 179 return layer_->AddAnimation( |
186 static_cast<WebAnimationImpl*>(animation)->CloneToAnimation()); | 180 static_cast<WebAnimationImpl*>(animation)->CloneToAnimation()); |
187 } | 181 } |
188 | 182 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 void WebLayerImpl::setScrollClient( | 342 void WebLayerImpl::setScrollClient( |
349 WebKit::WebLayerScrollClient* scroll_client) { | 343 WebKit::WebLayerScrollClient* scroll_client) { |
350 layer_->set_layer_scroll_client(scroll_client); | 344 layer_->set_layer_scroll_client(scroll_client); |
351 } | 345 } |
352 | 346 |
353 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); } | 347 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); } |
354 | 348 |
355 Layer* WebLayerImpl::layer() const { return layer_.get(); } | 349 Layer* WebLayerImpl::layer() const { return layer_.get(); } |
356 | 350 |
357 } // namespace WebKit | 351 } // namespace WebKit |
OLD | NEW |