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

Issue 2035113002: Implement ImageBitmapOptions resize (Closed)

Created:
4 years, 6 months ago by xidachen
Modified:
4 years, 5 months ago
Reviewers:
jbroman
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement ImageBitmapOptions resize In this CL, we add the options resizeWidth && resizeHeight && resizeQuality to the ImageBitmapOptions. All these options are hidding behind the experimtanl flag. Also, this CL implements this options for creating an ImageBitmap from HTMLImageElement, HTMLCanvasElement, ImageBitmap and Blob. For creating an ImageBitmap from ImageData and HTMLVideoElement is a bit more complicated and will finish that in a separate CL. This CL also adds a layout test to ensure the correctness of the behavior. TBR=junov@chromium.org BUG=627855 Committed: https://crrev.com/96e0583198a59d305f8442704e35d7d307120cec Cr-Commit-Position: refs/heads/master@{#405314}

Patch Set 1 #

Patch Set 2 : layout test updated #

Patch Set 3 : needs to start a new CL for this one #

Patch Set 4 : adding tests back #

Patch Set 5 : rebase #

Total comments: 12

Patch Set 6 : address comments #

Total comments: 12

Patch Set 7 : crop && scale in one draw operation, needs to clean up the code #

Patch Set 8 : spec is clear, patch is now ready #

Total comments: 31

Patch Set 9 : address comments #

Total comments: 12

Patch Set 10 : should work, needs to clean up using Optional<cropRect> #

Patch Set 11 : using WTF::Optional<> now, needs to clean up a little #

Patch Set 12 : rebase + clean up #

Total comments: 14

Patch Set 13 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+449 lines, -208 lines) Patch
M third_party/WebKit/LayoutTests/SlowTests View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html View 1 2 3 4 5 6 7 8 9 1 chunk +156 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +15 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +205 lines, -128 lines 0 comments Download
M third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLImageElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/HTMLVideoElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/ImageData.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/ImageData.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +6 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +13 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapOptions.idl View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapSource.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -4 lines 0 comments Download

Messages

Total messages: 36 (16 generated)
xidachen
PTAL
4 years, 5 months ago (2016-06-29 20:55:20 UTC) #2
jbroman
https://codereview.chromium.org/2035113002/diff/80001/third_party/WebKit/LayoutTests/SlowTests File third_party/WebKit/LayoutTests/SlowTests (right): https://codereview.chromium.org/2035113002/diff/80001/third_party/WebKit/LayoutTests/SlowTests#newcode61 third_party/WebKit/LayoutTests/SlowTests:61: crbug.com/24182 virtual/gpu/fast/canvas/canvas-createImageBitmap-resize.html [ Slow ] By the way, do ...
4 years, 5 months ago (2016-06-29 21:14:42 UTC) #3
xidachen
https://codereview.chromium.org/2035113002/diff/80001/third_party/WebKit/LayoutTests/SlowTests File third_party/WebKit/LayoutTests/SlowTests (right): https://codereview.chromium.org/2035113002/diff/80001/third_party/WebKit/LayoutTests/SlowTests#newcode61 third_party/WebKit/LayoutTests/SlowTests:61: crbug.com/24182 virtual/gpu/fast/canvas/canvas-createImageBitmap-resize.html [ Slow ] On 2016/06/29 21:14:41, jbroman ...
4 years, 5 months ago (2016-06-30 15:23:12 UTC) #4
jbroman
lgtm https://codereview.chromium.org/2035113002/diff/100001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/2035113002/diff/100001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode189 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:189: cropRect.setWidth(resizeWidth); Hmm. It seems you're setting parameters to ...
4 years, 5 months ago (2016-06-30 18:52:35 UTC) #5
jbroman
Whoops sorry, not lgtm yet. (I hit the wrong button.)
4 years, 5 months ago (2016-06-30 18:52:55 UTC) #6
xidachen
Now that the spec is clear, this patch is ready for a re-review. https://codereview.chromium.org/2035113002/diff/100001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File ...
4 years, 5 months ago (2016-07-07 13:48:47 UTC) #7
jbroman
https://codereview.chromium.org/2035113002/diff/140001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html File third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html (right): https://codereview.chromium.org/2035113002/diff/140001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html#newcode73 third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html:73: assert_equals(dataMatched, isTheSame, "These two bitmaps should be different."); What's ...
4 years, 5 months ago (2016-07-07 19:18:00 UTC) #8
xidachen
https://codereview.chromium.org/2035113002/diff/140001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html File third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html (right): https://codereview.chromium.org/2035113002/diff/140001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html#newcode73 third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html:73: assert_equals(dataMatched, isTheSame, "These two bitmaps should be different."); On ...
4 years, 5 months ago (2016-07-07 20:43:30 UTC) #9
jbroman
https://codereview.chromium.org/2035113002/diff/140001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/2035113002/diff/140001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode125 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:125: if (parsedOptions.shouldScaleInput && cropRect.x() == 0 && cropRect.y() == ...
4 years, 5 months ago (2016-07-07 21:21:46 UTC) #10
xidachen
The latest PS is ready for re-review. Thank you. https://codereview.chromium.org/2035113002/diff/160001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html File third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html (right): https://codereview.chromium.org/2035113002/diff/160001/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html#newcode78 third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html:78: ...
4 years, 5 months ago (2016-07-13 14:50:23 UTC) #11
jbroman
https://codereview.chromium.org/2035113002/diff/220001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/2035113002/diff/220001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode31 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:31: IntRect cropRect = IntRect(); "IntRect cropRect;" suffices; objects with ...
4 years, 5 months ago (2016-07-13 15:18:57 UTC) #12
xidachen
https://codereview.chromium.org/2035113002/diff/220001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/2035113002/diff/220001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode31 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:31: IntRect cropRect = IntRect(); On 2016/07/13 15:18:57, jbroman wrote: ...
4 years, 5 months ago (2016-07-13 15:52:21 UTC) #13
jbroman
lgtm https://codereview.chromium.org/2035113002/diff/220001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/2035113002/diff/220001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp#newcode588 third_party/WebKit/Source/core/frame/ImageBitmap.cpp:588: || (!cropRect && !isSourceSizeValid(width(), height(), exceptionState))) On 2016/07/13 ...
4 years, 5 months ago (2016-07-13 17:10:29 UTC) #14
xidachen
On 2016/07/13 17:10:29, jbroman wrote: > lgtm > > https://codereview.chromium.org/2035113002/diff/220001/third_party/WebKit/Source/core/frame/ImageBitmap.cpp > File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): > ...
4 years, 5 months ago (2016-07-13 17:21:38 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/2035113002/240001
4 years, 5 months ago (2016-07-13 21:21:38 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/217628)
4 years, 5 months ago (2016-07-13 21:35:13 UTC) #28
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/2035113002/240001
4 years, 5 months ago (2016-07-13 22:09:20 UTC) #31
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 5 months ago (2016-07-13 22:42:07 UTC) #33
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 22:42:18 UTC) #34
commit-bot: I haz the power
4 years, 5 months ago (2016-07-13 22:43:43 UTC) #36
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/96e0583198a59d305f8442704e35d7d307120cec
Cr-Commit-Position: refs/heads/master@{#405314}

Powered by Google App Engine
This is Rietveld 408576698