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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2169483002: Use scrollOrigin instead of minimumScrollPosition to calculate position. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 2 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 | « third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp ('k') | no next file » | 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) 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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698