|
|
Chromium Code Reviews|
Created:
4 years, 9 months ago by xidachen Modified:
4 years, 9 months ago Reviewers:
Justin Novosad CC:
chromium-reviews, blink-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false)
When creating an ImageBitmap from an HTMLImageElement, it calls the
cropImage() function in ImageBitmap class, and it should not get into
the block of using ImageDecoder, because the SkImage that can be obtained
from image->imageForCurrentFrame() is already un-premultiplied
in the case of HTMLImageElement.
Locally I have WebGL conformance and conformance2 tests that pass
with this change but fail without this change.
BUG=591263
Committed: https://crrev.com/2160ae0126d1adc88ec8abe5f97291119cb42d68
Cr-Commit-Position: refs/heads/master@{#378864}
Patch Set 1 #Patch Set 2 : #Patch Set 3 : back to PS#1, which makes more sense #
Total comments: 2
Patch Set 4 : use enum instead of bool #Messages
Total messages: 21 (11 generated)
The CQ bit was checked by xidachen@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1756593002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1756593002/20001
Description was changed from ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of ImageDecoder, instead it should return a subregion of the source directly. ========== to ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of ImageDecoder, instead it should return a subregion of the source directly. Locally I have WebGL conformance and conformance2 tests that passes with this change but fails without this change. ==========
Description was changed from ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of ImageDecoder, instead it should return a subregion of the source directly. Locally I have WebGL conformance and conformance2 tests that passes with this change but fails without this change. ========== to ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of ImageDecoder, instead it should return a subregion of the source directly. Locally I have WebGL conformance and conformance2 tests that pass with this change but fail without this change. ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of ImageDecoder, instead it should return a subregion of the source directly. Locally I have WebGL conformance and conformance2 tests that pass with this change but fail without this change. ========== to ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of using ImageDecoder, because the SkImage that can be obtained from image->imageForCurrentFrame() is already un-premultiplied in the case of HTMLImageElement. Locally I have WebGL conformance and conformance2 tests that pass with this change but fail without this change. BUG=591263 ==========
xidachen@chromium.org changed reviewers: + junov@chromium.org
PTAL.
https://codereview.chromium.org/1756593002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/1756593002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/frame/ImageBitmap.cpp:168: m_image = cropImage(image->cachedImage()->image(), cropRect, flipY, m_isPremultiplied, false); Poor readability. You have two options: 1) Change the bool argument to use an enum to make litteral arguments at the call site more readable. 2) Use an intermediate variable: bool isBitmapPremultiplied = false cropImage(..., isBitmapPremultiplied); 1) is generally preferred especially for public methods, but might be overkill in this case.
https://codereview.chromium.org/1756593002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): https://codereview.chromium.org/1756593002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/frame/ImageBitmap.cpp:168: m_image = cropImage(image->cachedImage()->image(), cropRect, flipY, m_isPremultiplied, false); On 2016/03/02 17:19:25, Justin Novosad wrote: > Poor readability. You have two options: > 1) Change the bool argument to use an enum to make litteral arguments at the > call site more readable. > 2) Use an intermediate variable: > bool isBitmapPremultiplied = false > cropImage(..., isBitmapPremultiplied); > > 1) is generally preferred especially for public methods, but might be overkill > in this case. Agreed, using enum makes more sense IMO.
On 2016/03/02 18:00:57, xidachen wrote: > https://codereview.chromium.org/1756593002/diff/40001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/frame/ImageBitmap.cpp (right): > > https://codereview.chromium.org/1756593002/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/frame/ImageBitmap.cpp:168: m_image = > cropImage(image->cachedImage()->image(), cropRect, flipY, m_isPremultiplied, > false); > On 2016/03/02 17:19:25, Justin Novosad wrote: > > Poor readability. You have two options: > > 1) Change the bool argument to use an enum to make litteral arguments at the > > call site more readable. > > 2) Use an intermediate variable: > > bool isBitmapPremultiplied = false > > cropImage(..., isBitmapPremultiplied); > > > > 1) is generally preferred especially for public methods, but might be overkill > > in this case. > > Agreed, using enum makes more sense IMO. Hah, and we already had one for this! lgtm
The CQ bit was checked by xidachen@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1756593002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1756593002/60001
The CQ bit was unchecked by xidachen@chromium.org
The CQ bit was checked by xidachen@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1756593002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1756593002/60001
Message was sent while issue was closed.
Description was changed from ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of using ImageDecoder, because the SkImage that can be obtained from image->imageForCurrentFrame() is already un-premultiplied in the case of HTMLImageElement. Locally I have WebGL conformance and conformance2 tests that pass with this change but fail without this change. BUG=591263 ========== to ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of using ImageDecoder, because the SkImage that can be obtained from image->imageForCurrentFrame() is already un-premultiplied in the case of HTMLImageElement. Locally I have WebGL conformance and conformance2 tests that pass with this change but fail without this change. BUG=591263 ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001)
Message was sent while issue was closed.
Description was changed from ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of using ImageDecoder, because the SkImage that can be obtained from image->imageForCurrentFrame() is already un-premultiplied in the case of HTMLImageElement. Locally I have WebGL conformance and conformance2 tests that pass with this change but fail without this change. BUG=591263 ========== to ========== Fix bug for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) When creating an ImageBitmap from an HTMLImageElement, it calls the cropImage() function in ImageBitmap class, and it should not get into the block of using ImageDecoder, because the SkImage that can be obtained from image->imageForCurrentFrame() is already un-premultiplied in the case of HTMLImageElement. Locally I have WebGL conformance and conformance2 tests that pass with this change but fail without this change. BUG=591263 Committed: https://crrev.com/2160ae0126d1adc88ec8abe5f97291119cb42d68 Cr-Commit-Position: refs/heads/master@{#378864} ==========
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/2160ae0126d1adc88ec8abe5f97291119cb42d68 Cr-Commit-Position: refs/heads/master@{#378864} |
