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

Unified Diff: webkit/compositor_bindings/web_layer_impl.cc

Issue 11360066: cc: Remove WebCore rect use from the compositor, except within Region. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Signs 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 | « webkit/compositor_bindings/web_content_layer_impl.cc ('k') | webkit/compositor_bindings/webcore_convert.h » ('j') | 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 71fac304d04b5bb08df54755ca8ff347f35a5d05..c92d9891a196a5652fde90da28922145b1742a33 100644
--- a/webkit/compositor_bindings/web_layer_impl.cc
+++ b/webkit/compositor_bindings/web_layer_impl.cc
@@ -5,6 +5,7 @@
#include "config.h"
#include "web_layer_impl.h"
+#include "Region.h"
#include "SkMatrix44.h"
#ifdef LOG
#undef LOG
@@ -395,21 +396,18 @@ bool WebLayerImpl::shouldScrollOnMainThread() const
void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects)
{
- WebCore::Region region;
- for (size_t i = 0; i < rects.size(); ++i) {
- WebCore::IntRect rect = convert(rects[i]);
- region.unite(rect);
- }
+ cc::Region region;
+ for (size_t i = 0; i < rects.size(); ++i)
+ region.Union(rects[i]);
m_layer->setNonFastScrollableRegion(region);
-
}
WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const
{
- Vector<WebCore::IntRect> regionRects = m_layer->nonFastScrollableRegion().rects();
+ cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion());
WebVector<WebRect> result(regionRects.size());
- for (size_t i = 0; i < regionRects.size(); ++i)
- result[i] = convert(regionRects[i]);
+ for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i)
+ result[i] = regionRects.rect();
return result;
}
« no previous file with comments | « webkit/compositor_bindings/web_content_layer_impl.cc ('k') | webkit/compositor_bindings/webcore_convert.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698