| 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 "CCActiveAnimation.h" | 8 #include "CCActiveAnimation.h" |
| 9 #include "LayerChromium.h" | 9 #include "LayerChromium.h" |
| 10 #include "SkMatrix44.h" | 10 #include "SkMatrix44.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 WebPoint WebLayerImpl::scrollPosition() const | 341 WebPoint WebLayerImpl::scrollPosition() const |
| 342 { | 342 { |
| 343 return WebPoint(m_layer->scrollPosition().x(), m_layer->scrollPosition().y()
); | 343 return WebPoint(m_layer->scrollPosition().x(), m_layer->scrollPosition().y()
); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void WebLayerImpl::setMaxScrollPosition(WebSize maxScrollPosition) | 346 void WebLayerImpl::setMaxScrollPosition(WebSize maxScrollPosition) |
| 347 { | 347 { |
| 348 m_layer->setMaxScrollPosition(convert(maxScrollPosition)); | 348 m_layer->setMaxScrollPosition(convert(maxScrollPosition)); |
| 349 } | 349 } |
| 350 | 350 |
| 351 WebSize WebLayerImpl::maxScrollPosition() const |
| 352 { |
| 353 return convert(m_layer->maxScrollPosition()); |
| 354 } |
| 355 |
| 351 void WebLayerImpl::setScrollable(bool scrollable) | 356 void WebLayerImpl::setScrollable(bool scrollable) |
| 352 { | 357 { |
| 353 m_layer->setScrollable(scrollable); | 358 m_layer->setScrollable(scrollable); |
| 354 } | 359 } |
| 355 | 360 |
| 361 bool WebLayerImpl::scrollable() const |
| 362 { |
| 363 return m_layer->scrollable(); |
| 364 } |
| 365 |
| 356 void WebLayerImpl::setHaveWheelEventHandlers(bool haveWheelEventHandlers) | 366 void WebLayerImpl::setHaveWheelEventHandlers(bool haveWheelEventHandlers) |
| 357 { | 367 { |
| 358 m_layer->setHaveWheelEventHandlers(haveWheelEventHandlers); | 368 m_layer->setHaveWheelEventHandlers(haveWheelEventHandlers); |
| 359 } | 369 } |
| 360 | 370 |
| 371 bool WebLayerImpl::haveWheelEventHandlers() const |
| 372 { |
| 373 return m_layer->haveWheelEventHandlers(); |
| 374 } |
| 375 |
| 361 void WebLayerImpl::setShouldScrollOnMainThread(bool shouldScrollOnMainThread) | 376 void WebLayerImpl::setShouldScrollOnMainThread(bool shouldScrollOnMainThread) |
| 362 { | 377 { |
| 363 m_layer->setShouldScrollOnMainThread(shouldScrollOnMainThread); | 378 m_layer->setShouldScrollOnMainThread(shouldScrollOnMainThread); |
| 364 } | 379 } |
| 365 | 380 |
| 381 bool WebLayerImpl::shouldScrollOnMainThread() const |
| 382 { |
| 383 return m_layer->shouldScrollOnMainThread(); |
| 384 } |
| 385 |
| 366 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) | 386 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) |
| 367 { | 387 { |
| 368 WebCore::Region region; | 388 WebCore::Region region; |
| 369 for (size_t i = 0; i < rects.size(); ++i) { | 389 for (size_t i = 0; i < rects.size(); ++i) { |
| 370 WebCore::IntRect rect = convert(rects[i]); | 390 WebCore::IntRect rect = convert(rects[i]); |
| 371 region.unite(rect); | 391 region.unite(rect); |
| 372 } | 392 } |
| 373 m_layer->setNonFastScrollableRegion(region); | 393 m_layer->setNonFastScrollableRegion(region); |
| 374 | 394 |
| 375 } | 395 } |
| 376 | 396 |
| 397 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const |
| 398 { |
| 399 Vector<WebCore::IntRect> regionRects = m_layer->nonFastScrollableRegion().re
cts(); |
| 400 WebVector<WebRect> result(regionRects.size()); |
| 401 for (size_t i = 0; i < regionRects.size(); ++i) |
| 402 result[i] = convert(regionRects[i]); |
| 403 return result; |
| 404 } |
| 405 |
| 377 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) | 406 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) |
| 378 { | 407 { |
| 379 m_layer->setIsContainerForFixedPositionLayers(enable); | 408 m_layer->setIsContainerForFixedPositionLayers(enable); |
| 380 } | 409 } |
| 381 | 410 |
| 411 bool WebLayerImpl::isContainerForFixedPositionLayers() const |
| 412 { |
| 413 return m_layer->isContainerForFixedPositionLayers(); |
| 414 } |
| 415 |
| 382 void WebLayerImpl::setFixedToContainerLayer(bool enable) | 416 void WebLayerImpl::setFixedToContainerLayer(bool enable) |
| 383 { | 417 { |
| 384 m_layer->setFixedToContainerLayer(enable); | 418 m_layer->setFixedToContainerLayer(enable); |
| 385 } | 419 } |
| 386 | 420 |
| 421 bool WebLayerImpl::fixedToContainerLayer() const |
| 422 { |
| 423 return m_layer->fixedToContainerLayer(); |
| 424 } |
| 425 |
| 387 void WebLayerImpl::setScrollClient(WebLayerScrollClient* scrollClient) | 426 void WebLayerImpl::setScrollClient(WebLayerScrollClient* scrollClient) |
| 388 { | 427 { |
| 389 m_layer->setLayerScrollClient(scrollClient); | 428 m_layer->setLayerScrollClient(scrollClient); |
| 390 } | 429 } |
| 391 | 430 |
| 392 LayerChromium* WebLayerImpl::layer() const | 431 LayerChromium* WebLayerImpl::layer() const |
| 393 { | 432 { |
| 394 return m_layer.get(); | 433 return m_layer.get(); |
| 395 } | 434 } |
| 396 | 435 |
| 397 } // namespace WebKit | 436 } // namespace WebKit |
| OLD | NEW |