[Webkit-unassigned] [Bug 44926] Multiple accelerated 2D canvases should be able to use the same GraphicsContext3D

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 1 14:44:37 PDT 2010


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





--- Comment #19 from James Robinson <jamesr at chromium.org>  2010-09-01 14:44:36 PST ---
(In reply to comment #12)
> > WebCore/html/canvas/CanvasRenderingContext2D.cpp:1283
> >      sourceCanvas->makeRenderingResultsAvailable();
> Are you sure it isn't necessary to do something here?  Obviously, reading back to the buffer isn't right in this case, but we need some way to make sure that the sourceCanvas is up-to-date (e.g., last software draw is uploaded to framebuffer) before we draw.
> 
> And actually, I think this will break the software path, since it needs to make this call.  If the GPU truly doesn't need this, it should probably be doing an !isAccelerated() check instead.
> 
> (Reading on a bit further, it seems you're doing the GPU equivalent of this call in drawImageBuffer().  Fair enough, although it would be kind of cool to unify them in the same makeRenderingResultsAvailable() function.  And you'll still need to fix the software path).

I'll make this change separately to keep things simpler.

> > WebCore/platform/graphics/chromium/GLES2Canvas.cpp:261
> > +    return m_context->createTexture(ptr, format, width, height);
> OT:  Now that uploaded textures are shared between all contexts, I think we could actually get rid of the hash table entirely, and put a RefPtr<Texture> in the NativeImageSkia 
itself, if we wanted to.  This should help tie its lifetime to that of the image cache.

No can do - you can have an arbitrary number of compositors in a process each with its own SharedContext3D.  It's not just one per process, it's one per compositor.

> > WebCore/platform/graphics/skia/PlatformContextSkia.cpp:791
> > +        m_uploadTexture = context->createTexture(0, Texture::BGRA8, bitmap.width(), bitmap.height());
> Hmm.. hashing on the NULL ptr (besides making it "magic" and fragile, in case anyone else tries the same trick) will share a single upload texture for all canvases.  This means we might hang onto an 8K texture long after a big canvas is gone, and we only need to upload little 150x150 canvases, e.g.

A NULL pointer means "do not cache" - look at the changes in createTexture().  It is slightly magic but we need a way to create and upload textures without any caching at all and this seemed as good as any.

> > WebCore/platform/graphics/skia/PlatformContextSkia.h:184
> > +    void setSharedContext3D(SharedContext3D*, CanvasFramebuffer*, const IntSize&);
> I'd rather the CanvasFramebuffer be owned by the GLES2Canvas, if possible.  But we can talk about that later.

Maybe later :)

Everything else fixed in my soon to be posted patch.

-- 
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