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

Issue 1866243003: Revert of Eliminate copies of encoded image data (Closed)

Created:
4 years, 8 months ago by scroggo_chromium
Modified:
4 years, 8 months ago
CC:
chromium-reviews, krit, pdr+graphicswatchlist_chromium.org, drott+blinkwatch_chromium.org, urvang, jzern, blink-reviews-platform-graphics_chromium.org, dshwang, skal, jbroman, Justin Novosad, vikasa, danakj, Rik, f(malita), piman+watch_chromium.org, blink-reviews, vmpstr+blinkwatch_chromium.org, kinuko+watch, Stephen Chennney, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revert of Eliminate copies of encoded image data (patchset #23 id:440001 of https://codereview.chromium.org/1812273003/ ) Reason for revert: Speculative fix for crbug.com/601416 Original issue's description: > Eliminate copies of encoded image data > > Remove the ThreadSafeDataTransport, which required making two copies of > the encoded data. Instead, copy the data (once) into an SkRWBuffer, > which allows creating read only snapshots that can be safely read in > another thread. > > Design doc can be found at https://docs.google.com/document/d/1aNmMaWfjkSSkdnVkAJoBUN7mNwdCXT1wLghrhDhhSUw/edit#heading=h.hvbfr8rfyj9k > Benchmark results can be found at https://docs.google.com/spreadsheets/d/1Y_9UbzBvyg1HRs2uieeV2Twb7seJFKZulRVg7OQOqEo/ > > DeferredImageDecoder: > Copy into an SkRWBuffer, and create snapshots to pass to each > DecodingImageGenerator. > > DecodingImageGenerator: > Store a snapshot of the data, along with whether the snapshot contains > all of the data. Pass this to the ImageFrameGenerator when it is time > to decode. Since it already knows whether it has received all the data, > never attempt to YUV decode if not. > When created from an SkData, skip the copy into a SharedBuffer. Instead, > wrap in a SegmentReader. > > ImageFrameGenerator: > Its decoding APIs now take the encoded data and whether it's complete as > parameters. Does not own the encoded data, and no longer has the > implementation of onRefEncodedData. > Make the object thread-safe where possible, so we can only lock the > mutex during operations that truly need it. > > SegmentReader: > Add a new interface that looks like a read only SharedBuffer. Add three > implementations: > - SharedBufferSegmentReader: > Used when we already have a SharedBuffer (e.g. in the main thread). > - ROBufferSegmentReader: > Facilitates decoding in a worker thread without requiring mutex locks/ > an extra copy of the data. > - DataSegmentReader: > Allows using an SkData directly without copying. > > ImageDecoders/FastSharedBufferReader: > Read data from a SegmentReader instead of directly from a SharedBuffer. > (Add an ImageDecoder helper that takes a SharedBuffer parameter, reducing > the need to change code that already has a SharedBuffer.) > Since the API is the same, the changes here are small, except for > WEBPImageDecoder, which no longer calls SharedBuffer::data(), and > instead calls SegmentReader::refAsSkData(). > Use PassRefPtr instead of raw pointers for parameter passing in setData. > > Tests: > Adapt where a SharedBuffer is no longer used. > > PictureSnapshot.cpp > Wrap SkData in SegmentReader. > > BUG=467772 > BUG=483369 > > BUG=335694 > This may also help with crrbug.com/335694. The DecodingImageGenerator > will no longer attempt to read beyond the data that had been received > when it was created. However, it theoretically could use a decoder that > had previously been used to decode more data than it was created with. > > e.g. > > DeferredImageDecoder did = ... > did.setData(...); > SkImage imageA = did.createFrameAtIndex(0); // DecodingImageGenerator > > did.setData(...); // More data > SkImage imageB = did.createFrameAtIndex(0); > > // draw imageB - this decodes to the end of data provided in the second > // call to setData > > // draw imageA - this can use the same ImageDecoder retrieved from the > // ImageDecodingStore, meaning it will have already > // decoded beyond the data supplied to imageA > > I do not know whether this can happen in practice. > > Committed: https://crrev.com/33cfb9bd4aec6d9ae36231057436c78b47de8585 > Cr-Commit-Position: refs/heads/master@{#385470} TBR=reed@google.com,noel@chromium.org,pkasting@chromium.org,fmalita@chromium.org,urvang@chromium.org,scroggo@google.com Skipping tries as they succeeded except for a test that failed without my patch. NO_TRY=true BUG=467772 Committed: https://crrev.com/20d3d134faf15c1b88ce55dff0b80b7a698e2753 Cr-Commit-Position: refs/heads/master@{#385902}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+576 lines, -593 lines) Patch
M third_party/WebKit/Source/platform/blink_platform.gypi View 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.h View 3 chunks +2 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DecodingImageGenerator.cpp View 6 chunks +13 lines, -18 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.h View 2 chunks +2 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/DeferredImageDecoder.cpp View 6 chunks +8 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageDecodingStoreTest.cpp View 3 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.h View 6 chunks +35 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageFrameGenerator.cpp View 11 chunks +113 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/ImageFrameGeneratorTest.cpp View 11 chunks +65 lines, -33 lines 0 comments Download
M third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp View 2 chunks +3 lines, -8 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.h View 1 chunk +78 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransport.cpp View 1 chunk +85 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/graphics/ThreadSafeDataTransportTest.cpp View 1 chunk +75 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/FastSharedBufferReader.h View 4 chunks +7 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/FastSharedBufferReader.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/FastSharedBufferReaderTest.cpp View 6 chunks +25 lines, -147 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h View 3 chunks +7 lines, -15 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp View 2 chunks +27 lines, -25 lines 0 comments Download
D third_party/WebKit/Source/platform/image-decoders/SegmentReader.h View 1 chunk +0 lines, -48 lines 0 comments Download
D third_party/WebKit/Source/platform/image-decoders/SegmentReader.cpp View 1 chunk +0 lines, -182 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageDecoder.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/bmp/BMPImageReader.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/gif/GIFImageDecoder.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/gif/GIFImageReader.h View 3 chunks +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/ico/ICOImageDecoder.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.h View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoder.cpp View 3 chunks +5 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/png/PNGImageDecoder.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.h View 3 chunks +1 line, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/image-decoders/webp/WEBPImageDecoder.cpp View 3 chunks +3 lines, -8 lines 0 comments Download

Messages

Total messages: 16 (7 generated)
scroggo_chromium
Created Revert of Eliminate copies of encoded image data
4 years, 8 months ago (2016-04-07 20:16:02 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1866243003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1866243003/1
4 years, 8 months ago (2016-04-07 20:16:55 UTC) #2
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
4 years, 8 months ago (2016-04-07 20:16:58 UTC) #4
urvang
lgtm
4 years, 8 months ago (2016-04-07 20:20:03 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1866243003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1866243003/1
4 years, 8 months ago (2016-04-07 20:21:29 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/193282)
4 years, 8 months ago (2016-04-07 21:30:45 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1866243003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1866243003/1
4 years, 8 months ago (2016-04-07 21:42:25 UTC) #12
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 8 months ago (2016-04-07 22:25:14 UTC) #14
commit-bot: I haz the power
4 years, 8 months ago (2016-04-07 22:26:26 UTC) #16
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/20d3d134faf15c1b88ce55dff0b80b7a698e2753
Cr-Commit-Position: refs/heads/master@{#385902}

Powered by Google App Engine
This is Rietveld 408576698