2008-11-27 23:56:45 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* graphics/nxbe/nxbe_redraw.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
|
2008-11-27 23:56:45 +01:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2008-11-27 23:56:45 +01: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.
|
2008-11-27 23:56:45 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <errno.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
2011-07-24 22:49:01 +02:00
|
|
|
#include <nuttx/nx/nxglib.h>
|
2008-11-28 15:45:15 +01:00
|
|
|
|
2008-11-27 23:56:45 +01:00
|
|
|
#include "nxbe.h"
|
2019-03-13 16:16:30 +01:00
|
|
|
#include "nxmu.h"
|
2008-11-27 23:56:45 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
struct nxbe_redraw_s
|
|
|
|
{
|
|
|
|
struct nxbe_clipops_s cops;
|
|
|
|
FAR struct nxbe_window_s *wnd;
|
|
|
|
};
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxbe_clipredraw
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void nxbe_clipredraw(FAR struct nxbe_clipops_s *cops,
|
2019-04-13 18:13:00 +02:00
|
|
|
FAR struct nxbe_plane_s *plane,
|
|
|
|
FAR const struct nxgl_rect_s *rect)
|
2008-11-27 23:56:45 +01:00
|
|
|
{
|
|
|
|
FAR struct nxbe_window_s *wnd = ((struct nxbe_redraw_s *)cops)->wnd;
|
|
|
|
if (wnd)
|
|
|
|
{
|
2019-05-16 17:18:33 +02:00
|
|
|
nxmu_redraw(wnd, rect);
|
2008-11-27 23:56:45 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxbe_redraw
|
|
|
|
*
|
2018-02-01 19:03:55 +01:00
|
|
|
* Description:
|
2008-11-27 23:56:45 +01:00
|
|
|
* Re-draw the visible portions of the rectangular region for the
|
|
|
|
* specified window
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
void nxbe_redraw(FAR struct nxbe_state_s *be,
|
|
|
|
FAR struct nxbe_window_s *wnd,
|
|
|
|
FAR const struct nxgl_rect_s *rect)
|
|
|
|
{
|
|
|
|
struct nxbe_redraw_s info;
|
|
|
|
struct nxgl_rect_s remaining;
|
|
|
|
#if CONFIG_NX_NPLANES > 1
|
|
|
|
int i;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Clip to the limits of the window and of the background screen */
|
|
|
|
|
|
|
|
nxgl_rectintersect(&remaining, rect, &be->bkgd.bounds);
|
|
|
|
nxgl_rectintersect(&remaining, &remaining, &wnd->bounds);
|
|
|
|
if (!nxgl_nullrect(&remaining))
|
|
|
|
{
|
|
|
|
/* Now, request to re-draw any visible rectangular regions not obscured
|
|
|
|
* by windows above this one.
|
|
|
|
*/
|
|
|
|
|
|
|
|
info.cops.visible = nxbe_clipredraw;
|
|
|
|
info.cops.obscured = nxbe_clipnull;
|
|
|
|
info.wnd = wnd;
|
|
|
|
|
|
|
|
#if CONFIG_NX_NPLANES > 1
|
|
|
|
for (i = 0; i < be->vinfo.nplanes; i++)
|
|
|
|
{
|
|
|
|
nxbe_clipper(wnd->above, &remaining, NX_CLIPORDER_DEFAULT,
|
|
|
|
&info.cops, &be->plane[i]);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
nxbe_clipper(wnd->above, &remaining, NX_CLIPORDER_DEFAULT,
|
|
|
|
&info.cops, &be->plane[0]);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|