Unify screenshot mechanisms |
|||
Issue descriptionThere seems to be two ways to get a screenshot of a page: . RenderWidgetHostView::CopyFromSurface [1] . RenderWidgetHostImpl::GetSnapshotFromBrowser [2] My understanding is [1] is the better way of doing it. [2] is only used for devtools ([3, 4]), both for implementing page.captureScreenshot api [5]. Can we update [3] and [4] to use [1] instead? Assigning to miu@ to verify this makes sense. /cc dgozman@ from devtools. [1] https://cs.chromium.org/chromium/src/content/public/browser/render_widget_host_view.h?sq=package:chromium&dr=CSs&l=188 [2] https://cs.chromium.org/chromium/src/content/browser/renderer_host/render_widget_host_impl.cc?l=1583 [3] https://cs.chromium.org/chromium/src/content/browser/devtools/protocol/page_handler.cc?l=516 [4] https://cs.chromium.org/chromium/src/content/browser/devtools/protocol/page_handler.cc?l=612 [5] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/inspector/browser_protocol.pdl?l=4447
,
Feb 14 2018
I filed a similar bug last week. crbug.com/810037 kbr's response: "Yes, for end-to-end pixel tests in Chrome it is absolutely necessary to use OS-level screenshot mechanisms, and to know when the requested frame has reached the screen. Various Telemetry-based pixel tests that run on the GPU bots rely on this working. There is also a new SnapshotBrowserTest which attempts to stress test this mechanism. Simply deleting the sequence number from LatencyInfo causes one of these tests to reliably fail."
,
May 19 2018
I took a look and I think, currently, there is no longer a use case for GetSnapshotFromBrowser(). All call points from tests use "true" for its 2nd argument, which means that it is getting the capture from the surface (CopyOutputRequests), and not the OS directly. That makes it functionally identical to the CopyOutputRequests (sans API differences). That said, GetSnapshotFromBrowser() does one thing extra: It forces the renderer to redraw with a specific LatencyInfo. It appears this is what's allowing tests to correlate a snapshot in a specific sequence-of-operations. So, I propose we remove GetSnapshotFromBrowser() from RenderWidgetHostImpl, and replace it with a standalone utility function in src/content/test or thereabouts. It's basically a performance test utility. I don't see that CopyOutputRequests wouldn't satisfy any normal, non-test browser screen capture scenario, including the DevTools ones. Sound good?
,
May 19 2018
The GPU tests still pass false for the second argument via DevTools' Page.captureScreenshot API: https://chromedevtools.github.io/devtools-protocol/tot/Page#method-captureScreenshot https://cs.chromium.org/chromium/src/content/browser/devtools/protocol/page_handler.cc?q=GetSnapshotFromBrowser&sq=package:chromium&g=0&l=620 through this call chain: https://cs.chromium.org/chromium/src/content/test/gpu/gpu_tests/pixel_integration_test.py?q=pixel_integra&sq=package:chromium&g=0&l=142 https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/internal/browser/tab.py?q=tab.py+Screenshot&g=0&l=111 https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_backend.py?q=Screenshot+inspector_backend.py&g=0&l=151 https://cs.chromium.org/chromium/src/third_party/catapult/telemetry/telemetry/internal/backends/chrome_inspector/inspector_page.py?q=Screenshot+inspector_page.py&g=0&l=139 It's crucial to keep this working on as many platforms as actually support the OS-level screenshots. (I think Aura's been taking the screenshots from the back buffer for some time, which is problematic, but other platforms support the real OS-level screenshots.) Otherwise we will reintroduce a significant gap in automated testing of highly platform-dependent presentation code.
,
Oct 31
,
Dec 17
|
|||
►
Sign in to add a comment |
|||
Comment 1 by dgozman@chromium.org
, Feb 14 2018