Use DrawElements instead of DrawArrays in CompositorOGL::BindAndDrawQuad

RESOLVED INVALID

Status

()

RESOLVED INVALID
5 years ago
4 years ago

People

(Reporter: mstange, Assigned: mstange)

Tracking

(Blocks: 1 bug)

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
Created attachment 8356754 [details] [diff] [review]
CompositorOGL
Attachment #8356754 - Flags: review?(jgilbert)
(Assignee)

Comment 2

5 years ago
Created attachment 8356777 [details] [diff] [review]
the same for GLPresenter in nsChildView

This is only used when testing the basic compositor on Mac (which is never the default and probably not going to be), and we only draw at most 7 quads per frame in this mode (BasicCompositor window surface, titlebar overlay, resizer, 4 corner masks), so it's not going to matter performance-wise. I'm still attaching it here in case we want it at some point anyway.
Comment on attachment 8356754 [details] [diff] [review]
CompositorOGL

Review of attachment 8356754 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/opengl/CompositorOGL.cpp
@@ +528,5 @@
>  
> +  mGLContext->fGenBuffers(1, &mQuadElements);
> +  mGLContext->fBindBuffer(LOCAL_GL_ELEMENT_ARRAY_BUFFER, mQuadElements);
> +  unsigned char indices[] = { 0, 1, 2, 3 };
> +  mGLContext->fBufferData(LOCAL_GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, LOCAL_GL_STATIC_DRAW);

This shouldn't be any faster. DrawElements has additional overhead compared to DrawArrays, but is more efficient when you're reusing vertices, or need to change the drawing order.
Attachment #8356754 - Flags: review?(jgilbert) → review-
(Assignee)

Updated

5 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.