WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 38236
getFramebufferAttachmentParameter should return the original WebGLTexture/WebGLRenderbuffer instead of creating new ones sharing names.
https://bugs.webkit.org/show_bug.cgi?id=38236
Summary
getFramebufferAttachmentParameter should return the original WebGLTexture/Web...
Zhenyao Mo
Reported
2010-04-27 17:31:16 PDT
Having multiple CanvasObject share the same resource name makes it very difficult to track the resources.
Attachments
patch
(17.06 KB, patch)
2010-04-29 09:53 PDT
,
Zhenyao Mo
no flags
Details
Formatted Diff
Diff
revised patch : responding to Darin Adler's review
(17.31 KB, patch)
2010-04-30 13:51 PDT
,
Zhenyao Mo
no flags
Details
Formatted Diff
Diff
revised patch: responding to Ken Russell's review
(17.28 KB, patch)
2010-05-04 10:13 PDT
,
Zhenyao Mo
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Zhenyao Mo
Comment 1
2010-04-29 09:53:05 PDT
Created
attachment 54716
[details]
patch
Darin Adler
Comment 2
2010-04-30 13:18:56 PDT
Comment on
attachment 54716
[details]
patch Generally speaking member functions should be as private as possible. If you already have a WebGLFramebuffer* it's a programming error to call isFramebuffer, so it's better to make the WebGLFramebuffer::isFramebuffer private even though the function it is overriding in the base class, CanvasObject::isFramebuffer, is public.
Zhenyao Mo
Comment 3
2010-04-30 13:51:03 PDT
Created
attachment 54825
[details]
revised patch : responding to Darin Adler's review
Kenneth Russell
Comment 4
2010-05-03 17:30:34 PDT
Comment on
attachment 54825
[details]
revised patch : responding to Darin Adler's review Looks good overall. It's good that you were able to reuse the m_canvasObjects table to reduce the risk of changing the memory management of the WebGLRenderingContext class. I think that we should reexamine the lifetime of the CanvasObjects / WebGLObjects, but that should wait for a subsequent bug. One comment: WebCore/html/canvas/WebGLRenderingContext.cpp:2844 + RefPtr<WebGLTexture> tex = reinterpret_cast<WebGLTexture*>((*it).get()); Can you try to write instead: return reinterpret_cast<RefPtr<WebGLTexture> >(*it).release(); Perhaps you've already tried this and it doesn't work. WebCore/html/canvas/WebGLRenderingContext.cpp:2856 + RefPtr<WebGLRenderbuffer> buffer = reinterpret_cast<WebGLRenderbuffer*>((*it).get()); If the above suggestion works, please use it here too.
Zhenyao Mo
Comment 5
2010-05-04 09:21:02 PDT
(In reply to
comment #4
)
> (From update of
attachment 54825
[details]
) > Looks good overall. It's good that you were able to reuse the m_canvasObjects > table to reduce the risk of changing the memory management of the > WebGLRenderingContext class. I think that we should reexamine the lifetime of > the CanvasObjects / WebGLObjects, but that should wait for a subsequent bug. > > One comment: > WebCore/html/canvas/WebGLRenderingContext.cpp:2844 > + RefPtr<WebGLTexture> tex = > reinterpret_cast<WebGLTexture*>((*it).get()); > Can you try to write instead: > > return reinterpret_cast<RefPtr<WebGLTexture> >(*it).release(); >
I tried. The cast is invalid.
> Perhaps you've already tried this and it doesn't work. > > > WebCore/html/canvas/WebGLRenderingContext.cpp:2856 > + RefPtr<WebGLRenderbuffer> buffer = > reinterpret_cast<WebGLRenderbuffer*>((*it).get()); > If the above suggestion works, please use it here too.
Kenneth Russell
Comment 6
2010-05-04 09:40:31 PDT
(In reply to
comment #5
)
> (In reply to
comment #4
) > > (From update of
attachment 54825
[details]
[details]) > > Looks good overall. It's good that you were able to reuse the m_canvasObjects > > table to reduce the risk of changing the memory management of the > > WebGLRenderingContext class. I think that we should reexamine the lifetime of > > the CanvasObjects / WebGLObjects, but that should wait for a subsequent bug. > > > > One comment: > > WebCore/html/canvas/WebGLRenderingContext.cpp:2844 > > + RefPtr<WebGLTexture> tex = > > reinterpret_cast<WebGLTexture*>((*it).get()); > > Can you try to write instead: > > > > return reinterpret_cast<RefPtr<WebGLTexture> >(*it).release(); > > > > I tried. The cast is invalid.
OK. You can still write "return tex.release();" instead of explicitly constructing the PassRefPtr out of the RefPtr. In fact I think you should do this to reduce churn on the reference counts.
> > > Perhaps you've already tried this and it doesn't work. > > > > > > WebCore/html/canvas/WebGLRenderingContext.cpp:2856 > > + RefPtr<WebGLRenderbuffer> buffer = > > reinterpret_cast<WebGLRenderbuffer*>((*it).get()); > > If the above suggestion works, please use it here too.
Zhenyao Mo
Comment 7
2010-05-04 10:13:05 PDT
Created
attachment 55025
[details]
revised patch: responding to Ken Russell's review
Kenneth Russell
Comment 8
2010-05-04 10:34:53 PDT
Comment on
attachment 55025
[details]
revised patch: responding to Ken Russell's review Looks good. Thanks for cleaning this up.
Dimitri Glazkov (Google)
Comment 9
2010-05-04 11:38:27 PDT
Comment on
attachment 55025
[details]
revised patch: responding to Ken Russell's review ok.
WebKit Commit Bot
Comment 10
2010-05-04 17:30:44 PDT
Comment on
attachment 55025
[details]
revised patch: responding to Ken Russell's review Clearing flags on attachment: 55025 Committed
r58790
: <
http://trac.webkit.org/changeset/58790
>
WebKit Commit Bot
Comment 11
2010-05-04 17:30:50 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug