Closed Bug 565337 Opened 10 years ago Closed 10 years ago

Please cache GetOpactiy() in ContainerLayerOGL::RenderLayer

Categories

(Core :: Graphics, defect, trivial)

defect
Not set
trivial

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity)

Attachments

(1 file)

Coverity can't trust GetOpacity() to return a constant value, as it's used three times in this function, it's better to cache it and make coverity happy than call the same function three times (unless it's actually dynamic, in which case coverity says you can use uninitialized data).

128 ContainerLayerOGL::RenderLayer(int aPreviousFrameBuffer)
133   GLuint containerSurface;

140   if (GetOpacity() != 1.0) {
182   } else {
183     frameBuffer = aPreviousFrameBuffer;
184   }

205   if (GetOpacity() != 1.0) {
235     gl()->fBindTexture(LOCAL_GL_TEXTURE_2D, containerSurface);

237     rgbProgram->SetLayerOpacity(GetOpacity());
Blocks: 40115
Blocks: 556584
No longer blocks: 40115
Attached patch proposalSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #444900 - Flags: review?(bas.schouten)
Attachment #444900 - Flags: review?(bas.schouten) → review+
Component: Canvas: WebGL → Graphics
QA Contact: canvas.webgl → thebes
http://hg.mozilla.org/mozilla-central/rev/adf43a8697ee
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.