Bug 103797 - [chromium] Minimize memcpy for encoded image data in ImageFrameGenerator
Summary: [chromium] Minimize memcpy for encoded image data in ImageFrameGenerator
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Hin-Chung Lam
URL:
Keywords:
Depends on:
Blocks: 99790
  Show dependency treegraph
 
Reported: 2012-11-30 18:18 PST by Hin-Chung Lam
Modified: 2012-12-12 13:30 PST (History)
9 users (show)

See Also:


Attachments
Patch (22.94 KB, patch)
2012-12-07 20:53 PST, Hin-Chung Lam
no flags Details | Formatted Diff | Diff
Patch for landing (22.94 KB, patch)
2012-12-12 11:36 PST, Hin-Chung Lam
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hin-Chung Lam 2012-11-30 18:18:28 PST
The logic in ImageFrameGenerator regarding encoded image data is as follows:

1. When new data is received on the main thread, DeferredImageDecoder sets new data to ImageFrameGenerator.
2. ImageFrameGenerator makes a new copy of the data and keeps the reference.
3. When there is an image decoding request from LazyDecodingPixelRef, ImageFrameGenerator makes another copy of the data and take it for image decoding.

The entire process has too many unnecessary memcpys, it should be cleaned up.
Comment 1 Hin-Chung Lam 2012-12-07 20:53:31 PST
Created attachment 178331 [details]
Patch
Comment 2 Hin-Chung Lam 2012-12-11 17:09:34 PST
senorblanco, jamesr: Comments? This is the last big-ish change that is required for deferred image decoding. After this it will on par with existing main thread decoding stack.
Comment 3 Stephen White 2012-12-12 04:38:14 PST
Comment on attachment 178331 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=178331&action=review

Looks good.  r=me

> Source/WebCore/platform/graphics/chromium/ThreadSafeDataTransport.h:39
> +// The purpose of this class is to allow transferring data stored in

Grammar nit:  "transferring" -> "the transfer of"

> Source/WebCore/platform/graphics/chromium/ThreadSafeDataTransport.h:41
> +// SharedBuffer in a thread-safe manner. At the same time minimizing
> +// memory copy and thread contention.

Grammar nit:  this is not a sentence.  I'd just join it to the previous one:  ".. thread-safe manner, and to minimize memory copies and thread contention."
Comment 4 Hin-Chung Lam 2012-12-12 11:36:41 PST
Created attachment 179090 [details]
Patch for landing
Comment 5 WebKit Review Bot 2012-12-12 13:30:27 PST
Comment on attachment 179090 [details]
Patch for landing

Clearing flags on attachment: 179090

Committed r137508: <http://trac.webkit.org/changeset/137508>
Comment 6 WebKit Review Bot 2012-12-12 13:30:30 PST
All reviewed patches have been landed.  Closing bug.