Closed
Bug 942507
Opened 11 years ago
Closed 11 years ago
GLContext doesn't need to have userdata
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla28
People
(Reporter: bjacob, Assigned: u480271)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file, 1 obsolete file)
4.60 KB,
patch
|
u480271
:
review+
|
Details | Diff | Splinter Review |
This part of GLContext.h:
void *GetUserData(void *aKey) {
void *result = nullptr;
mUserData.Get(aKey, &result);
return result;
}
void SetUserData(void *aKey, void *aValue) {
mUserData.Put(aKey, aValue);
}
It currently seems to be used in only one place deep inside gfx/layers.
SetUserData/GetUserData was used in one place; in debug builds of
OGLShaderProgram for tracking the current program. But this relied on someone
not doing:
aShaderProgram->Activate();
...
aGL->fUseProgram(...);
...
aShaderProgram->SetUniform(...);
Since this is only used in debug, I removed user data from GLContext and
replaced the usage in OGLShaderProgram with a call to
aGL->GetUIntegerv(LOCAL_GL_CURRENT_PROGRAM) and compare the result to mProgram.
This is more accurate but potentially slower but since this is only in debug
build, which is already slow, I didn't think it would be an issue.
Attachment #8342829 -
Flags: review?(bjacob)
Reporter | ||
Comment 3•11 years ago
|
||
Comment on attachment 8342829 [details] [diff] [review]
GLContext doesn't need to have userdata.
Review of attachment 8342829 [details] [diff] [review]:
-----------------------------------------------------------------
r=me, but it looks like this is leaving behind sCurrentProgramKey which is now unused, and thus should be removed, right?
Attachment #8342829 -
Flags: review?(bjacob) → review+
Removed unused sCurrentProgramKey.
Carry r+=bjacob
Attachment #8342829 -
Attachment is obsolete: true
Attachment #8343389 -
Flags: review+
Keywords: checkin-needed
Comment 6•11 years ago
|
||
Keywords: checkin-needed
Comment 7•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Updated•11 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•