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

Issue 2749703002: Refactor ImageFrame::setSizeAndColorSpace() (Closed)

Created:
3 years, 9 months ago by cblume
Modified:
3 years, 9 months ago
CC:
chromium-reviews, jzern, krit, drott+blinkwatch_chromium.org, urvang, blink-reviews-platform-graphics_chromium.org, skal, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, fmalita+watch_chromium.org, Rik, Stephen Chennney, Justin Novosad, blink-reviews, kinuko+watch, ajuma+watch_chromium.org, danakj+watch_chromium.org, rwlbuis
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor ImageFrame::setSizeAndColorSpace() The function ImageFrame::setSizeAndColorSpace does multiple things. It sets the size and color space & zero fills the data. We want to be able to not zero fill the entire image. The image decoder can fill the entire image frame with valid pixel data. And in the case of partial images, the decoder knows which pixels do not contain image data, allowing them to zero fill a smaller area. But for now, just separate the concept of setSizeAndColorSpace() and zeroFillPixelData(). No change in behavior, no new tests. R=scroggo@chromium.org BUG=701143 Review-Url: https://codereview.chromium.org/2749703002 Cr-Commit-Position: refs/heads/master@{#458437} Committed: https://chromium.googlesource.com/chromium/src/+/b6b96c3de7c6db78762ce660b274514bd18a1c0b

Patch Set 1 #

Patch Set 2 : Fix alloc returned value flipped #

Total comments: 11

Patch Set 3 : Rename setSizeAndColorSpace() to allocateBackingStore() #

Patch Set 4 : Forgot to update the call sites #

Total comments: 4

Patch Set 5 : Rename allocateBackingStore() to allocatePixelData() #

Patch Set 6 : Rebase #

Patch Set 7 : Call setHasAlpha(true); from within zeroFillPixelData() #

Total comments: 9

Patch Set 8 : Not calling setHasAlpha() inside zeroFillPixelData(). Updating comments and DCHECK #

Patch Set 9 : BMP reader should be setting hasAlpha to true, not false #

Patch Set 10 : Remove comments that focus on transparency, which is no longer explicitly set #

Total comments: 2

Patch Set 11 : Add trailing period to comment #

Patch Set 12 : Moving to another CR the separation of zeroing pixel data from setting alpha #

Messages

Total messages: 91 (51 generated)
cblume
PTAL
3 years, 9 months ago (2017-03-14 04:22:45 UTC) #11
Peter Kasting
LGTM
3 years, 9 months ago (2017-03-14 04:55:37 UTC) #12
Noel Gordon
So I grok the idea: > We want to be able to not zero fill ...
3 years, 9 months ago (2017-03-14 06:30:42 UTC) #13
Peter Kasting
https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (right): https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp#newcode944 third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:944: buffer.zeroFillPixelData(); On 2017/03/14 06:30:41, noel gordon wrote: > Here ...
3 years, 9 months ago (2017-03-14 07:34:40 UTC) #14
cblume
On 2017/03/14 06:30:42, noel gordon wrote: > So I grok the idea: > > > ...
3 years, 9 months ago (2017-03-14 07:59:36 UTC) #15
cblume
https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode111 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111: DCHECK(!width() && !height()); On 2017/03/14 06:30:41, noel gordon wrote: ...
3 years, 9 months ago (2017-03-14 07:59:51 UTC) #16
f(malita)
https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode111 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111: DCHECK(!width() && !height()); On 2017/03/14 07:59:51, cblume wrote: > ...
3 years, 9 months ago (2017-03-14 13:18:05 UTC) #17
Noel Gordon
https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode111 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111: DCHECK(!width() && !height()); On 2017/03/14 13:18:05, f(malita) wrote: > ...
3 years, 9 months ago (2017-03-14 14:26:26 UTC) #18
scroggo_chromium
https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode111 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111: DCHECK(!width() && !height()); On 2017/03/14 06:30:41, noel gordon wrote: ...
3 years, 9 months ago (2017-03-14 14:28:59 UTC) #19
Noel Gordon
https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode111 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111: DCHECK(!width() && !height()); On 2017/03/14 14:28:59, scroggo_chromium wrote: > ...
3 years, 9 months ago (2017-03-14 14:49:10 UTC) #20
cblume
https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/20001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode111 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:111: DCHECK(!width() && !height()); On 2017/03/14 14:49:10, noel gordon wrote: ...
3 years, 9 months ago (2017-03-14 17:30:50 UTC) #21
Peter Kasting
On 2017/03/14 17:30:50, cblume wrote: > I don't immediately see a reason why we set ...
3 years, 9 months ago (2017-03-14 19:58:20 UTC) #28
cblume
On 2017/03/14 19:58:20, Peter Kasting wrote: > On 2017/03/14 17:30:50, cblume wrote: > > I ...
3 years, 9 months ago (2017-03-14 20:49:45 UTC) #31
Peter Kasting
On 2017/03/14 20:49:45, cblume wrote: > I took a look to see what changes would ...
3 years, 9 months ago (2017-03-14 23:04:23 UTC) #32
cblume
On 2017/03/14 23:04:23, Peter Kasting wrote: > On 2017/03/14 20:49:45, cblume wrote: > > I ...
3 years, 9 months ago (2017-03-14 23:53:53 UTC) #33
Peter Kasting
On 2017/03/14 23:53:53, cblume wrote: > If we want to continue to treat not-actually-using-alpha images ...
3 years, 9 months ago (2017-03-14 23:58:40 UTC) #34
cblume
On 2017/03/14 23:58:40, Peter Kasting wrote: > On 2017/03/14 23:53:53, cblume wrote: > > If ...
3 years, 9 months ago (2017-03-15 00:23:11 UTC) #35
Peter Kasting
On 2017/03/15 00:23:11, cblume wrote: > On 2017/03/14 23:58:40, Peter Kasting wrote: > > On ...
3 years, 9 months ago (2017-03-15 06:56:24 UTC) #36
cblume
On 2017/03/15 06:56:24, Peter Kasting wrote: > On 2017/03/15 00:23:11, cblume wrote: > > On ...
3 years, 9 months ago (2017-03-15 07:08:36 UTC) #37
Peter Kasting
On 2017/03/15 07:08:36, cblume wrote: > On 2017/03/15 06:56:24, Peter Kasting wrote: > > On ...
3 years, 9 months ago (2017-03-15 10:09:12 UTC) #38
Noel Gordon
https://codereview.chromium.org/2749703002/diff/60001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h File third_party/WebKit/Source/platform/image-decoders/ImageFrame.h (right): https://codereview.chromium.org/2749703002/diff/60001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h#newcode124 third_party/WebKit/Source/platform/image-decoders/ImageFrame.h:124: bool allocateBackingStore(int newWidth, int newHeight, sk_sp<SkColorSpace>); Better, and re-reading ...
3 years, 9 months ago (2017-03-15 13:42:51 UTC) #39
cblume
I've made a separate issue to handle opaque images with an unused alpha channel: https://codereview.chromium.org/2756463003 ...
3 years, 9 months ago (2017-03-16 02:29:25 UTC) #48
cblume
I think this might now satisfy everybody's comments. If I missed anything let me know.
3 years, 9 months ago (2017-03-16 10:23:23 UTC) #51
Noel Gordon
On 2017/03/16 02:29:25, cblume wrote: > I've made a separate issue to handle opaque images ...
3 years, 9 months ago (2017-03-16 11:32:07 UTC) #52
Noel Gordon
https://codereview.chromium.org/2749703002/diff/60001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h File third_party/WebKit/Source/platform/image-decoders/ImageFrame.h (right): https://codereview.chromium.org/2749703002/diff/60001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h#newcode124 third_party/WebKit/Source/platform/image-decoders/ImageFrame.h:124: bool allocateBackingStore(int newWidth, int newHeight, sk_sp<SkColorSpace>); On 2017/03/16 02:29:25, ...
3 years, 9 months ago (2017-03-16 11:34:04 UTC) #53
Noel Gordon
https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode81 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:81: setHasAlpha(true); Harmless, but also redundant. It sets the m_bitmap ...
3 years, 9 months ago (2017-03-16 12:01:50 UTC) #56
Noel Gordon
On 2017/03/16 11:32:07, noel gordon wrote: > On 2017/03/16 02:29:25, cblume wrote: > > I've ...
3 years, 9 months ago (2017-03-16 23:54:59 UTC) #57
cblume
On 2017/03/16 23:54:59, noel gordon wrote: > The current change does not change existing behavior, ...
3 years, 9 months ago (2017-03-17 05:34:22 UTC) #58
cblume
https://codereview.chromium.org/2749703002/diff/60001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h File third_party/WebKit/Source/platform/image-decoders/ImageFrame.h (right): https://codereview.chromium.org/2749703002/diff/60001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.h#newcode124 third_party/WebKit/Source/platform/image-decoders/ImageFrame.h:124: bool allocateBackingStore(int newWidth, int newHeight, sk_sp<SkColorSpace>); On 2017/03/16 11:34:04, ...
3 years, 9 months ago (2017-03-17 05:35:14 UTC) #59
Peter Kasting
https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode81 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:81: setHasAlpha(true); On 2017/03/17 05:35:14, cblume wrote: > On 2017/03/16 ...
3 years, 9 months ago (2017-03-17 06:35:50 UTC) #62
scroggo_chromium
https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp File third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp (right): https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp#newcode946 third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp:946: // The buffer is transparent outside the decoded area ...
3 years, 9 months ago (2017-03-17 14:36:38 UTC) #65
cblume
https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode81 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:81: setHasAlpha(true); On 2017/03/17 06:35:50, Peter Kasting wrote: > On ...
3 years, 9 months ago (2017-03-17 18:05:46 UTC) #68
Peter Kasting
(For clarity, still LGTM) https://codereview.chromium.org/2749703002/diff/180001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/180001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode108 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:108: // allocatePixelData() should only be ...
3 years, 9 months ago (2017-03-17 21:18:40 UTC) #72
cblume
I need f(malita)'s approval for third_party/WebKit/Source/platform/graphics/test/MockImageDecoder.h But I'll also wait for approvals from the others ...
3 years, 9 months ago (2017-03-17 21:41:16 UTC) #75
Noel Gordon
https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode81 third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp:81: setHasAlpha(true); On 2017/03/17 18:05:45, cblume wrote: > On 2017/03/17 ...
3 years, 9 months ago (2017-03-20 13:24:52 UTC) #78
cblume
On 2017/03/20 13:24:52, noel gordon wrote: > https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp > File third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp (right): > > https://codereview.chromium.org/2749703002/diff/120001/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp#newcode81 ...
3 years, 9 months ago (2017-03-20 20:30:14 UTC) #81
Noel Gordon
LGTM
3 years, 9 months ago (2017-03-20 21:02:47 UTC) #84
f(malita)
LGTM
3 years, 9 months ago (2017-03-21 12:27:59 UTC) #85
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/2749703002/220001
3 years, 9 months ago (2017-03-21 16:34:56 UTC) #88
commit-bot: I haz the power
3 years, 9 months ago (2017-03-21 16:44:00 UTC) #91
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/b6b96c3de7c6db78762ce660b274...

Powered by Google App Engine
This is Rietveld 408576698