OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
488 } | 488 } |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 bool RenderLayer::acceleratedCompositingForOverflowScrollEnabled() const | 492 bool RenderLayer::acceleratedCompositingForOverflowScrollEnabled() const |
493 { | 493 { |
494 const Settings* settings = renderer()->document()->settings(); | 494 const Settings* settings = renderer()->document()->settings(); |
495 return settings && settings->acceleratedCompositingForOverflowScrollEnabled( ); | 495 return settings && settings->acceleratedCompositingForOverflowScrollEnabled( ); |
496 } | 496 } |
497 | 497 |
498 bool RenderLayer::useCompositorDrivenAcceleratedScrolling() const | |
499 { | |
500 TRACE_EVENT0("comp-scroll", "RenderLayer::useCompositorDrivenAcceleratedScro lling"); | |
501 | |
502 if (!compositorDrivenAcceleratedScrollingEnabled()) | |
503 return false; | |
504 | |
505 const RenderLayer* scrollingLayer = ancestorScrollingLayer(); | |
506 if (!scrollingLayer || scrollingLayer->isStackingContainer()) | |
507 return false; | |
508 | |
509 if (scrollingLayer->m_canBePromotedToStackingContainerDirty) { | |
Ian Vollick
2013/08/08 03:30:10
Can you describe how we get into the situation whe
hartmanng
2013/08/08 13:41:37
The situation I ran into looks like this:
[0x7f7
| |
510 // We don't know if it's safe to promote to stacking container, and | |
511 // aren't in a position to find out, so we have to assume the worst. | |
512 return true; | |
513 } | |
514 | |
515 return !scrollingLayer->canBeStackingContainer(); | |
516 } | |
517 | |
498 // FIXME: This is a temporary flag and should be removed once accelerated | 518 // FIXME: This is a temporary flag and should be removed once accelerated |
499 // overflow scroll is ready (crbug.com/254111). | 519 // overflow scroll is ready (crbug.com/254111). |
500 bool RenderLayer::compositorDrivenAcceleratedScrollingEnabled() const | 520 bool RenderLayer::compositorDrivenAcceleratedScrollingEnabled() const |
501 { | 521 { |
502 if (!acceleratedCompositingForOverflowScrollEnabled()) | 522 if (!acceleratedCompositingForOverflowScrollEnabled()) |
503 return false; | 523 return false; |
504 | 524 |
505 const Settings* settings = renderer()->document()->settings(); | 525 const Settings* settings = renderer()->document()->settings(); |
506 return settings && settings->isCompositorDrivenAcceleratedScrollingEnabled() ; | 526 return settings && settings->isCompositorDrivenAcceleratedScrollingEnabled() ; |
507 } | 527 } |
(...skipping 5944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6452 } | 6472 } |
6453 } | 6473 } |
6454 | 6474 |
6455 void showLayerTree(const WebCore::RenderObject* renderer) | 6475 void showLayerTree(const WebCore::RenderObject* renderer) |
6456 { | 6476 { |
6457 if (!renderer) | 6477 if (!renderer) |
6458 return; | 6478 return; |
6459 showLayerTree(renderer->enclosingLayer()); | 6479 showLayerTree(renderer->enclosingLayer()); |
6460 } | 6480 } |
6461 #endif | 6481 #endif |
OLD | NEW |