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

Side by Side Diff: webkit/compositor_bindings/web_layer_impl.cc

Issue 11377013: Add touchEventHandlerRegion to Layer and LayerImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed OVERRIDE from web_layer_impl 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « webkit/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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" 8 #include "Region.h"
9 #include "SkMatrix44.h" 9 #include "SkMatrix44.h"
10 #ifdef LOG 10 #ifdef LOG
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 404
405 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const 405 WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const
406 { 406 {
407 cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion()); 407 cc::Region::Iterator regionRects(m_layer->nonFastScrollableRegion());
408 WebVector<WebRect> result(regionRects.size()); 408 WebVector<WebRect> result(regionRects.size());
409 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i) 409 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i)
410 result[i] = regionRects.rect(); 410 result[i] = regionRects.rect();
411 return result; 411 return result;
412 } 412 }
413 413
414 void WebLayerImpl::setTouchEventHandlerRegion(const WebVector<WebRect>& rects)
415 {
416 cc::Region region;
417 for (size_t i = 0; i < rects.size(); ++i)
418 region.Union(rects[i]);
419 m_layer->setTouchEventHandlerRegion(region);
420
421 }
422
423 WebVector<WebRect> WebLayerImpl::touchEventHandlerRegion() const
424 {
425 cc::Region::Iterator regionRects(m_layer->touchEventHandlerRegion());
426 WebVector<WebRect> result(regionRects.size());
427 for (size_t i = 0; regionRects.has_rect(); regionRects.next(), ++i)
428 result[i] = regionRects.rect();
429 return result;
430 }
431
414 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) 432 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable)
415 { 433 {
416 m_layer->setIsContainerForFixedPositionLayers(enable); 434 m_layer->setIsContainerForFixedPositionLayers(enable);
417 } 435 }
418 436
419 bool WebLayerImpl::isContainerForFixedPositionLayers() const 437 bool WebLayerImpl::isContainerForFixedPositionLayers() const
420 { 438 {
421 return m_layer->isContainerForFixedPositionLayers(); 439 return m_layer->isContainerForFixedPositionLayers();
422 } 440 }
423 441
(...skipping 11 matching lines...) Expand all
435 { 453 {
436 m_layer->setLayerScrollClient(scrollClient); 454 m_layer->setLayerScrollClient(scrollClient);
437 } 455 }
438 456
439 Layer* WebLayerImpl::layer() const 457 Layer* WebLayerImpl::layer() const
440 { 458 {
441 return m_layer.get(); 459 return m_layer.get();
442 } 460 }
443 461
444 } // namespace WebKit 462 } // namespace WebKit
OLDNEW
« no previous file with comments | « webkit/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698