Bug 32763

Summary: [Chromium] Eliminate redundant data copy in GraphicsContext3D readback
Product: WebKit Reporter: Kenneth Russell <kbr>
Component: WebGLAssignee: Kenneth Russell <kbr>
Severity: Normal CC: brettw, commit-queue, dglazkov, fishd, petersont, rlp, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Patch none

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.