2019-04-05 23:06:24 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* graphics/nxbe/nxbe_flush.c
|
|
|
|
*
|
2024-09-10 09:30:58 +02:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2019-04-05 23:06:24 +02:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2019-04-05 23:06:24 +02:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2019-04-05 23:06:24 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#include <nuttx/nx/nxglib.h>
|
|
|
|
#include <nuttx/nx/nxbe.h>
|
|
|
|
|
|
|
|
#include "nxbe.h"
|
|
|
|
|
|
|
|
#ifdef CONFIG_NX_RAMBACKED
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxbe_flush
|
|
|
|
*
|
|
|
|
* Description:
|
2020-02-23 09:50:23 +01:00
|
|
|
* After per-window framebuffer has been updated, the modified region must
|
2019-04-05 23:06:24 +02:00
|
|
|
* be written to device graphics memory. That function is managed by this
|
|
|
|
* simple function. It does the following:
|
|
|
|
*
|
2019-04-09 23:09:10 +02:00
|
|
|
* 1) It calls nxbe_bitmap_dev() to copy the modified per-window
|
|
|
|
* framebuffer into device graphics memory.
|
|
|
|
* 2) If CONFIG_NX_SWCURSOR is enabled, it calls the cursor "draw"
|
|
|
|
* renderer to update re-draw the currsor image if any portion of
|
|
|
|
* graphics display update overwrote the cursor. Since these
|
|
|
|
* operations are performed back-to-back, any resulting flicker
|
|
|
|
* should be minimized.
|
2019-04-05 23:06:24 +02:00
|
|
|
*
|
|
|
|
* Input Parameters (same as for nxbe_flush):
|
|
|
|
* wnd - The window that will receive the bitmap image
|
2019-04-13 23:08:32 +02:00
|
|
|
* dest - Describes the rectangular region in the window that will
|
|
|
|
* receive the the bit map (window coordinate frame).
|
2019-04-05 23:06:24 +02:00
|
|
|
* src - The start of the source image.
|
|
|
|
* origin - The origin of the upper, left-most corner of the full bitmap.
|
|
|
|
* Both dest and origin are in window coordinates, however, origin
|
|
|
|
* may lie outside of the display.
|
|
|
|
* stride - The width of the full source image in bytes.
|
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
void nxbe_flush(FAR struct nxbe_window_s *wnd,
|
|
|
|
FAR const struct nxgl_rect_s *dest,
|
|
|
|
FAR const void *src[CONFIG_NX_NPLANES],
|
|
|
|
FAR const struct nxgl_point_s *origin,
|
|
|
|
unsigned int stride)
|
|
|
|
{
|
2019-05-05 23:18:31 +02:00
|
|
|
/* Don't update hidden windows */
|
2019-04-05 23:06:24 +02:00
|
|
|
|
2019-05-05 23:18:31 +02:00
|
|
|
if (!NXBE_ISHIDDEN(wnd))
|
|
|
|
{
|
2020-02-23 09:50:23 +01:00
|
|
|
/* Copy the modified per-window framebuffer into device memory. */
|
2019-05-05 23:18:31 +02:00
|
|
|
|
|
|
|
nxbe_bitmap_dev(wnd, dest, src, origin, stride);
|
2019-04-05 23:06:24 +02:00
|
|
|
|
2019-04-09 23:09:10 +02:00
|
|
|
#ifdef CONFIG_NX_SWCURSOR
|
2019-05-05 23:18:31 +02:00
|
|
|
/* Update cursor backup memory and redraw the cursor in the modified
|
|
|
|
* window region.
|
|
|
|
*/
|
2019-04-05 23:06:24 +02:00
|
|
|
|
2019-05-05 23:18:31 +02:00
|
|
|
nxbe_cursor_backupdraw_all(wnd, dest);
|
2019-04-09 23:09:10 +02:00
|
|
|
#endif
|
2019-05-05 23:18:31 +02:00
|
|
|
}
|
2019-04-05 23:06:24 +02:00
|
|
|
}
|
|
|
|
|
2020-01-31 19:07:39 +01:00
|
|
|
#endif /* CONFIG_NX_RAMBACKED */
|