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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->
layer(); | 784 RenderLayer* layer = toRenderBoxModelObject(viewportConstrainedObject)->
layer(); |
785 // Any explicit reason that a fixed position element is not composited s
houldn't cause slow scrolling. | 785 // Any explicit reason that a fixed position element is not composited s
houldn't cause slow scrolling. |
786 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea
son() == RenderLayer::NoNotCompositedReason) | 786 if (!layer->isComposited() && layer->viewportConstrainedNotCompositedRea
son() == RenderLayer::NoNotCompositedReason) |
787 return true; | 787 return true; |
788 } | 788 } |
789 return false; | 789 return false; |
790 } | 790 } |
791 | 791 |
792 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co
nst | 792 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co
nst |
793 { | 793 { |
794 // The main thread scrolling reasons are applicable to scrolls of the main | |
795 // frame. If it does not exist or if it is not scrollable, there is no | |
796 // reason to force main thread scrolling. | |
797 FrameView* frameView = m_page->mainFrame()->view(); | 794 FrameView* frameView = m_page->mainFrame()->view(); |
798 if (!frameView || !frameView->isScrollable()) | 795 if (!frameView) |
799 return static_cast<MainThreadScrollingReasons>(0); | 796 return static_cast<MainThreadScrollingReasons>(0); |
800 | 797 |
801 MainThreadScrollingReasons mainThreadScrollingReasons = (MainThreadScrolling
Reasons)0; | 798 MainThreadScrollingReasons mainThreadScrollingReasons = (MainThreadScrolling
Reasons)0; |
802 | 799 |
803 if (frameView->hasSlowRepaintObjects()) | 800 if (frameView->hasSlowRepaintObjects()) |
804 mainThreadScrollingReasons |= HasSlowRepaintObjects; | 801 mainThreadScrollingReasons |= HasSlowRepaintObjects; |
805 if (hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) | 802 if (hasVisibleSlowRepaintViewportConstrainedObjects(frameView)) |
806 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects; | 803 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects; |
807 | 804 |
808 return mainThreadScrollingReasons; | 805 return mainThreadScrollingReasons; |
(...skipping 19 matching lines...) Expand all Loading... |
828 stringBuilder.resize(stringBuilder.length() - 2); | 825 stringBuilder.resize(stringBuilder.length() - 2); |
829 return stringBuilder.toString(); | 826 return stringBuilder.toString(); |
830 } | 827 } |
831 | 828 |
832 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 829 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
833 { | 830 { |
834 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); | 831 return mainThreadScrollingReasonsAsText(mainThreadScrollingReasons()); |
835 } | 832 } |
836 | 833 |
837 } // namespace WebCore | 834 } // namespace WebCore |
OLD | NEW |