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

Issue 2257513002: Refactor ImageDecoder factories (Closed)

Created:
4 years, 4 months ago by f(malita)
Modified:
4 years, 3 months ago
CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, Peter Beverloo, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, Justin Novosad, haraken, Rik, blink-reviews, piman+watch_chromium.org, danakj+watch_chromium.org, ajuma+watch_chromium.org, Stephen Chennney, rwlbuis, reed1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor ImageDecoder factories The vast majority of ImageDecoder::create clients do something along these lines: sniffResult = ImageDecoder::determineImageType(data); decoder = ImageDecoder::create(sniffResult, ...); if (decoder) decoder->setData(data, ...); I.e. 1) we start off with some data in a SharedBuffer 2) we call determineImageType() on that data, to figure the codec type 3) we instantiate the decoder 4) and, finally, we pass the data to the new decoder using setData() The downsides are a) determineImageType() allocates a temporary SegmentReader in order to use FastSegmentReader for signature consolidation; this reader is then thrown away and recreated in setData() (because internally ImageDecoder stores a SegmentReader). b) unnecessarily verbose/stateful decoder construction sequence This CL expands the create() factory to fuse all these steps. We get to reuse a single SegmentReader, and the construction is now atomic. We also get to remove determineImageType from the public ImageDecoder API. Refactoring only, no functional changes expected. Committed: https://crrev.com/9e2e0f5824975f43ad9374ea5e97100b77925fc1 Cr-Commit-Position: refs/heads/master@{#413736}

Patch Set 1 #

Patch Set 2 : rebased #

Patch Set 3 : cleanup #

Total comments: 15

Patch Set 4 : review #

Patch Set 5 : review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+192 lines, -163 lines) Patch
M third_party/WebKit/Source/core/frame/ImageBitmap.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/core/imagebitmap/ImageBitmapFactories.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/exported/WebImage.cpp View 1 2 chunks +6 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/BitmapImage.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp View 1 1 chunk +5 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h View 1 3 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp View 1 2 3 2 chunks +23 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTest.cpp View 13 chunks +17 lines, -19 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoderTestWoPlatform.cpp View 1 2 3 2 chunks +23 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp View 1 2 3 4 chunks +12 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageSource.cpp View 1 2 3 1 chunk +12 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp View 1 chunk +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp View 1 chunk +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h View 1 2 3 3 chunks +31 lines, -22 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 1 2 3 2 chunks +45 lines, -37 lines 0 comments Download

Messages

Total messages: 41 (31 generated)
f(malita)
Follow-up to http://crrev.com/2252723003. Hiding some ImageDecoder details, and hopefully making the client code cleaner.
4 years, 4 months ago (2016-08-19 17:39:42 UTC) #14
Peter Kasting
LGTM https://codereview.chromium.org/2257513002/diff/40001/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp File third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp (right): https://codereview.chromium.org/2257513002/diff/40001/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp#newcode93 third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp:93: std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(m_data, true /* allDataReceived */, ...
4 years, 4 months ago (2016-08-19 23:04:59 UTC) #16
f(malita)
https://codereview.chromium.org/2257513002/diff/40001/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp File third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp (right): https://codereview.chromium.org/2257513002/diff/40001/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp#newcode93 third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp:93: std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(m_data, true /* allDataReceived */, On ...
4 years, 4 months ago (2016-08-22 01:51:16 UTC) #21
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/2257513002/60001
4 years, 3 months ago (2016-08-23 13:00:01 UTC) #25
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/243830)
4 years, 3 months ago (2016-08-23 13:06:15 UTC) #28
Peter Beverloo
notifications lgtm https://codereview.chromium.org/2257513002/diff/40001/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp File third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp (right): https://codereview.chromium.org/2257513002/diff/40001/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp#newcode93 third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp:93: std::unique_ptr<ImageDecoder> decoder = ImageDecoder::create(m_data, true /* allDataReceived ...
4 years, 3 months ago (2016-08-23 13:06:20 UTC) #30
f(malita)
On 2016/08/23 13:06:20, Peter Beverloo wrote: > notifications lgtm > > https://codereview.chromium.org/2257513002/diff/40001/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp > File third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp ...
4 years, 3 months ago (2016-08-23 13:37:18 UTC) #33
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/2257513002/80001
4 years, 3 months ago (2016-08-23 13:46:30 UTC) #37
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-08-23 14:47:35 UTC) #39
commit-bot: I haz the power
4 years, 3 months ago (2016-08-23 14:49:19 UTC) #41
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/9e2e0f5824975f43ad9374ea5e97100b77925fc1
Cr-Commit-Position: refs/heads/master@{#413736}

Powered by Google App Engine
This is Rietveld 408576698