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

Issue 12314169: Merge 143541 (Closed)

Created:
7 years, 9 months ago by pdr.
Modified:
7 years, 9 months ago
Reviewers:
pdr
CC:
chromium-reviews
Base URL:
http://svn.webkit.org/repository/webkit/branches/chromium/1410/
Visibility:
Public.

Description

Merge 143541 > Account for transform in SVG background images > https://bugs.webkit.org/show_bug.cgi?id=110295 > > Reviewed by Dirk Schulze. > > Source/WebCore: > > Tiled SVG background images are rendererd by drawing the SVG content into a temporary > image buffer, then stamping out a tiled pattern using this buffer. Previously the > image buffer did not account for CSS transforms which could result in pixelated backgrounds. > > This patch takes advantage of the context's transform when sizing the temporary tiling > image buffer. Because the context's transform also includes scale, this patch simplifies > the SVG image code to no longer track scale. > > Test: svg/as-background-image/svg-transformed-background.html > > * loader/cache/CachedImage.cpp: > (WebCore): > (WebCore::CachedImage::imageForRenderer): > > CachedImage::lookupOrCreateImageForRenderer no longer creates images so it has been > refactored into just "imageForRenderer". Previously there were two versions of > lookupOrCreateImageForRenderer; these have been folded into imageForRenderer. > > * loader/cache/CachedImage.h: > * svg/graphics/SVGImage.cpp: > (WebCore::SVGImage::drawPatternForContainer): > > To create the temporary tiling image buffer, the final size in screen coordinates is > needed. This is now computed using the current context's CTM. Because the CTM > already includes the page scale, all page scale tracking can be removed. > > The adjustments to srcRect and the pattern transform are the same as before, just > refactored to use imageBufferScale which has x and y components. > > * svg/graphics/SVGImage.h: > * svg/graphics/SVGImageCache.cpp: > (WebCore::SVGImageCache::setContainerSizeForRenderer): > > Because the page scale needed to be cached between calls to > setContainerSizeForRenderer, this function was written to modify an existing cache > entry. Because the page scale no longer needs to be tracked, this code has been > simplified to re-write any existing cache entry. > > (WebCore::SVGImageCache::imageSizeForRenderer): > > This function has been simplified by calling SVGImageForContainer::size() instead > of computing this value manually. The value returned remains the same, containing > the container size multiplied by zoom. > > (WebCore::SVGImageCache::imageForRenderer): > > Previously we set the page scale on every call to imageForRenderer. Because page scale > no longer needs to be tracked, this function has been simplified to simply return > the cached SVGImageForContainer. > > * svg/graphics/SVGImageForContainer.cpp: > (WebCore::SVGImageForContainer::drawPattern): > * svg/graphics/SVGImageForContainer.h: > (WebCore::SVGImageForContainer::create): > (WebCore::SVGImageForContainer::SVGImageForContainer): > (SVGImageForContainer): > > LayoutTests: > > * svg/as-background-image/svg-transformed-background-expected.html: Added. > * svg/as-background-image/svg-transformed-background.html: Added. > TBR=pdr@google.com Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=144239

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -74 lines) Patch
A + LayoutTests/svg/as-background-image/svg-transformed-background.html View 0 chunks +-1 lines, --1 lines 0 comments Download
A + LayoutTests/svg/as-background-image/svg-transformed-background-expected.html View 0 chunks +-1 lines, --1 lines 0 comments Download
M Source/WebCore/loader/cache/CachedImage.h View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/WebCore/loader/cache/CachedImage.cpp View 2 chunks +12 lines, -22 lines 0 comments Download
M Source/WebCore/svg/graphics/SVGImage.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/WebCore/svg/graphics/SVGImage.cpp View 1 chunk +15 lines, -11 lines 0 comments Download
M Source/WebCore/svg/graphics/SVGImageCache.cpp View 3 chunks +5 lines, -23 lines 0 comments Download
M Source/WebCore/svg/graphics/SVGImageForContainer.h View 2 chunks +10 lines, -15 lines 0 comments Download
M Source/WebCore/svg/graphics/SVGImageForContainer.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
pdr.
7 years, 9 months ago (2013-02-27 22:22:02 UTC) #1
pdr.
7 years, 9 months ago (2013-02-27 22:22:20 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 manually as r144239.

Powered by Google App Engine
This is Rietveld 408576698