[Webkit-unassigned] [Bug 102161] WebGL: Avoid unnecessary memory copy or conversion in texImage2D and texSubImage2D for HTMLVideoElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 15 15:23:42 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=102161





--- Comment #6 from Kenneth Russell <kbr at google.com>  2012-11-15 15:25:32 PST ---
(In reply to comment #5)
> Kenneth,your comments and concern are quite reasonable. It is error prone to access the pixels outside the scope of the SkAutoLockPixels. And there is another way to solve this issue besides adding a new class GraphicsContext3D::ImageLocker as you had suggested. 
> We can add a new function to ImageBuffer class. In this function, for skia port, SkAutoLockPixels would be called and would call through to glTexImage2D if no conversion is needed. If conversion is needed, it will return false and follow the traditional path. It is much like what had been done to texImage2D in WebGL for HTMLCanvasElement by introducing ImageBuffer::copyToPlatformTexture().

That's possible but I would prefer to introduce an ImageLocker class for two reasons. First, putting more GraphicsContext3D-related calls into the ImageBuffer implementation more tightly binds together conceptually unrelated areas of the code.

Second, and possibly more importantly, the pixel packing and unpacking code in GraphicsContext3D has been improved by Mozilla Corporation, and it's desired to merge back their changes. However, the code structure is different, and relies on being able to get a stable pointer to the source data. Having a port-independent ImageLocker class would enable this as well.

Overall, it would be a really nice contribution if you'd restructure this patch to add and use an ImageLocker abstraction that worked for all ports (or do that in a separate bug and then build this one on it).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list