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

Issue 2753633003: Implement SVGImage::applyShader() (Closed)

Created:
3 years, 9 months ago by f(malita)
Modified:
3 years, 9 months ago
Reviewers:
Stephen Chennney, fs
CC:
fs, blink-reviews, chromium-reviews, krit, fmalita+watch_chromium.org, gyuyoung2, kouhei+svg_chromium.org, pdr+svgwatchlist_chromium.org, reed1, rwlbuis, Stephen Chennney
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement SVGImage::applyShader() Currently, when SVGImages need to be painted via shaders (e.g. rounded borders) we build an SkImage backed by an SkPictureImageGenerator. The problem is SkPictureImageGenerator has an intrinsic resolution, so it locks the rasterization scale prematurely. If we later scale this SkImage (pinch zoom, or device scale factor on certain platforms), we're scaling a bitmap - not a vector recording. To avoid this, implement an applyShader() override and use a SkPictureShader (which does not lock the resolution) instead of SkImage/SkPictureImageGenerator. BUG=696575 R=fs@opera.com,schenney@chromium.org Review-Url: https://codereview.chromium.org/2753633003 Cr-Commit-Position: refs/heads/master@{#457429} Committed: https://chromium.googlesource.com/chromium/src/+/f3470d2b864f14e076b1c891d39f7a65b5ab78b0

Patch Set 1 #

Patch Set 2 : let's not forget animations this time #

Patch Set 3 : fix container zoom handling #

Patch Set 4 : rebase #

Total comments: 2

Patch Set 5 : rebaseline #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -34 lines) Patch
M third_party/WebKit/LayoutTests/platform/linux/svg/as-image/image-respects-deviceScaleFactor-expected.png View 1 2 3 4 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/svg/as-image/image-respects-deviceScaleFactor-expected.txt View 1 2 3 4 1 chunk +8 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/svg/as-image/image-respects-deviceScaleFactor-expected.png View 1 2 3 4 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/svg/as-image/image-respects-deviceScaleFactor-expected.txt View 1 2 3 4 1 chunk +8 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/svg/as-image/image-respects-deviceScaleFactor-expected.png View 1 2 3 4 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/svg/as-image/image-respects-deviceScaleFactor-expected.txt View 1 2 3 4 1 chunk +8 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/svg/as-image/image-respects-deviceScaleFactor.html View 1 chunk +11 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.h View 1 2 4 chunks +19 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp View 1 2 3 4 5 chunks +82 lines, -26 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.h View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.cpp View 1 2 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (16 generated)
f(malita)
Still waiting for rebaseline for the modified test (https://storage.googleapis.com/chromium-layout-test-archives/mac10_9_blink_rel/2184/layout-test-results/results.html), but other than that I think ...
3 years, 9 months ago (2017-03-15 20:41:39 UTC) #11
Stephen Chennney
I think it's good but I'd like fs@ to also take a look, given my ...
3 years, 9 months ago (2017-03-15 20:52:35 UTC) #12
fs
On 2017/03/15 at 20:52:35, schenney wrote: > I think it's good but I'd like fs@ ...
3 years, 9 months ago (2017-03-15 21:08:59 UTC) #13
f(malita)
https://codereview.chromium.org/2753633003/diff/60001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp File third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp (right): https://codereview.chromium.org/2753633003/diff/60001/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp#newcode262 third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp:262: scaledSrc.scale(1 / zoom); On 2017/03/15 21:08:58, fs wrote: > ...
3 years, 9 months ago (2017-03-16 12:59:04 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2753633003/80001
3 years, 9 months ago (2017-03-16 12:59:18 UTC) #19
commit-bot: I haz the power
3 years, 9 months ago (2017-03-16 14:26:27 UTC) #22
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/f3470d2b864f14e076b1c891d39f...

Powered by Google App Engine
This is Rietveld 408576698