public class DefaultRenderPolicy extends RenderPolicy
When a widget is asked to be rendered:
When one widget is asked to be rendered, a flush is requested to the display. When several widgets are asked to be rendered in a row, only one flush is done at the end.
Widget.isTransparent()
,
Display.requestFlush()
Constructor and Description |
---|
DefaultRenderPolicy(Desktop desktop)
Creates a default render policy.
|
Modifier and Type | Method and Description |
---|---|
void |
renderDesktop()
Renders the desktop on the display.
|
protected void |
renderWidget(Widget widget,
int x,
int y,
int width,
int height)
This method performs the increment render of the widget.
|
void |
requestRender(Widget widget,
int x,
int y,
int width,
int height)
Requests a rendering of the given widget on the display.
|
getDesktop
public DefaultRenderPolicy(Desktop desktop)
desktop
- the desktop.public void renderDesktop()
This method should be called in the MicroUI thread as the rendering of the widget is performed synchronously.
The graphics context is translated to the position of the parent of the widget. The clipping area is set to the intersection of the parent's bounds and the given bounds.
renderDesktop
in class RenderPolicy
protected void renderWidget(Widget widget, int x, int y, int width, int height)
The given bounds are relative to the widget.
widget
- the widget to render.x
- the x coordinate of the area to render.y
- the y coordinate of the area to render.width
- the width of the area to render.height
- the height of the area to render.public void requestRender(Widget widget, int x, int y, int width, int height)
RenderPolicy
This method returns immediately and the rendering of the widget is performed asynchronously in the MicroUI thread.
The given bounds are relative to the widget.
requestRender
in class RenderPolicy
widget
- the widget to render.x
- the x coordinate of the area to render.y
- the y coordinate of the area to render.width
- the width of the area to render.height
- the height of the area to render.