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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->
layer(); | 770 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->
layer(); |
771 // Any explicit reason that a fixed position element is not composited s
houldn't cause slow scrolling. | 771 // Any explicit reason that a fixed position element is not composited s
houldn't cause slow scrolling. |
772 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea
son() == RenderLayer::NoNotCompositedReason) | 772 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea
son() == RenderLayer::NoNotCompositedReason) |
773 return true; | 773 return true; |
774 } | 774 } |
775 return false; | 775 return false; |
776 } | 776 } |
777 | 777 |
778 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co
nst | 778 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co
nst |
779 { | 779 { |
| 780 // The main thread scrolling reasons are applicable to scrolls of the main |
| 781 // frame. If it does not exist or if it is not scrollable, there is no |
| 782 // reason to force main thread scrolling. |
780 FrameView* frameView = m_page->mainFrame()->view(); | 783 FrameView* frameView = m_page->mainFrame()->view(); |
781 if (!frameView) | 784 if (!frameView || !frameView->isScrollable()) |
782 return static_cast<MainThreadScrollingReasons>(0); | 785 return static_cast<MainThreadScrollingReasons>(0); |
783 | 786 |
784 MainThreadScrollingReasons mainThreadScrollingReasons = (MainThreadScrolling
Reasons)0; | 787 MainThreadScrollingReasons mainThreadScrollingReasons = (MainThreadScrolling
Reasons)0; |
785 | 788 |
786 if (frameView->hasSlowRepaintObjects()) | 789 if (frameView->hasSlowRepaintObjects()) |
787 mainThreadScrollingReasons |= HasSlowRepaintObjects; | 790 mainThreadScrollingReasons |= HasSlowRepaintObjects; |
788 if (hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) | 791 if (hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) |
789 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects; | 792 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects; |
790 | 793 |
791 return mainThreadScrollingReasons; | 794 return mainThreadScrollingReasons; |
(...skipping 19 matching lines...) Expand all Loading... |
811 stringBuilder.resize(stringBuilder.length() - 2); | 814 stringBuilder.resize(stringBuilder.length() - 2); |
812 return stringBuilder.toString(); | 815 return stringBuilder.toString(); |
813 } | 816 } |
814 | 817 |
815 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 818 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
816 { | 819 { |
817 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 820 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
818 } | 821 } |
819 | 822 |
820 } // namespace WebCore | 823 } // namespace WebCore |
OLD | NEW |