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" | |
9 #include "SkMatrix44.h" | 8 #include "SkMatrix44.h" |
10 #ifdef LOG | 9 #ifdef LOG |
11 #undef LOG | 10 #undef LOG |
12 #endif | 11 #endif |
13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
14 #include "cc/active_animation.h" | 13 #include "cc/active_animation.h" |
15 #include "cc/layer.h" | 14 #include "cc/layer.h" |
| 15 #include "cc/region.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 | 21 |
22 using cc::ActiveAnimation; | 22 using cc::ActiveAnimation; |
23 using cc::Layer; | 23 using cc::Layer; |
24 | 24 |
25 namespace WebKit { | 25 namespace WebKit { |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) | 396 void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) |
397 { | 397 { |
398 cc::Region region; | 398 cc::Region region; |
399 for (size_t i = 0; i < rects.size(); ++i) | 399 for (size_t i = 0; i < rects.size(); ++i) |
400 region.Union(rects[i]); | 400 region.Union(rects[i]); |
401 m_layer->setNonFastScrollableRegion(region); | 401 m_layer->setNonFastScrollableRegion(region); |
402 } | 402 } |
403 | 403 |
404 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const | 404 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const |
405 { | 405 { |
406 cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); | 406 size_t numRects = 0; |
407 WebVector<WebRect> result(regionRects.size()); | 407 for (cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); r
egionRects.has_rect(); regionRects.next()) |
408 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i) | 408 ++numRects; |
| 409 |
| 410 WebVector<WebRect> result(numRects); |
| 411 size_t i = 0; |
| 412 for (cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); r
egionRects.has_rect(); regionRects.next()) { |
409 result[i] = regionRects.rect(); | 413 result[i] = regionRects.rect(); |
| 414 ++i; |
| 415 } |
410 return result; | 416 return result; |
411 } | 417 } |
412 | 418 |
413 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) | 419 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) |
414 { | 420 { |
415 m_layer->setIsContainerForFixedPositionLayers(enable); | 421 m_layer->setIsContainerForFixedPositionLayers(enable); |
416 } | 422 } |
417 | 423 |
418 bool WebLayerImpl::isContainerForFixedPositionLayers() const | 424 bool WebLayerImpl::isContainerForFixedPositionLayers() const |
419 { | 425 { |
(...skipping 14 matching lines...) Expand all Loading... |
434 { | 440 { |
435 m_layer->setLayerScrollClient(scrollClient); | 441 m_layer->setLayerScrollClient(scrollClient); |
436 } | 442 } |
437 | 443 |
438 Layer* WebLayerImpl::layer() const | 444 Layer* WebLayerImpl::layer() const |
439 { | 445 { |
440 return m_layer.get(); | 446 return m_layer.get(); |
441 } | 447 } |
442 | 448 |
443 } // namespace WebKit | 449 } // namespace WebKit |
OLD | NEW |