Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(839)

Unified Diff: webkit/compositor_bindings/web_layer_impl.cc

Issue 11366094: cc: Create a Region class that wraps SkRegion, to replace use of WebCore::Region. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits+Fix compositor bindings Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/tree_synchronizer_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « cc/tree_synchronizer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698