Bug 49089 - WebGL renderbuffers can still be uninitialized: need to set the viewport explicitly
Summary: WebGL renderbuffers can still be uninitialized: need to set the viewport expl...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-05 13:25 PDT by Benoit Jacob
Modified: 2010-11-15 10:52 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benoit Jacob 2010-11-05 13:25:29 PDT
This is a variant of bug 48351.

I believe that WebGLFramebuffer::initializeRenderbuffers() needs to set the viewport to (0,0,w,h) where w and h are the width and height of the framebuffer. Otherwise, if the user had set a tiny viewport, the glClear call here fails to initialize the renderbuffer, allowing video memory readback as in bug 48351.

We just fixed this in Mozilla:
http://hg.mozilla.org/mozilla-central/file/3769e11d18d6/content/canvas/src/WebGLContext.h#l1533
Comment 1 Benoit Jacob 2010-11-05 13:26:57 PDT
Not writing a patch, because I don't know how WebKit's WebGLFramebuffer objects can get their own dimensions.
Comment 2 Kenneth Russell 2010-11-05 15:51:16 PDT
I don't think so. The viewport doesn't affect glClear. The scissor rect does, however.
Comment 3 Zhenyao Mo 2010-11-05 15:55:52 PDT
I did disable scissor before and reset it back to original state after.

See WebGLFramebuffer.cpp

Should we close this bug?
Comment 4 Benoit Jacob 2010-11-15 10:52:30 PST
Indeed, sorry for the invalid report, thanks for the explanation.