OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 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 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 // needs to be set in tandem with the page scale delta. | 1197 // needs to be set in tandem with the page scale delta. |
1198 if (isVisualViewport) | 1198 if (isVisualViewport) |
1199 m_layer->layer()->setScrollClient(0); | 1199 m_layer->layer()->setScrollClient(0); |
1200 else | 1200 else |
1201 m_layer->layer()->setScrollClient(this); | 1201 m_layer->layer()->setScrollClient(this); |
1202 } | 1202 } |
1203 | 1203 |
1204 void GraphicsLayer::didScroll() | 1204 void GraphicsLayer::didScroll() |
1205 { | 1205 { |
1206 if (m_scrollableArea) { | 1206 if (m_scrollableArea) { |
1207 DoublePoint newPosition = m_scrollableArea->minimumScrollPosition() + to
DoubleSize(m_layer->layer()->scrollPositionDouble()); | 1207 DoublePoint newPosition = -m_scrollableArea->scrollOrigin() + toDoubleSi
ze(m_layer->layer()->scrollPositionDouble()); |
1208 | 1208 |
1209 // FrameView::setScrollPosition doesn't work for compositor commits (int
eracts poorly with programmatic scroll animations) | 1209 // FrameView::setScrollPosition doesn't work for compositor commits (int
eracts poorly with programmatic scroll animations) |
1210 // so we need to use the ScrollableArea version. The FrameView method sh
ould go away soon anyway. | 1210 // so we need to use the ScrollableArea version. The FrameView method sh
ould go away soon anyway. |
1211 m_scrollableArea->ScrollableArea::setScrollPosition(newPosition, Composi
torScroll); | 1211 m_scrollableArea->ScrollableArea::setScrollPosition(newPosition, Composi
torScroll); |
1212 } | 1212 } |
1213 } | 1213 } |
1214 | 1214 |
1215 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> GraphicsLayer::Take
DebugInfo(cc::Layer* layer) | 1215 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> GraphicsLayer::Take
DebugInfo(cc::Layer* layer) |
1216 { | 1216 { |
1217 std::unique_ptr<base::trace_event::TracedValue> tracedValue(m_debugInfo.asTr
acedValue()); | 1217 std::unique_ptr<base::trace_event::TracedValue> tracedValue(m_debugInfo.asTr
acedValue()); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1351 { | 1351 { |
1352 if (!layer) { | 1352 if (!layer) { |
1353 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1353 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1354 return; | 1354 return; |
1355 } | 1355 } |
1356 | 1356 |
1357 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1357 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1358 fprintf(stderr, "%s\n", output.utf8().data()); | 1358 fprintf(stderr, "%s\n", output.utf8().data()); |
1359 } | 1359 } |
1360 #endif | 1360 #endif |
OLD | NEW |