Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 564043003: Add a setting to disable threaded scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: s/accelerated/threaded/ Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 if (compositingState != PaintsIntoOwnBacking && compositingState != Pain tsIntoGroupedBacking) 915 if (compositingState != PaintsIntoOwnBacking && compositingState != Pain tsIntoGroupedBacking)
916 return true; 916 return true;
917 } 917 }
918 return false; 918 return false;
919 } 919 }
920 920
921 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co nst 921 MainThreadScrollingReasons ScrollingCoordinator::mainThreadScrollingReasons() co nst
922 { 922 {
923 MainThreadScrollingReasons reasons = static_cast<MainThreadScrollingReasons> (0); 923 MainThreadScrollingReasons reasons = static_cast<MainThreadScrollingReasons> (0);
924 924
925 if (!m_page->settings().threadedScrollingEnabled())
926 reasons |= ThreadedScrollingDisabled;
927
925 if (!m_page->mainFrame()->isLocalFrame()) 928 if (!m_page->mainFrame()->isLocalFrame())
926 return reasons; 929 return reasons;
927 FrameView* frameView = m_page->deprecatedLocalMainFrame()->view(); 930 FrameView* frameView = m_page->deprecatedLocalMainFrame()->view();
928 if (!frameView) 931 if (!frameView)
929 return reasons; 932 return reasons;
930 933
931 if (frameView->hasSlowRepaintObjects()) 934 if (frameView->hasSlowRepaintObjects())
932 reasons |= HasSlowRepaintObjects; 935 reasons |= HasSlowRepaintObjects;
933 if (frameView->isScrollable() && hasVisibleSlowRepaintViewportConstrainedObj ects(frameView)) 936 if (frameView->isScrollable() && hasVisibleSlowRepaintViewportConstrainedObj ects(frameView))
934 reasons |= HasNonLayerViewportConstrainedObjects; 937 reasons |= HasNonLayerViewportConstrainedObjects;
935 938
936 return reasons; 939 return reasons;
937 } 940 }
938 941
939 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin gReasons reasons) 942 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin gReasons reasons)
940 { 943 {
941 StringBuilder stringBuilder; 944 StringBuilder stringBuilder;
942 945
943 if (reasons & ScrollingCoordinator::HasSlowRepaintObjects) 946 if (reasons & ScrollingCoordinator::HasSlowRepaintObjects)
944 stringBuilder.appendLiteral("Has slow repaint objects, "); 947 stringBuilder.appendLiteral("Has slow repaint objects, ");
945 if (reasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupp ortingFixedLayers) 948 if (reasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupp ortingFixedLayers)
946 stringBuilder.appendLiteral("Has viewport constrained objects without su pporting fixed layers, "); 949 stringBuilder.appendLiteral("Has viewport constrained objects without su pporting fixed layers, ");
947 if (reasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects) 950 if (reasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects)
948 stringBuilder.appendLiteral("Has non-layer viewport-constrained objects, "); 951 stringBuilder.appendLiteral("Has non-layer viewport-constrained objects, ");
952 if (reasons & ScrollingCoordinator::ThreadedScrollingDisabled)
953 stringBuilder.appendLiteral("Threaded scrolling is disabled, ");
949 954
950 if (stringBuilder.length()) 955 if (stringBuilder.length())
951 stringBuilder.resize(stringBuilder.length() - 2); 956 stringBuilder.resize(stringBuilder.length() - 2);
952 return stringBuilder.toString(); 957 return stringBuilder.toString();
953 } 958 }
954 959
955 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const 960 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const
956 { 961 {
957 ASSERT(m_page->deprecatedLocalMainFrame()->document()->lifecycle().state() > = DocumentLifecycle::CompositingClean); 962 ASSERT(m_page->deprecatedLocalMainFrame()->document()->lifecycle().state() > = DocumentLifecycle::CompositingClean);
958 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); 963 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons);
959 } 964 }
960 965
961 bool ScrollingCoordinator::frameViewIsDirty() const 966 bool ScrollingCoordinator::frameViewIsDirty() const
962 { 967 {
963 FrameView* frameView = m_page->mainFrame()->isLocalFrame() ? m_page->depreca tedLocalMainFrame()->view() : 0; 968 FrameView* frameView = m_page->mainFrame()->isLocalFrame() ? m_page->depreca tedLocalMainFrame()->view() : 0;
964 bool frameIsScrollable = frameView && frameView->isScrollable(); 969 bool frameIsScrollable = frameView && frameView->isScrollable();
965 if (frameIsScrollable != m_wasFrameScrollable) 970 if (frameIsScrollable != m_wasFrameScrollable)
966 return true; 971 return true;
967 972
968 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0) 973 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll ing()) : 0)
969 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( ); 974 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds( );
970 return false; 975 return false;
971 } 976 }
972 977
973 } // namespace blink 978 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698