Bug 32763 - [Chromium] Eliminate redundant data copy in GraphicsContext3D readback
: [Chromium] Eliminate redundant data copy in GraphicsContext3D readback
Product: WebKit
Classification: Unclassified
Component: WebGL
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To: Kenneth Russell
Depends on:
  Show dependency treegraph
Reported: 2009-12-18 18:56 PST by Kenneth Russell
Modified: 2009-12-18 23:13 PST (History)
7 users (show)

See Also:

Patch (5.57 KB, patch)
2009-12-18 19:09 PST, Kenneth Russell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2009-12-18 18:56:37 PST
Because of my inexperience with the Core Graphics APIs, there is a redundant data copy occurring in GraphicsContext3D while reading back the framebuffer in order to draw it to the Canvas's backing store via CGContextDrawImage. Fixing this will partly address the embarrassing performance gap reported in http://news.cnet.com/8301-30685_3-10416966-264.html?tag=mncol .
Comment 1 Kenneth Russell 2009-12-18 19:09:30 PST
Created attachment 45219 [details]

Eliminated useless creation of a CGBitmapContext and from there a CGImage. Now create CGImage directly from data. Also changed readPixels parameters and CGImage alpha info to try to avoid byte swapping, and disabled interpolation when drawing the GL content. Some test cases run twice as fast with these changes, though more work is needed to achieve desired performance.

No test case; performance optimization only. Ran WebGL demos from Khronos site to verify changes.
Comment 2 WebKit Review Bot 2009-12-18 19:13:03 PST
style-queue ran check-webkit-style on attachment 45219 [details] without any errors.
Comment 3 WebKit Commit Bot 2009-12-18 23:12:54 PST
Comment on attachment 45219 [details]

Clearing flags on attachment: 45219

Committed r52380: <http://trac.webkit.org/changeset/52380>
Comment 4 WebKit Commit Bot 2009-12-18 23:13:00 PST
All reviewed patches have been landed.  Closing bug.