microui  14.4.1
microui
ui_display_brs.h
1 /*
2  * Copyright 2023-2025 MicroEJ Corp. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be found with this software.
4  */
5 
6 #ifndef UI_DISPLAY_BRS_H
7 #define UI_DISPLAY_BRS_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*
14  * @file
15  * @brief Provides some implementations of the LLUI_DISPLAY_impl.h functions relating
16  * to the display buffer strategy (BRS).
17  *
18  * A BRS
19  * - implements the LLUI_DISPLAY_impl.h's API LLUI_DISPLAY_IMPL_refresh() and
20  * LLUI_DISPLAY_IMPL_newDrawingRegion().
21  * - calls the LLUI_DISPLAY_impl.h's API LLUI_DISPLAY_IMPL_flush() to let the display
22  * driver transmit / copy / flush back buffer data to the front buffer or swap back and
23  * front buffer (double or triple buffer management).
24  * - ensures the coherence of the back buffer's content before and after a flush.
25  *
26  * Several BRS are available in ui_configuration.h (the implementation has
27  * to select one of them).
28  *
29  * @author MicroEJ Developer Team
30  * @version 14.4.1
31  */
32 
33 // -----------------------------------------------------------------------------
34 // Includes
35 // -----------------------------------------------------------------------------
36 
37 #include <LLUI_DISPLAY_impl.h>
38 
39 #include "ui_util.h"
40 #include "ui_configuration.h"
41 #include "ui_log.h"
42 
43 // --------------------------------------------------------------------------------
44 // Display BRS public API
45 // --------------------------------------------------------------------------------
46 
47 /*
48  * @brief Restores (copies) the given rectangular region from old back buffer to the graphics
49  * context's current buffer (the destination buffer can be retrieved thanks
50  * LLUI_DISPLAY_getBufferAddress(&gc->image)).
51  *
52  * When the copy is synchronous (immediate), the implementation has to return
53  * DRAWING_DONE. When the copy is asynchronous (performed by a DMA for instance), the
54  * the implementation has to return DRAWING_RUNNING. As the end of the asynchronous
55  * copy, the implementation has to call LLUI_DISPLAY_notifyAsynchronousDrawingEnd()
56  * to unlock the caller of this function.
57  *
58  * The implementation of this function is optional; a weak function provides a simple
59  * implementation using memcpy().
60  *
61  * @param[in] gc the MicroUI GraphicsContext that targets the current back buffer
62  * @param[in] old_back_buffer a MicroUI Image that symbolizes (targets) the old back buffer.
63  * @param[in] rect the rectangular region to copy from old back buffer to new back
64  * buffer.
65  */
66 DRAWING_Status UI_DISPLAY_BRS_restore(MICROUI_GraphicsContext *gc, MICROUI_Image *old_back_buffer, ui_rect_t *rect);
67 
68 // --------------------------------------------------------------------------------
69 // EOF
70 // --------------------------------------------------------------------------------
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif // UI_DISPLAY_BRS_H
MicroEJ MicroUI library low level API: enable some features according to the hardware capabilities.