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 "web_layer_impl.h" | 6 #include "web_layer_impl.h" |
7 | 7 |
8 #include "Region.h" | 8 #include "Region.h" |
9 #include "SkMatrix44.h" | 9 #include "SkMatrix44.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 "web_animation_impl.h" | 20 #include "web_animation_impl.h" |
21 #include "webcore_convert.h" | |
22 | 21 |
23 using cc::ActiveAnimation; | 22 using cc::ActiveAnimation; |
24 using cc::Layer; | 23 using cc::Layer; |
25 | 24 |
26 namespace WebKit { | 25 namespace WebKit { |
27 | 26 |
28 namespace { | 27 namespace { |
29 | 28 |
30 WebTransformationMatrix transformationMatrixFromSkMatrix44(const SkMatrix44& mat
rix) | 29 WebTransformationMatrix transformationMatrixFromSkMatrix44(const SkMatrix44& mat
rix) |
31 { | 30 { |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 static_cast<WebLayerImpl*>(other)->m_layer->setLayerAnimationController(m_la
yer->releaseLayerAnimationController()); | 338 static_cast<WebLayerImpl*>(other)->m_layer->setLayerAnimationController(m_la
yer->releaseLayerAnimationController()); |
340 } | 339 } |
341 | 340 |
342 void WebLayerImpl::setForceRenderSurface(bool forceRenderSurface) | 341 void WebLayerImpl::setForceRenderSurface(bool forceRenderSurface) |
343 { | 342 { |
344 m_layer->setForceRenderSurface(forceRenderSurface); | 343 m_layer->setForceRenderSurface(forceRenderSurface); |
345 } | 344 } |
346 | 345 |
347 void WebLayerImpl::setScrollPosition(WebPoint position) | 346 void WebLayerImpl::setScrollPosition(WebPoint position) |
348 { | 347 { |
349 m_layer->setScrollPosition(convert(position)); | 348 m_layer->setScrollOffset(gfx::Point(position).OffsetFromOrigin()); |
350 } | 349 } |
351 | 350 |
352 WebPoint WebLayerImpl::scrollPosition() const | 351 WebPoint WebLayerImpl::scrollPosition() const |
353 { | 352 { |
354 return WebPoint(m_layer->scrollPosition().x(), m_layer->scrollPosition().y()
); | 353 return gfx::PointAtOffsetFromOrigin(m_layer->scrollOffset()); |
355 } | 354 } |
356 | 355 |
357 void WebLayerImpl::setMaxScrollPosition(WebSize maxScrollPosition) | 356 void WebLayerImpl::setMaxScrollPosition(WebSize maxScrollPosition) |
358 { | 357 { |
359 m_layer->setMaxScrollPosition(convert(maxScrollPosition)); | 358 m_layer->setMaxScrollOffset(maxScrollPosition); |
360 } | 359 } |
361 | 360 |
362 WebSize WebLayerImpl::maxScrollPosition() const | 361 WebSize WebLayerImpl::maxScrollPosition() const |
363 { | 362 { |
364 return convert(m_layer->maxScrollPosition()); | 363 return m_layer->maxScrollOffset(); |
365 } | 364 } |
366 | 365 |
367 void WebLayerImpl::setScrollable(bool scrollable) | 366 void WebLayerImpl::setScrollable(bool scrollable) |
368 { | 367 { |
369 m_layer->setScrollable(scrollable); | 368 m_layer->setScrollable(scrollable); |
370 } | 369 } |
371 | 370 |
372 bool WebLayerImpl::scrollable() const | 371 bool WebLayerImpl::scrollable() const |
373 { | 372 { |
374 return m_layer->scrollable(); | 373 return m_layer->scrollable(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 { | 434 { |
436 m_layer->setLayerScrollClient(scrollClient); | 435 m_layer->setLayerScrollClient(scrollClient); |
437 } | 436 } |
438 | 437 |
439 Layer* WebLayerImpl::layer() const | 438 Layer* WebLayerImpl::layer() const |
440 { | 439 { |
441 return m_layer.get(); | 440 return m_layer.get(); |
442 } | 441 } |
443 | 442 |
444 } // namespace WebKit | 443 } // namespace WebKit |
OLD | NEW |