Index: webkit/compositor_bindings/web_layer_impl.cc |
diff --git a/webkit/compositor_bindings/web_layer_impl.cc b/webkit/compositor_bindings/web_layer_impl.cc |
index 0fcb74f509dd5071622765836be87a9054cdec90..b9425dc871b516b624fcf0ea2591cb1e1e756134 100644 |
--- a/webkit/compositor_bindings/web_layer_impl.cc |
+++ b/webkit/compositor_bindings/web_layer_impl.cc |
@@ -5,7 +5,6 @@ |
#include "config.h" |
#include "web_layer_impl.h" |
-#include "Region.h" |
#include "SkMatrix44.h" |
#ifdef LOG |
#undef LOG |
@@ -13,6 +12,7 @@ |
#include "base/string_util.h" |
#include "cc/active_animation.h" |
#include "cc/layer.h" |
+#include "cc/region.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" |
#include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
@@ -403,10 +403,16 @@ void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) |
WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const |
{ |
- cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); |
- WebVector<WebRect> result(regionRects.size()); |
- for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i) |
+ size_t numRects = 0; |
+ for (cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); regionRects.has_rect(); regionRects.next()) |
+ ++numRects; |
+ |
+ WebVector<WebRect> result(numRects); |
+ size_t i = 0; |
+ for (cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); regionRects.has_rect(); regionRects.next()) { |
result[i] = regionRects.rect(); |
+ ++i; |
+ } |
return result; |
} |