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

Issue 1767633002: Support canvas size as default object size (Closed)

Created:
4 years, 9 months ago by davve
Modified:
4 years, 9 months ago
Reviewers:
fs, Justin Novosad
CC:
fs, ajuma+watch-canvas_chromium.org, blink-reviews, blink-reviews-html_chromium.org, Rik, chromium-reviews, dglazkov+blink, dshwang, krit, eric.carlson_apple.com, feature-media-reviews_chromium.org, f(malita), gyuyoung2, kouhei+svg_chromium.org, mlamouri+watch-blink_chromium.org, pdr+svgwatchlist_chromium.org, philipj_slow, rwlbuis, Stephen Chennney
Base URL:
https://chromium.googlesource.com/chromium/src.git@pass-default-object-size
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support canvas size as default object size By adding a defaultObjectSize parameter to * CanvasImageSource::elementSize, * CanvasImageSource::defaultDestinationSize * CanvasImageSource::getSourceImageForCanvas we can support the default sizing algorithm in HTMLImageElement for images that lack an intrinsic size. This affects both drawImage() and createPattern(). At time of writing there doesn't exist clear spec text for how createPattern should behave. In https://github.com/whatwg/html/issues/735 the behavior in this CL has been suggested as a reasonble starting point. BUG=581357, 475009 Committed: https://crrev.com/c1bb9d9096de137378cb1029021aed40fcbf76e4 Cr-Commit-Position: refs/heads/master@{#379818}

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 3

Patch Set 3 : Save image size on stack #

Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -40 lines) Patch
A third_party/WebKit/LayoutTests/svg/canvas/canvas-default-object-sizing.html View 1 chunk +99 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/svg/canvas/canvas-default-object-sizing-expected.html View 1 chunk +32 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.cpp View 1 3 chunks +14 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/canvas/CanvasImageSource.h View 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.h View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp View 1 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/svg/graphics/SVGImageForContainer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp View 1 2 6 chunks +13 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp View 2 chunks +3 lines, -3 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 12 (4 generated)
davve
This is a new attempt at supporting the default object sizing algorithm in canvas. PTAL.
4 years, 9 months ago (2016-03-04 14:11:54 UTC) #2
fs
core/ changes LGTM (assuming Justin is ok with the interface changes.) https://codereview.chromium.org/1767633002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): ...
4 years, 9 months ago (2016-03-04 14:31:26 UTC) #3
Justin Novosad
You got rid of the statefulness that existed in the previous incarnation. It is more ...
4 years, 9 months ago (2016-03-04 14:38:59 UTC) #4
davve
https://codereview.chromium.org/1767633002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp (right): https://codereview.chromium.org/1767633002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp#newcode1029 third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp:1029: if (imageSource->elementSize(defaultObjectSize).width() * imageSource->elementSize(defaultObjectSize).height() > width() * height() * ...
4 years, 9 months ago (2016-03-04 15:10:36 UTC) #5
Justin Novosad
On 2016/03/04 15:10:36, David Vest wrote: > https://codereview.chromium.org/1767633002/diff/20001/third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp > File third_party/WebKit/Source/modules/canvas2d/BaseRenderingContext2D.cpp > (right): > > ...
4 years, 9 months ago (2016-03-04 15:45:41 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1767633002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1767633002/40001
4 years, 9 months ago (2016-03-08 12:14:06 UTC) #9
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 9 months ago (2016-03-08 13:23:18 UTC) #10
commit-bot: I haz the power
4 years, 9 months ago (2016-03-08 13:24:12 UTC) #12
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/c1bb9d9096de137378cb1029021aed40fcbf76e4
Cr-Commit-Position: refs/heads/master@{#379818}

Powered by Google App Engine
This is Rietveld 408576698