OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 return false; | 800 return false; |
801 | 801 |
802 for (FrameView::ViewportConstrainedObjectSet::const_iterator it = viewportCo
nstrainedObjects->begin(), end = viewportConstrainedObjects->end(); it != end; +
+it) { | 802 for (FrameView::ViewportConstrainedObjectSet::const_iterator it = viewportCo
nstrainedObjects->begin(), end = viewportConstrainedObjects->end(); it != end; +
+it) { |
803 RenderObject* viewportConstrainedObject = *it; | 803 RenderObject* viewportConstrainedObject = *it; |
804 if (!viewportConstrainedObject->isBoxModelObject() || !viewportConstrain
edObject->hasLayer()) | 804 if (!viewportConstrainedObject->isBoxModelObject() || !viewportConstrain
edObject->hasLayer()) |
805 return true; | 805 return true; |
806 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->
layer(); | 806 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->
layer(); |
807 // Any explicit reason that a fixed position element is not composited s
houldn't cause slow scrolling. | 807 // Any explicit reason that a fixed position element is not composited s
houldn't cause slow scrolling. |
808 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea
son() == RenderLayer::NoNotCompositedReason) | 808 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea
son() == RenderLayer::NoNotCompositedReason) |
809 return true; | 809 return true; |
| 810 |
| 811 // Composited layers that actually paint into their enclosing ancestor |
| 812 // must also force main thread scrolling. |
| 813 if (layer->isComposited() && layer->backing()->paintsIntoCompositedAnces
tor()) |
| 814 return true; |
810 } | 815 } |
811 return false; | 816 return false; |
812 } | 817 } |
813 | 818 |
814 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co
nst | 819 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co
nst |
815 { | 820 { |
816 // The main thread scrolling reasons are applicable to scrolls of the main | 821 // The main thread scrolling reasons are applicable to scrolls of the main |
817 // frame. If it does not exist or if it is not scrollable, there is no | 822 // frame. If it does not exist or if it is not scrollable, there is no |
818 // reason to force main thread scrolling. | 823 // reason to force main thread scrolling. |
819 FrameView* frameView = m_page->mainFrame()->view(); | 824 FrameView* frameView = m_page->mainFrame()->view(); |
(...skipping 30 matching lines...) Expand all Loading... |
850 stringBuilder.resize(stringBuilder.length() - 2); | 855 stringBuilder.resize(stringBuilder.length() - 2); |
851 return stringBuilder.toString(); | 856 return stringBuilder.toString(); |
852 } | 857 } |
853 | 858 |
854 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 859 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
855 { | 860 { |
856 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 861 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
857 } | 862 } |
858 | 863 |
859 } // namespace WebCore | 864 } // namespace WebCore |
OLD | NEW |