diff --git a/configs/open1788/pwfb/defconfig b/configs/open1788/pwfb/defconfig index 709581c27e8..2c486a48509 100644 --- a/configs/open1788/pwfb/defconfig +++ b/configs/open1788/pwfb/defconfig @@ -8,6 +8,7 @@ # CONFIG_EXAMPLES_PWFB_DEFAULT_COLORS is not set # CONFIG_EXAMPLES_PWFB_DEFAULT_FONT is not set # CONFIG_NXFONTS_DISABLE_16BPP is not set +# CONFIG_NXTK_DEFAULT_BORDERCOLORS is not set # CONFIG_NX_DISABLE_16BPP is not set CONFIG_ARCH="arm" CONFIG_ARCH_BOARD="open1788" @@ -26,7 +27,7 @@ CONFIG_EXAMPLES_PWFB_COLOR2=0xdefb CONFIG_EXAMPLES_PWFB_COLOR3=0xff76 CONFIG_EXAMPLES_PWFB_FONTCOLOR=0x0000 CONFIG_EXAMPLES_PWFB_FONTID=1 -CONFIG_EXPERIMENTAL=y +CONFIG_EXAMPLES_PWFB_TBCOLOR=0xad55 CONFIG_INTELHEX_BINARY=y CONFIG_LPC17_EXTDRAM=y CONFIG_LPC17_EXTDRAMHEAP_OFFSET=393216 @@ -47,6 +48,9 @@ CONFIG_NSH_LIBRARY=y CONFIG_NSH_READLINE=y CONFIG_NX=y CONFIG_NXFONT_SANS23X27=y +CONFIG_NXTK_BORDERCOLOR1=0xad55 +CONFIG_NXTK_BORDERCOLOR2=0x6b4d +CONFIG_NXTK_BORDERCOLOR3=0xdedb CONFIG_NX_BLOCKING=y CONFIG_PREALLOC_TIMERS=4 CONFIG_PREALLOC_WDOGS=4 diff --git a/graphics/Kconfig b/graphics/Kconfig index aea842c9435..b07322f46f3 100644 --- a/graphics/Kconfig +++ b/graphics/Kconfig @@ -45,7 +45,6 @@ config NX_NPLANES config NX_RAMBACKED bool "RAM backed windows" default n - depends on EXPERIMENTAL ---help--- If this option is selected, then windows may be optionally created with a RAM frambuffer backing up the window content. Rending into diff --git a/libs/libnx/nxtk/nxtk_closetoolbar.c b/libs/libnx/nxtk/nxtk_closetoolbar.c index 248d6eb9724..67f333b7746 100644 --- a/libs/libnx/nxtk/nxtk_closetoolbar.c +++ b/libs/libnx/nxtk/nxtk_closetoolbar.c @@ -68,7 +68,8 @@ int nxtk_closetoolbar(NXTKWINDOW hfwnd) { - FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd; + FAR struct nxtk_framedwindow_s *fwnd = + (FAR struct nxtk_framedwindow_s *)hfwnd; /* Un-initialize the toolbar info */ @@ -80,10 +81,25 @@ int nxtk_closetoolbar(NXTKWINDOW hfwnd) nxtk_setsubwindows(fwnd); - /* Then redraw the entire window, even the client window must be - * redrawn because it has changed its vertical position and size. +#ifdef CONFIG_NX_RAMBACKED + /* The redraw request has no effect if a framebuffer is used with the + * window. For that type of window, the application must perform the + * window update itself and not rely on a redraw notification. */ - nx_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds); + if (NXBE_ISRAMBACKED(&fwnd->wnd)) + { + (void)nxtk_drawframe(fwnd, &fwnd->wnd.bounds); /* Does not fail */ + } + else +#endif + { + /* Redraw the entire window, even the client window must be redrawn + * because it has changed its vertical position and size. + */ + + nx_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds); + } + return OK; } diff --git a/libs/libnx/nxtk/nxtk_events.c b/libs/libnx/nxtk/nxtk_events.c index a5461d195d8..6f0d800d41b 100644 --- a/libs/libnx/nxtk/nxtk_events.c +++ b/libs/libnx/nxtk/nxtk_events.c @@ -97,7 +97,7 @@ static void nxtk_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, FAR struct nxtk_framedwindow_s *fwnd; struct nxgl_rect_s intersection; - DEBUGASSERT(hwnd != NULL && rect != NULL && fwnd->fwcb != NULL); + DEBUGASSERT(hwnd != NULL && rect != NULL); fwnd = (FAR struct nxtk_framedwindow_s *)hwnd; ginfo("hwnd=%p rect={(%d,%d),(%d,%d)} more=%d\n", @@ -109,6 +109,7 @@ static void nxtk_redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, * forward the redraw callback. */ + DEBUGASSERT(fwnd->fwcb != NULL); if (fwnd->fwcb->redraw) { /* Clip the redraw rectangle so that it lies within the client sub-window diff --git a/libs/libnx/nxtk/nxtk_opentoolbar.c b/libs/libnx/nxtk/nxtk_opentoolbar.c index 68dcde1f91b..5bfc48bbd85 100644 --- a/libs/libnx/nxtk/nxtk_opentoolbar.c +++ b/libs/libnx/nxtk/nxtk_opentoolbar.c @@ -74,10 +74,11 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height, FAR const struct nx_callback_s *cb, FAR void *arg) { - FAR struct nxtk_framedwindow_s *fwnd = (FAR struct nxtk_framedwindow_s *)hfwnd; + FAR struct nxtk_framedwindow_s *fwnd = + (FAR struct nxtk_framedwindow_s *)hfwnd; #ifdef CONFIG_DEBUG_FEATURES - if (!hfwnd || !cb) + if (hfwnd == NULL || cb == NULL) { set_errno(EINVAL); return ERROR; @@ -94,11 +95,25 @@ int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height, nxtk_setsubwindows(fwnd); - /* Then redraw the entire window, even the client window must be - * redrawn because it has changed its vertical position and size. +#ifdef CONFIG_NX_RAMBACKED + /* The redraw request has no effect if a framebuffer is used with the + * window. For that type of window, the application must perform the + * toolbar update itself and not rely on a redraw notification. */ - nx_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds); + if (NXBE_ISRAMBACKED(&fwnd->wnd)) + { + (void)nxtk_drawframe(fwnd, &fwnd->wnd.bounds); /* Does not fail */ + } + else +#endif + { + /* Redraw the entire window, even the client window must be redrawn + * because it has changed its vertical position and size. + */ + + nx_redrawreq(&fwnd->wnd, &fwnd->wnd.bounds); + } return OK; }