| 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 "SkMatrix44.h" | 9 #include "SkMatrix44.h" |
| 9 #ifdef LOG | 10 #ifdef LOG |
| 10 #undef LOG | 11 #undef LOG |
| 11 #endif | 12 #endif |
| 12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 13 #include "cc/active_animation.h" | 14 #include "cc/active_animation.h" |
| 14 #include "cc/layer.h" | 15 #include "cc/layer.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 m_layer->setShouldScrollOnMainThread(shouldScrollOnMainThread); | 389 m_layer->setShouldScrollOnMainThread(shouldScrollOnMainThread); |
| 389 } | 390 } |
| 390 | 391 |
| 391 bool WebLayerImpl::shouldScrollOnMainThread() const | 392 bool WebLayerImpl::shouldScrollOnMainThread() const |
| 392 { | 393 { |
| 393 return m_layer->shouldScrollOnMainThread(); | 394 return m_layer->shouldScrollOnMainThread(); |
| 394 } | 395 } |
| 395 | 396 |
| 396 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) | 397 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) |
| 397 { | 398 { |
| 398 WebCore::Region region; | 399 cc::Region region; |
| 399 for (size_t i = 0; i < rects.size(); ++i) { | 400 for (size_t i = 0; i < rects.size(); ++i) |
| 400 WebCore::IntRect rect = convert(rects[i]); | 401 region.Union(rects[i]); |
| 401 region.unite(rect); | |
| 402 } | |
| 403 m_layer->setNonFastScrollableRegion(region); | 402 m_layer->setNonFastScrollableRegion(region); |
| 404 | |
| 405 } | 403 } |
| 406 | 404 |
| 407 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const | 405 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const |
| 408 { | 406 { |
| 409 Vector<WebCore::IntRect> regionRects = m_layer->nonFastScrollableRegion().re
cts(); | 407 cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); |
| 410 WebVector<WebRect> result(regionRects.size()); | 408 WebVector<WebRect> result(regionRects.size()); |
| 411 for (size_t i = 0; i < regionRects.size(); ++i) | 409 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i) |
| 412 result[i] = convert(regionRects[i]); | 410 result[i] = regionRects.rect(); |
| 413 return result; | 411 return result; |
| 414 } | 412 } |
| 415 | 413 |
| 416 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) | 414 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) |
| 417 { | 415 { |
| 418 m_layer->setIsContainerForFixedPositionLayers(enable); | 416 m_layer->setIsContainerForFixedPositionLayers(enable); |
| 419 } | 417 } |
| 420 | 418 |
| 421 bool WebLayerImpl::isContainerForFixedPositionLayers() const | 419 bool WebLayerImpl::isContainerForFixedPositionLayers() const |
| 422 { | 420 { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 437 { | 435 { |
| 438 m_layer->setLayerScrollClient(scrollClient); | 436 m_layer->setLayerScrollClient(scrollClient); |
| 439 } | 437 } |
| 440 | 438 |
| 441 Layer* WebLayerImpl::layer() const | 439 Layer* WebLayerImpl::layer() const |
| 442 { | 440 { |
| 443 return m_layer.get(); | 441 return m_layer.get(); |
| 444 } | 442 } |
| 445 | 443 |
| 446 } // namespace WebKit | 444 } // namespace WebKit |
| OLD | NEW |