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

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

Issue 2096633002: Adds scroll position/scale emulation to DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync, patch in 2169483002 (+ regression test), add DevTools tests. Created 4 years, 5 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
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 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 // needs to be set in tandem with the page scale delta. 1235 // needs to be set in tandem with the page scale delta.
1236 if (isVisualViewport) 1236 if (isVisualViewport)
1237 m_layer->layer()->setScrollClient(0); 1237 m_layer->layer()->setScrollClient(0);
1238 else 1238 else
1239 m_layer->layer()->setScrollClient(this); 1239 m_layer->layer()->setScrollClient(this);
1240 } 1240 }
1241 1241
1242 void GraphicsLayer::didScroll() 1242 void GraphicsLayer::didScroll()
1243 { 1243 {
1244 if (m_scrollableArea) { 1244 if (m_scrollableArea) {
1245 DoublePoint newPosition = m_scrollableArea->minimumScrollPosition() + to DoubleSize(m_layer->layer()->scrollPositionDouble()); 1245 DoublePoint newPosition = -m_scrollableArea->scrollOrigin() + toDoubleSi ze(m_layer->layer()->scrollPositionDouble());
1246 1246
1247 // FrameView::setScrollPosition doesn't work for compositor commits (int eracts poorly with programmatic scroll animations) 1247 // FrameView::setScrollPosition doesn't work for compositor commits (int eracts poorly with programmatic scroll animations)
1248 // so we need to use the ScrollableArea version. The FrameView method sh ould go away soon anyway. 1248 // so we need to use the ScrollableArea version. The FrameView method sh ould go away soon anyway.
1249 m_scrollableArea->ScrollableArea::setScrollPosition(newPosition, Composi torScroll); 1249 m_scrollableArea->ScrollableArea::setScrollPosition(newPosition, Composi torScroll);
1250 } 1250 }
1251 } 1251 }
1252 1252
1253 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> GraphicsLayer::Take DebugInfo(cc::Layer* layer) 1253 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> GraphicsLayer::Take DebugInfo(cc::Layer* layer)
1254 { 1254 {
1255 std::unique_ptr<base::trace_event::TracedValue> tracedValue(m_debugInfo.asTr acedValue()); 1255 std::unique_ptr<base::trace_event::TracedValue> tracedValue(m_debugInfo.asTr acedValue());
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 { 1380 {
1381 if (!layer) { 1381 if (!layer) {
1382 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1382 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1383 return; 1383 return;
1384 } 1384 }
1385 1385
1386 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1386 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1387 fprintf(stderr, "%s\n", output.utf8().data()); 1387 fprintf(stderr, "%s\n", output.utf8().data());
1388 } 1388 }
1389 #endif 1389 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698