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

Side by Side Diff: cc/blink/web_layer_impl.cc

Issue 2856153003: Pass TouchAction bits together with rect in SetTouchEventHandlerRegion (Closed)
Patch Set: rebase + comment Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "cc/blink/web_layer_impl.h" 5 #include "cc/blink/web_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 size_t i = 0; 292 size_t i = 0;
293 for (cc::Region::Iterator region_rects(layer_->non_fast_scrollable_region()); 293 for (cc::Region::Iterator region_rects(layer_->non_fast_scrollable_region());
294 region_rects.has_rect(); 294 region_rects.has_rect();
295 region_rects.next()) { 295 region_rects.next()) {
296 result[i] = region_rects.rect(); 296 result[i] = region_rects.rect();
297 ++i; 297 ++i;
298 } 298 }
299 return result; 299 return result;
300 } 300 }
301 301
302 void WebLayerImpl::SetTouchEventHandlerRegion(const WebVector<WebRect>& rects) { 302 void WebLayerImpl::SetTouchEventHandlerRegion(
303 const WebVector<blink::WebTouchInfo>& touch_info) {
303 cc::Region region; 304 cc::Region region;
304 for (size_t i = 0; i < rects.size(); ++i) 305 for (size_t i = 0; i < touch_info.size(); ++i)
305 region.Union(rects[i]); 306 region.Union(touch_info[i].rect);
307 // TODO(xidachen): set the touch action bit for the region.
306 layer_->SetTouchEventHandlerRegion(region); 308 layer_->SetTouchEventHandlerRegion(region);
307 } 309 }
308 310
309 WebVector<WebRect> WebLayerImpl::TouchEventHandlerRegion() const { 311 WebVector<WebRect> WebLayerImpl::TouchEventHandlerRegion() const {
310 size_t num_rects = 0; 312 size_t num_rects = 0;
311 for (cc::Region::Iterator region_rects(layer_->touch_event_handler_region()); 313 for (cc::Region::Iterator region_rects(layer_->touch_event_handler_region());
312 region_rects.has_rect(); 314 region_rects.has_rect();
313 region_rects.next()) 315 region_rects.next())
314 ++num_rects; 316 ++num_rects;
315 317
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 484
483 void WebLayerImpl::SetHasWillChangeTransformHint(bool has_will_change) { 485 void WebLayerImpl::SetHasWillChangeTransformHint(bool has_will_change) {
484 layer_->SetHasWillChangeTransformHint(has_will_change); 486 layer_->SetHasWillChangeTransformHint(has_will_change);
485 } 487 }
486 488
487 void WebLayerImpl::ShowScrollbars() { 489 void WebLayerImpl::ShowScrollbars() {
488 layer_->ShowScrollbars(); 490 layer_->ShowScrollbars();
489 } 491 }
490 492
491 } // namespace cc_blink 493 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_layer_impl.h ('k') | third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698