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 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects; | 928 mainThreadScrollingReasons |= HasNonLayerViewportConstrainedObjects; |
929 | 929 |
930 return mainThreadScrollingReasons; | 930 return mainThreadScrollingReasons; |
931 } | 931 } |
932 | 932 |
933 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin
gReasons reasons) | 933 String ScrollingCoordinator::mainThreadScrollingReasonsAsText(MainThreadScrollin
gReasons reasons) |
934 { | 934 { |
935 StringBuilder stringBuilder; | 935 StringBuilder stringBuilder; |
936 | 936 |
937 if (reasons & ScrollingCoordinator::HasSlowRepaintObjects) | 937 if (reasons & ScrollingCoordinator::HasSlowRepaintObjects) |
938 stringBuilder.append("Has slow repaint objects, "); | 938 stringBuilder.appendLiteral("Has slow repaint objects, "); |
939 if (reasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupp
ortingFixedLayers) | 939 if (reasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupp
ortingFixedLayers) |
940 stringBuilder.append("Has viewport constrained objects without supportin
g fixed layers, "); | 940 stringBuilder.appendLiteral("Has viewport constrained objects without su
pporting fixed layers, "); |
941 if (reasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects) | 941 if (reasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects) |
942 stringBuilder.append("Has non-layer viewport-constrained objects, "); | 942 stringBuilder.appendLiteral("Has non-layer viewport-constrained objects,
"); |
943 | 943 |
944 if (stringBuilder.length()) | 944 if (stringBuilder.length()) |
945 stringBuilder.resize(stringBuilder.length() - 2); | 945 stringBuilder.resize(stringBuilder.length() - 2); |
946 return stringBuilder.toString(); | 946 return stringBuilder.toString(); |
947 } | 947 } |
948 | 948 |
949 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const | 949 String ScrollingCoordinator::mainThreadScrollingReasonsAsText() const |
950 { | 950 { |
951 ASSERT(m_page->deprecatedLocalMainFrame()->document()->lifecycle().state() >
= DocumentLifecycle::CompositingClean); | 951 ASSERT(m_page->deprecatedLocalMainFrame()->document()->lifecycle().state() >
= DocumentLifecycle::CompositingClean); |
952 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); | 952 return mainThreadScrollingReasonsAsText(m_lastMainThreadScrollingReasons); |
953 } | 953 } |
954 | 954 |
955 bool ScrollingCoordinator::frameViewIsDirty() const | 955 bool ScrollingCoordinator::frameViewIsDirty() const |
956 { | 956 { |
957 FrameView* frameView = m_page->mainFrame()->isLocalFrame() ? m_page->depreca
tedLocalMainFrame()->view() : 0; | 957 FrameView* frameView = m_page->mainFrame()->isLocalFrame() ? m_page->depreca
tedLocalMainFrame()->view() : 0; |
958 bool frameIsScrollable = frameView && frameView->isScrollable(); | 958 bool frameIsScrollable = frameView && frameView->isScrollable(); |
959 if (frameIsScrollable != m_wasFrameScrollable) | 959 if (frameIsScrollable != m_wasFrameScrollable) |
960 return true; | 960 return true; |
961 | 961 |
962 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) | 962 if (WebLayer* scrollLayer = frameView ? toWebLayer(frameView->layerForScroll
ing()) : 0) |
963 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); | 963 return blink::WebSize(frameView->contentsSize()) != scrollLayer->bounds(
); |
964 return false; | 964 return false; |
965 } | 965 } |
966 | 966 |
967 } // namespace blink | 967 } // namespace blink |
OLD | NEW |