Refactor container size setup for SVGImage
This moves all the mutation of the underlying document into SVGImage::PaintRecordForCurrentFrame, making the single point where container/viewport size is set. The rounded container size is now passed via DrawInfo which allows eliminating the round-tripping of the container size via the LayoutSVGRoot. This now also means that all the rounded sizes are easily visible in one spot. This also makes painting directly via SVGImage (which should be very rare) deterministic by (re)setting the "intrinsic size" just as when painting via SVGImageForContainer. Also move the null-check of |SVGImage::page_| into PaintRecordForCurrentFrame. This should be a rare enough occurrence that it isn't worth having as an early-out - and the first access to the underlying Page/Document is now in said method. Rename the |src_rect| argument to SVGImage::DrawInternal to |unzoomed_src_rect| to reflect that it should no longer contain any zoom from a container. Bug: 1070583, 1123047 Change-Id: I0c950f5474fac957c53b908c1405736ec9d09393 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2555079Reviewed-by:Stephen Chenney <schenney@chromium.org> Commit-Queue: Fredrik Söderquist <fs@opera.com> Cr-Commit-Position: refs/heads/master@{#830953}
Showing
Please register or sign in to comment