| OLD | NEW |
| 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 size_t i = 0; | 424 size_t i = 0; |
| 425 for (cc::Region::Iterator region_rects(layer_->touch_event_handler_region()); | 425 for (cc::Region::Iterator region_rects(layer_->touch_event_handler_region()); |
| 426 region_rects.has_rect(); | 426 region_rects.has_rect(); |
| 427 region_rects.next()) { | 427 region_rects.next()) { |
| 428 result[i] = region_rects.rect(); | 428 result[i] = region_rects.rect(); |
| 429 ++i; | 429 ++i; |
| 430 } | 430 } |
| 431 return result; | 431 return result; |
| 432 } | 432 } |
| 433 | 433 |
| 434 static_assert(static_cast<ScrollBlocksOn>(blink::WebScrollBlocksOnNone) == | |
| 435 SCROLL_BLOCKS_ON_NONE, | |
| 436 "ScrollBlocksOn and WebScrollBlocksOn enums must match"); | |
| 437 static_assert(static_cast<ScrollBlocksOn>(blink::WebScrollBlocksOnStartTouch) == | |
| 438 SCROLL_BLOCKS_ON_START_TOUCH, | |
| 439 "ScrollBlocksOn and WebScrollBlocksOn enums must match"); | |
| 440 static_assert(static_cast<ScrollBlocksOn>(blink::WebScrollBlocksOnWheelEvent) == | |
| 441 SCROLL_BLOCKS_ON_WHEEL_EVENT, | |
| 442 "ScrollBlocksOn and WebScrollBlocksOn enums must match"); | |
| 443 static_assert( | |
| 444 static_cast<ScrollBlocksOn>(blink::WebScrollBlocksOnScrollEvent) == | |
| 445 SCROLL_BLOCKS_ON_SCROLL_EVENT, | |
| 446 "ScrollBlocksOn and WebScrollBlocksOn enums must match"); | |
| 447 | |
| 448 void WebLayerImpl::setScrollBlocksOn(blink::WebScrollBlocksOn blocks) { | |
| 449 layer_->SetScrollBlocksOn(static_cast<ScrollBlocksOn>(blocks)); | |
| 450 } | |
| 451 | |
| 452 blink::WebScrollBlocksOn WebLayerImpl::scrollBlocksOn() const { | |
| 453 return static_cast<blink::WebScrollBlocksOn>(layer_->scroll_blocks_on()); | |
| 454 } | |
| 455 | |
| 456 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) { | 434 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) { |
| 457 layer_->SetIsContainerForFixedPositionLayers(enable); | 435 layer_->SetIsContainerForFixedPositionLayers(enable); |
| 458 } | 436 } |
| 459 | 437 |
| 460 bool WebLayerImpl::isContainerForFixedPositionLayers() const { | 438 bool WebLayerImpl::isContainerForFixedPositionLayers() const { |
| 461 return layer_->IsContainerForFixedPositionLayers(); | 439 return layer_->IsContainerForFixedPositionLayers(); |
| 462 } | 440 } |
| 463 | 441 |
| 464 static blink::WebLayerPositionConstraint ToWebLayerPositionConstraint( | 442 static blink::WebLayerPositionConstraint ToWebLayerPositionConstraint( |
| 465 const cc::LayerPositionConstraint& constraint) { | 443 const cc::LayerPositionConstraint& constraint) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 520 |
| 543 Layer* WebLayerImpl::layer() const { | 521 Layer* WebLayerImpl::layer() const { |
| 544 return layer_.get(); | 522 return layer_.get(); |
| 545 } | 523 } |
| 546 | 524 |
| 547 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { | 525 void WebLayerImpl::SetContentsOpaqueIsFixed(bool fixed) { |
| 548 contents_opaque_is_fixed_ = fixed; | 526 contents_opaque_is_fixed_ = fixed; |
| 549 } | 527 } |
| 550 | 528 |
| 551 } // namespace cc_blink | 529 } // namespace cc_blink |
| OLD | NEW |