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 "config.h" | 5 #include "config.h" |
6 #include "WebLayerImpl.h" | 6 #include "WebLayerImpl.h" |
7 | 7 |
8 #include "SkMatrix44.h" | 8 #include "SkMatrix44.h" |
9 #include "WebAnimationImpl.h" | 9 #include "WebAnimationImpl.h" |
10 #ifdef LOG | 10 #ifdef LOG |
11 #undef LOG | 11 #undef LOG |
12 #endif | 12 #endif |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "cc/active_animation.h" | 14 #include "cc/active_animation.h" |
15 #include "cc/layer.h" | 15 #include "cc/layer.h" |
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
17 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
19 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa
trix.h" | 19 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa
trix.h" |
20 #include "webcore_convert.h" | 20 #include "webcore_convert.h" |
21 | 21 |
22 using cc::CCActiveAnimation; | 22 using cc::ActiveAnimation; |
23 using cc::LayerChromium; | 23 using cc::Layer; |
24 | 24 |
25 namespace WebKit { | 25 namespace WebKit { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 WebTransformationMatrix transformationMatrixFromSkMatrix44(const SkMatrix44& mat
rix) | 29 WebTransformationMatrix transformationMatrixFromSkMatrix44(const SkMatrix44& mat
rix) |
30 { | 30 { |
31 double data[16]; | 31 double data[16]; |
32 matrix.asColMajord(data); | 32 matrix.asColMajord(data); |
33 return WebTransformationMatrix(data[0], data[1], data[2], data[3], | 33 return WebTransformationMatrix(data[0], data[1], data[2], data[3], |
(...skipping 25 matching lines...) Expand all Loading... |
59 } | 59 } |
60 | 60 |
61 } | 61 } |
62 | 62 |
63 WebLayer* WebLayer::create() | 63 WebLayer* WebLayer::create() |
64 { | 64 { |
65 return new WebLayerImpl(); | 65 return new WebLayerImpl(); |
66 } | 66 } |
67 | 67 |
68 WebLayerImpl::WebLayerImpl() | 68 WebLayerImpl::WebLayerImpl() |
69 : m_layer(LayerChromium::create()) | 69 : m_layer(Layer::create()) |
70 { | 70 { |
71 } | 71 } |
72 | 72 |
73 WebLayerImpl::WebLayerImpl(scoped_refptr<LayerChromium> layer) | 73 WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer) |
74 : m_layer(layer) | 74 : m_layer(layer) |
75 { | 75 { |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 WebLayerImpl::~WebLayerImpl() | 79 WebLayerImpl::~WebLayerImpl() |
80 { | 80 { |
81 m_layer->clearRenderSurface(); | 81 m_layer->clearRenderSurface(); |
82 m_layer->setLayerAnimationDelegate(0); | 82 m_layer->setLayerAnimationDelegate(0); |
83 } | 83 } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 m_layer->setDebugName(UTF16ToASCII(string16(name.data(), name.length()))); | 287 m_layer->setDebugName(UTF16ToASCII(string16(name.data(), name.length()))); |
288 } | 288 } |
289 | 289 |
290 void WebLayerImpl::setAnimationDelegate(WebAnimationDelegate* delegate) | 290 void WebLayerImpl::setAnimationDelegate(WebAnimationDelegate* delegate) |
291 { | 291 { |
292 m_layer->setLayerAnimationDelegate(delegate); | 292 m_layer->setLayerAnimationDelegate(delegate); |
293 } | 293 } |
294 | 294 |
295 bool WebLayerImpl::addAnimation(WebAnimation* animation) | 295 bool WebLayerImpl::addAnimation(WebAnimation* animation) |
296 { | 296 { |
297 return m_layer->addAnimation(static_cast<WebAnimationImpl*>(animation)->clon
eToCCAnimation()); | 297 return m_layer->addAnimation(static_cast<WebAnimationImpl*>(animation)->clon
eToAnimation()); |
298 } | 298 } |
299 | 299 |
300 void WebLayerImpl::removeAnimation(int animationId) | 300 void WebLayerImpl::removeAnimation(int animationId) |
301 { | 301 { |
302 m_layer->removeAnimation(animationId); | 302 m_layer->removeAnimation(animationId); |
303 } | 303 } |
304 | 304 |
305 void WebLayerImpl::removeAnimation(int animationId, WebAnimation::TargetProperty
targetProperty) | 305 void WebLayerImpl::removeAnimation(int animationId, WebAnimation::TargetProperty
targetProperty) |
306 { | 306 { |
307 m_layer->layerAnimationController()->removeAnimation(animationId, static_cas
t<CCActiveAnimation::TargetProperty>(targetProperty)); | 307 m_layer->layerAnimationController()->removeAnimation(animationId, static_cas
t<ActiveAnimation::TargetProperty>(targetProperty)); |
308 } | 308 } |
309 | 309 |
310 void WebLayerImpl::pauseAnimation(int animationId, double timeOffset) | 310 void WebLayerImpl::pauseAnimation(int animationId, double timeOffset) |
311 { | 311 { |
312 m_layer->pauseAnimation(animationId, timeOffset); | 312 m_layer->pauseAnimation(animationId, timeOffset); |
313 } | 313 } |
314 | 314 |
315 void WebLayerImpl::suspendAnimations(double monotonicTime) | 315 void WebLayerImpl::suspendAnimations(double monotonicTime) |
316 { | 316 { |
317 m_layer->suspendAnimations(monotonicTime); | 317 m_layer->suspendAnimations(monotonicTime); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 bool WebLayerImpl::fixedToContainerLayer() const | 426 bool WebLayerImpl::fixedToContainerLayer() const |
427 { | 427 { |
428 return m_layer->fixedToContainerLayer(); | 428 return m_layer->fixedToContainerLayer(); |
429 } | 429 } |
430 | 430 |
431 void WebLayerImpl::setScrollClient(WebLayerScrollClient* scrollClient) | 431 void WebLayerImpl::setScrollClient(WebLayerScrollClient* scrollClient) |
432 { | 432 { |
433 m_layer->setLayerScrollClient(scrollClient); | 433 m_layer->setLayerScrollClient(scrollClient); |
434 } | 434 } |
435 | 435 |
436 LayerChromium* WebLayerImpl::layer() const | 436 Layer* WebLayerImpl::layer() const |
437 { | 437 { |
438 return m_layer.get(); | 438 return m_layer.get(); |
439 } | 439 } |
440 | 440 |
441 } // namespace WebKit | 441 } // namespace WebKit |
OLD | NEW |