Closed Bug 956268 Opened 10 years ago Closed 10 years ago

Use DrawElements instead of DrawArrays in CompositorOGL::BindAndDrawQuad

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(2 files)

      No description provided.
Attached patch CompositorOGLSplinter Review
Attachment #8356754 - Flags: review?(jgilbert)
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-
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: