Please cache GetOpactiy() in ContainerLayerOGL::RenderLayer

RESOLVED FIXED

Status

()

Core
Graphics
--
trivial
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

({coverity})

Trunk
coverity
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
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());
(Assignee)

Updated

8 years ago
Blocks: 40115
(Assignee)

Updated

8 years ago
Blocks: 556584
No longer blocks: 40115
(Assignee)

Comment 1

8 years ago
Created attachment 444900 [details] [diff] [review]
proposal
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
(Assignee)

Comment 2

8 years ago
http://hg.mozilla.org/mozilla-central/rev/adf43a8697ee
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.