| 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 |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 | 404 |
| 405 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const | 405 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const |
| 406 { | 406 { |
| 407 cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); | 407 cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); |
| 408 WebVector<WebRect> result(regionRects.size()); | 408 WebVector<WebRect> result(regionRects.size()); |
| 409 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i) | 409 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i) |
| 410 result[i] = regionRects.rect(); | 410 result[i] = regionRects.rect(); |
| 411 return result; | 411 return result; |
| 412 } | 412 } |
| 413 | 413 |
| 414 void WebLayerImpl::setTouchEventHandlerRegion(const WebVector<WebRect>& rects) |
| 415 { |
| 416 cc::Region region; |
| 417 for (size_t i = 0; i < rects.size(); ++i) |
| 418 region.Union(rects[i]); |
| 419 m_layer->setTouchEventHandlerRegion(region); |
| 420 |
| 421 } |
| 422 |
| 423 WebVector<WebRect> WebLayerImpl::touchEventHandlerRegion() const |
| 424 { |
| 425 cc::Region::Iterator regionRects(m_layer->touchEventHandlerRegion()); |
| 426 WebVector<WebRect> result(regionRects.size()); |
| 427 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i) |
| 428 result[i] = regionRects.rect(); |
| 429 return result; |
| 430 } |
| 431 |
| 414 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) | 432 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) |
| 415 { | 433 { |
| 416 m_layer->setIsContainerForFixedPositionLayers(enable); | 434 m_layer->setIsContainerForFixedPositionLayers(enable); |
| 417 } | 435 } |
| 418 | 436 |
| 419 bool WebLayerImpl::isContainerForFixedPositionLayers() const | 437 bool WebLayerImpl::isContainerForFixedPositionLayers() const |
| 420 { | 438 { |
| 421 return m_layer->isContainerForFixedPositionLayers(); | 439 return m_layer->isContainerForFixedPositionLayers(); |
| 422 } | 440 } |
| 423 | 441 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 435 { | 453 { |
| 436 m_layer->setLayerScrollClient(scrollClient); | 454 m_layer->setLayerScrollClient(scrollClient); |
| 437 } | 455 } |
| 438 | 456 |
| 439 Layer* WebLayerImpl::layer() const | 457 Layer* WebLayerImpl::layer() const |
| 440 { | 458 { |
| 441 return m_layer.get(); | 459 return m_layer.get(); |
| 442 } | 460 } |
| 443 | 461 |
| 444 } // namespace WebKit | 462 } // namespace WebKit |
| OLD | NEW |