microui
14.2.0
microui
bsp
ui
inc
ui_display_brs.h
1
/*
2
* Copyright 2023-2024 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.2.0
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
// Macros and defines
45
// -----------------------------------------------------------------------------
46
47
/*
48
* @brief Logs a region (a rectangle)
49
*/
50
#define LOG_REGION(log, rect) LLTRACE_record_event_u32x4((LLUI_EVENT_group), (LLUI_EVENT_offset) + (log), (rect)->x1, \
51
(rect)->y1, (rect)->x2, (rect)->y2)
52
53
// --------------------------------------------------------------------------------
54
// Display BRS public API
55
// --------------------------------------------------------------------------------
56
57
/*
58
* @brief Restores (copies) the given rectangular region from old back buffer to the graphics
59
* context's current buffer (the destination buffer can be retrieved thanks
60
* LLUI_DISPLAY_getBufferAddress(&gc->image)).
61
*
62
* When the copy is synchronous (immediate), the implementation has to return
63
* DRAWING_DONE. When the copy is asynchronous (performed by a DMA for instance), the
64
* the implementation has to return DRAWING_RUNNING. As the end of the asynchronous
65
* copy, the implementation has to call LLUI_DISPLAY_notifyAsynchronousDrawingEnd()
66
* to unlock the caller of this function.
67
*
68
* The implementation of this function is optional; a weak function provides a simple
69
* implementation using memcpy().
70
*
71
* @param[in] gc the MicroUI GraphicsContext that targets the current back buffer
72
* @param[in] old_back_buffer a MicroUI Image that symbolizes (targets) the old back buffer.
73
* @param[in] rect the rectangular region to copy from old back buffer to new back
74
* buffer.
75
*/
76
DRAWING_Status UI_DISPLAY_BRS_restore(MICROUI_GraphicsContext *gc, MICROUI_Image *old_back_buffer, ui_rect_t *rect);
77
78
// --------------------------------------------------------------------------------
79
// EOF
80
// --------------------------------------------------------------------------------
81
82
#ifdef __cplusplus
83
}
84
#endif
85
86
#endif
// UI_DISPLAY_BRS_H
ui_configuration.h
MicroEJ MicroUI library low level API: enable some features according to the hardware capabilities.
Generated by
1.9.1