| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 { | 359 { |
| 360 if (m_overflowControlsHostLayer) | 360 if (m_overflowControlsHostLayer) |
| 361 m_overflowControlsHostLayer->setPosition(contentsOffset); | 361 m_overflowControlsHostLayer->setPosition(contentsOffset); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void RenderLayerCompositor::frameViewDidChangeSize() | 364 void RenderLayerCompositor::frameViewDidChangeSize() |
| 365 { | 365 { |
| 366 if (m_containerLayer) { | 366 if (m_containerLayer) { |
| 367 FrameView* frameView = m_renderView.frameView(); | 367 FrameView* frameView = m_renderView.frameView(); |
| 368 m_containerLayer->setSize(frameView->unscaledVisibleContentSize()); | 368 m_containerLayer->setSize(frameView->unscaledVisibleContentSize()); |
| 369 | |
| 370 frameViewDidScroll(); | |
| 371 updateOverflowControlsLayers(); | 369 updateOverflowControlsLayers(); |
| 372 } | 370 } |
| 373 } | 371 } |
| 374 | 372 |
| 375 enum AcceleratedFixedRootBackgroundHistogramBuckets { | |
| 376 ScrolledMainFrameBucket = 0, | |
| 377 ScrolledMainFrameWithAcceleratedFixedRootBackground = 1, | |
| 378 ScrolledMainFrameWithUnacceleratedFixedRootBackground = 2, | |
| 379 AcceleratedFixedRootBackgroundHistogramMax = 3 | |
| 380 }; | |
| 381 | |
| 382 void RenderLayerCompositor::frameViewDidScroll() | |
| 383 { | |
| 384 FrameView* frameView = m_renderView.frameView(); | |
| 385 IntPoint scrollPosition = frameView->scrollPosition(); | |
| 386 | |
| 387 if (!m_scrollLayer) | |
| 388 return; | |
| 389 | |
| 390 // Scroll position = scroll minimum + scroll offset. Adjust the layer's | |
| 391 // position to handle whatever the scroll coordinator isn't handling. | |
| 392 // The minimum scroll position is non-zero for RTL pages with overflow. | |
| 393 m_scrollLayer->setPosition(-scrollPosition); | |
| 394 | |
| 395 | |
| 396 Platform::current()->histogramEnumeration("Renderer.AcceleratedFixedRootBack
ground", | |
| 397 ScrolledMainFrameBucket, | |
| 398 AcceleratedFixedRootBackgroundHistogramMax); | |
| 399 } | |
| 400 | |
| 401 void RenderLayerCompositor::rootFixedBackgroundsChanged() | 373 void RenderLayerCompositor::rootFixedBackgroundsChanged() |
| 402 { | 374 { |
| 403 if (!supportsFixedRootBackgroundCompositing()) | 375 if (!supportsFixedRootBackgroundCompositing()) |
| 404 return; | 376 return; |
| 405 | 377 |
| 406 // To avoid having to make the fixed root background layer fixed positioned
to | 378 // To avoid having to make the fixed root background layer fixed positioned
to |
| 407 // stay put, we position it in the layer tree as follows: | 379 // stay put, we position it in the layer tree as follows: |
| 408 // | 380 // |
| 409 // + Overflow controls host | 381 // + Overflow controls host |
| 410 // + LocalFrame clip | 382 // + LocalFrame clip |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 885 } else if (graphicsLayer == m_scrollLayer.get()) { | 857 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 886 name = "LocalFrame Scrolling Layer"; | 858 name = "LocalFrame Scrolling Layer"; |
| 887 } else { | 859 } else { |
| 888 ASSERT_NOT_REACHED(); | 860 ASSERT_NOT_REACHED(); |
| 889 } | 861 } |
| 890 | 862 |
| 891 return name; | 863 return name; |
| 892 } | 864 } |
| 893 | 865 |
| 894 } // namespace blink | 866 } // namespace blink |
| OLD | NEW |