| 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 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 // WebViewImpl explicitly rather than via GraphicsLayer::didScroll since it | 1102 // WebViewImpl explicitly rather than via GraphicsLayer::didScroll since it |
| 1103 // needs to be set in tandem with the page scale delta. | 1103 // needs to be set in tandem with the page scale delta. |
| 1104 if (isVisualViewport) | 1104 if (isVisualViewport) |
| 1105 m_layer->layer()->setScrollClient(0); | 1105 m_layer->layer()->setScrollClient(0); |
| 1106 else | 1106 else |
| 1107 m_layer->layer()->setScrollClient(this); | 1107 m_layer->layer()->setScrollClient(this); |
| 1108 } | 1108 } |
| 1109 | 1109 |
| 1110 void GraphicsLayer::didScroll() { | 1110 void GraphicsLayer::didScroll() { |
| 1111 if (m_scrollableArea) { | 1111 if (m_scrollableArea) { |
| 1112 DoublePoint newPosition = | 1112 ScrollOffset newOffset = |
| 1113 -m_scrollableArea->scrollOrigin() + | 1113 toFloatSize(m_layer->layer()->scrollPositionDouble() - |
| 1114 toDoubleSize(m_layer->layer()->scrollPositionDouble()); | 1114 m_scrollableArea->scrollOrigin()); |
| 1115 | 1115 m_scrollableArea->setScrollOffset(newOffset, CompositorScroll); |
| 1116 // FrameView::setScrollPosition doesn't work for compositor commits (interac
ts poorly with programmatic scroll animations) | |
| 1117 // so we need to use the ScrollableArea version. The FrameView method should
go away soon anyway. | |
| 1118 m_scrollableArea->ScrollableArea::setScrollPosition(newPosition, | |
| 1119 CompositorScroll); | |
| 1120 } | 1116 } |
| 1121 } | 1117 } |
| 1122 | 1118 |
| 1123 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 1119 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| 1124 GraphicsLayer::TakeDebugInfo(cc::Layer* layer) { | 1120 GraphicsLayer::TakeDebugInfo(cc::Layer* layer) { |
| 1125 std::unique_ptr<base::trace_event::TracedValue> tracedValue( | 1121 std::unique_ptr<base::trace_event::TracedValue> tracedValue( |
| 1126 m_debugInfo.asTracedValue()); | 1122 m_debugInfo.asTracedValue()); |
| 1127 tracedValue->SetString( | 1123 tracedValue->SetString( |
| 1128 "layer_name", WTF::StringUTF8Adaptor(debugName(layer)).asStringPiece()); | 1124 "layer_name", WTF::StringUTF8Adaptor(debugName(layer)).asStringPiece()); |
| 1129 return std::move(tracedValue); | 1125 return std::move(tracedValue); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1260 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
| 1265 if (!layer) { | 1261 if (!layer) { |
| 1266 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1262 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
| 1267 return; | 1263 return; |
| 1268 } | 1264 } |
| 1269 | 1265 |
| 1270 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1266 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1271 fprintf(stderr, "%s\n", output.utf8().data()); | 1267 fprintf(stderr, "%s\n", output.utf8().data()); |
| 1272 } | 1268 } |
| 1273 #endif | 1269 #endif |
| OLD | NEW |