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

Issue 1489003002: Drop Image::setContainerSize() (Closed)

Created:
5 years ago by davve
Modified:
5 years ago
CC:
blink-reviews, blink-reviews-html_chromium.org, blink-reviews-platform-graphics_chromium.org, Rik, chromium-reviews, danakj, dglazkov+blink, dshwang, drott+blinkwatch_chromium.org, krit, f(malita), gyuyoung2, jbroman, kouhei+svg_chromium.org, pdr+graphicswatchlist_chromium.org, pdr+svgwatchlist_chromium.org, rwlbuis, Stephen Chennney, vmpstr+blinkwatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Drop Image::setContainerSize() Prior to this patch, the only user of Image::setContainerSize() was HTMLImageElement::getSourceImageForCanvas(). SVGImage, one the relevant kinds of image that return true for Image::usesContainerSize(), is a shared resource between all places in the document pointing to the same SVG image. Each time a SVGImage is drawn, the container size it is drawn relative to is saved. This may cause subsequent paints of the same SVGImage to re-use the old container size unless a new one is provided. The old code addressed just that. When it detected that there was no layout object attached, it overwrote the old container size with the size of the image itself, to avoid reusing an old container size. The new code uses the SVGImageForContainer wrapper to insert the image size as container size. This closes the loop for using _any_ container size at all from the Image element. It seems unreasonable that the layout'ed size should have anything to do with what's drawn to the canvas anyway. GeneratedImage had a setContainerSize() implementation too, which is removed in this patch. It's suspected that this implementation was unused since a generated image can't be set on a HTMLImageElement directly. BUG=563923 Committed: https://crrev.com/9503d96104a3cb851fc4d4fe28c065edc7e17db3 Cr-Commit-Position: refs/heads/master@{#363437}

Patch Set 1 #

Total comments: 7

Patch Set 2 : Move wrapping to CanvasRenderingContext2D; fix patterns #

Patch Set 3 : Back to ps#1 way, with fixed is_expensive test #

Messages

Total messages: 40 (14 generated)
davve
Supporting fragments properly when drawing SVG images to canvases must be super important, right? :) ...
5 years ago (2015-12-01 13:23:00 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1489003002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1489003002/1
5 years ago (2015-12-01 13:23:22 UTC) #5
fs
https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-svg-fragments.html File third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-svg-fragments.html (right): https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-svg-fragments.html#newcode8 third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-svg-fragments.html:8: var domImage = images.item(i); Nit: images[i]? (any particular reason ...
5 years ago (2015-12-01 14:23:21 UTC) #7
fs
On 2015/12/01 at 14:23:21, fs wrote: > https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-svg-fragments.html > File third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-svg-fragments.html (right): > > https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/LayoutTests/svg/canvas/canvas-draw-svg-fragments.html#newcode8 ...
5 years ago (2015-12-01 14:30:48 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-01 14:35:55 UTC) #10
davve
https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode610 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:610: sourceImage = SVGImageForContainer::create(toSVGImage(cachedImage()->image()), On 2015/12/01 14:23:21, fs wrote: > ...
5 years ago (2015-12-01 14:54:16 UTC) #11
davve
https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode610 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:610: sourceImage = SVGImageForContainer::create(toSVGImage(cachedImage()->image()), On 2015/12/01 14:54:16, David Vest wrote: ...
5 years ago (2015-12-01 14:57:38 UTC) #12
fs
https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode610 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:610: sourceImage = SVGImageForContainer::create(toSVGImage(cachedImage()->image()), On 2015/12/01 at 14:54:16, David Vest ...
5 years ago (2015-12-01 14:59:22 UTC) #13
fs
https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp File third_party/WebKit/Source/core/html/HTMLImageElement.cpp (right): https://codereview.chromium.org/1489003002/diff/1/third_party/WebKit/Source/core/html/HTMLImageElement.cpp#newcode610 third_party/WebKit/Source/core/html/HTMLImageElement.cpp:610: sourceImage = SVGImageForContainer::create(toSVGImage(cachedImage()->image()), On 2015/12/01 at 14:57:38, David Vest ...
5 years ago (2015-12-01 15:12:17 UTC) #14
davve
Can't say I'm super happy with how this turned out so far. Comments welcome! I ...
5 years ago (2015-12-02 15:32:01 UTC) #15
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1489003002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1489003002/20001
5 years ago (2015-12-02 15:33:36 UTC) #17
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_dbg_recipe/builds/153708)
5 years ago (2015-12-02 15:57:50 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1489003002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1489003002/40001
5 years ago (2015-12-03 11:20:46 UTC) #21
davve
Didn't find a good way to do wrapping in CanvasRenderingContext2D. Back to the initial way, ...
5 years ago (2015-12-03 11:25:47 UTC) #22
fs
lgtm
5 years ago (2015-12-03 11:46:17 UTC) #23
davve
Florin, can you take a look at platform/?
5 years ago (2015-12-03 12:38:37 UTC) #25
davve
Justin, can you take a look at modules/canvas2d/?
5 years ago (2015-12-03 12:40:14 UTC) #27
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-03 12:45:42 UTC) #29
f(malita)
lgtm
5 years ago (2015-12-03 20:12:55 UTC) #30
davve
Stephen, can you review modules/canvas2d? The reason isSVGImage() can't be used from modules/canvas2d anymore is ...
5 years ago (2015-12-04 08:05:34 UTC) #32
Stephen White
LGTM, but Justin might like to have a look.
5 years ago (2015-12-04 14:51:38 UTC) #33
davve
On 2015/12/04 14:51:38, Stephen White wrote: > LGTM, but Justin might like to have a ...
5 years ago (2015-12-04 15:16:27 UTC) #34
Justin Novosad
On 2015/12/04 15:16:27, David Vest wrote: > On 2015/12/04 14:51:38, Stephen White wrote: > > ...
5 years ago (2015-12-04 15:43:11 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1489003002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1489003002/40001
5 years ago (2015-12-07 07:30:44 UTC) #37
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years ago (2015-12-07 10:07:26 UTC) #38
commit-bot: I haz the power
5 years ago (2015-12-07 10:08:24 UTC) #40
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/9503d96104a3cb851fc4d4fe28c065edc7e17db3
Cr-Commit-Position: refs/heads/master@{#363437}

Powered by Google App Engine
This is Rietveld 408576698