Mir
Public Member Functions | Protected Member Functions | List of all members
mir::graphics::DisplayBuffer Class Referenceabstract

Interface to an output framebuffer. More...

#include <display_buffer.h>

Inheritance diagram for mir::graphics::DisplayBuffer:
[legend]

Public Member Functions

virtual ~DisplayBuffer ()
 
virtual geometry::Rectangle view_area () const =0
 The area the DisplayBuffer occupies in the virtual screen space. More...
 
virtual void make_current ()=0
 Makes the DisplayBuffer the current GL rendering target. More...
 
virtual void release_current ()=0
 Releases the current GL rendering target. More...
 
virtual void gl_swap_buffers ()=0
 Swap buffers for OpenGL rendering. More...
 
virtual void flip ()=0
 After gl_swap_buffers, flip the new front buffer to the screen This most likely involves a wait for vblank so can be very time consuming. More...
 
 __attribute__ ((__deprecated__("Use gl_swap_buffers() and flip(), remembering to release all compositor buffers in the middle."))) void post_update()
 
virtual bool post_renderables_if_optimizable (RenderableList const &renderlist)=0
 This will render renderlist to the screen and post the result to the screen if there is a hardware optimization that can be done. More...
 
virtual MirOrientation orientation () const =0
 Returns the orientation of the display buffer relative to how the user should see it (the orientation of the output). More...
 
virtual bool uses_alpha () const =0
 Returns true if the display buffer has an alpha channel and the alpha channel will be read from at some point - in which case the renderer must produce valid alpha channel content. More...
 

Protected Member Functions

 DisplayBuffer ()=default
 
 DisplayBuffer (DisplayBuffer const &c)=delete
 
DisplayBufferoperator= (DisplayBuffer const &c)=delete
 

Detailed Description

Interface to an output framebuffer.

Examples:
render_surfaces.cpp, and server_example_window_manager.cpp.

Constructor & Destructor Documentation

virtual mir::graphics::DisplayBuffer::~DisplayBuffer ( )
inlinevirtual
mir::graphics::DisplayBuffer::DisplayBuffer ( )
protecteddefault
mir::graphics::DisplayBuffer::DisplayBuffer ( DisplayBuffer const &  c)
protecteddelete

Member Function Documentation

mir::graphics::DisplayBuffer::__attribute__ ( (__deprecated__("Use gl_swap_buffers() and flip(), remembering to release all compositor buffers in the middle."))  )
inline
Deprecated:
Please try to implement separate gl_swap_buffers and flip functions instead. If not possible, just move your old post_update() logic into gl_swap_buffers.
virtual void mir::graphics::DisplayBuffer::flip ( )
pure virtual

After gl_swap_buffers, flip the new front buffer to the screen This most likely involves a wait for vblank so can be very time consuming.

This function is separate to gl_swap_buffers() because in real display systems the act of scanning out (or flipping) the front buffer is a very separate step to the GL buffer swapping. Not least because "flipping" is a hardware operation that is independent of the graphics library (OpenGL or other). Also, flip() can be a dramatically slower operation than gl_swap_buffers() and it would be an unacceptable performance hit to wait for both before freeing GL resources.

Implemented in mir::graphics::offscreen::DisplayBuffer, mir::compositor::ScreencastDisplayBuffer, mir::graphics::android::DisplayBuffer, mir::graphics::mesa::DisplayBuffer, and mir::graphics::nested::detail::NestedOutput.

virtual void mir::graphics::DisplayBuffer::gl_swap_buffers ( )
pure virtual

Swap buffers for OpenGL rendering.

After this method returns is the earliest time that it is safe to free GL-related resources such as textures and buffers.

Implemented in mir::graphics::offscreen::DisplayBuffer, mir::compositor::ScreencastDisplayBuffer, mir::graphics::android::DisplayBuffer, mir::graphics::mesa::DisplayBuffer, and mir::graphics::nested::detail::NestedOutput.

virtual void mir::graphics::DisplayBuffer::make_current ( )
pure virtual
DisplayBuffer& mir::graphics::DisplayBuffer::operator= ( DisplayBuffer const &  c)
protecteddelete
virtual MirOrientation mir::graphics::DisplayBuffer::orientation ( ) const
pure virtual

Returns the orientation of the display buffer relative to how the user should see it (the orientation of the output).

This tells us how much (if any) rotation the renderer needs to do. If your DisplayBuffer can do the rotation itself then this will always return mir_orientation_normal. If the DisplayBuffer does not implement the rotation itself then this function will return the amount of rotation the renderer must do to make things "look right".

Implemented in mir::graphics::offscreen::DisplayBuffer, mir::compositor::ScreencastDisplayBuffer, mir::graphics::android::DisplayBuffer, mir::graphics::mesa::DisplayBuffer, and mir::graphics::nested::detail::NestedOutput.

virtual bool mir::graphics::DisplayBuffer::post_renderables_if_optimizable ( RenderableList const &  renderlist)
pure virtual

This will render renderlist to the screen and post the result to the screen if there is a hardware optimization that can be done.

Parameters
[in]renderlistThe renderables that should appear on the screen if the hardware is capable of optmizing that list somehow. If what you want displayed on the screen cannot be represented by a RenderableList, then you should draw using OpenGL and use post_update()
Returns
true if the hardware can optimize the rendering of the list. When this call completes, the renderlist will have been posted to the screen. false if the hardware platform cannot optimize the list. The screen will not be updated. The caller should render the list another way, and post using post_update()

Implemented in mir::graphics::offscreen::DisplayBuffer, mir::graphics::android::DisplayBuffer, mir::graphics::mesa::DisplayBuffer, mir::compositor::ScreencastDisplayBuffer, and mir::graphics::nested::detail::NestedOutput.

virtual void mir::graphics::DisplayBuffer::release_current ( )
pure virtual
virtual bool mir::graphics::DisplayBuffer::uses_alpha ( ) const
pure virtual

Returns true if the display buffer has an alpha channel and the alpha channel will be read from at some point - in which case the renderer must produce valid alpha channel content.

Implemented in mir::graphics::offscreen::DisplayBuffer, mir::compositor::ScreencastDisplayBuffer, mir::graphics::mesa::DisplayBuffer, mir::graphics::android::DisplayBuffer, and mir::graphics::nested::detail::NestedOutput.

virtual geometry::Rectangle mir::graphics::DisplayBuffer::view_area ( ) const
pure virtual

The documentation for this class was generated from the following file:

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Mar 24 16:15:19 UTC 2015