[DevTools] Fix taking screenshot with viewport override
When passing clip (which translates to viewport override), we use it as a visible rect override. Clip/viewport in the protocol uses document coordinates (relative to the 0;0 of the document), but visible rect is relative to the frame. For clipping to work, we should translate the coordinates. This bug does not usually manifest due to kPixelDistanceToRecord inflation of the interesting rect (see composited_layer_mapping.cc), which paints interesetings rect +4000px in every direction. If scroll position is no more than 4000, this compensates for the wrong visible rect override. Bug: none Change-Id: I9c994c08da379c76c56523969f27c049be77d9a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068890Reviewed-by:Mathias Bynens <mathias@chromium.org> Reviewed-by:
Philip Rogers <pdr@chromium.org> Reviewed-by:
Andrey Kosyakov <caseq@chromium.org> Commit-Queue: Dmitry Gozman <dgozman@chromium.org> Cr-Commit-Position: refs/heads/master@{#744777}
Showing
Please register or sign in to comment