XenevaOS
Loading...
Searching...
No Matches
Macros | Functions
compose.cpp File Reference
#include "compose.h"
#include "_fastcpy.h"
#include "backdirty.h"
#include <color.h>
#include <string.h>
Include dependency graph for compose.cpp:

Macros

#define WIN_MAX_DAMAGE   256
 

Functions

Window * _get_always_on_top ()
 
bool is_window_fully_overlapped (WinSharedInfo *curInfo, Window *alwaysOnTop)
 
void _compose_dirty_area_ (ChCanvas *canvas, Window *win, Window *focusedWin, WinSharedInfo *info)
 Check for small area updates !! not entire window.
 
void compose_window_zoomed (ChCanvas *canvas, Window *win, WinSharedInfo *info)
 compose_window_zoomed – stretched-fill upscale of a window buffer into the compose canvas (the back surface the GPU flush presents from), honoring WinSharedInfo->zoomed. Fullscreen dirty is published by the caller so transfer moves the whole frame. The whole buffer (titlebar chrome included) stretches: the bar stays visible and its buttons stay clickable via remapped input. Nearest-neighbor. Fixed-point stepping (no float), 4-wide opaque fast path; only translucent pixels pay for a blend call.
 
void compose_window_scaled_to (ChCanvas *canvas, Window *win, int src_w, int src_h, int dst_x, int dst_y, int dw, int dh)
 compose_window_scaled_to – scales the window's own buffer (src_w x src_h) to (dw x dh) and alpha-blends it onto the canvas at (dst_x, dst_y). Clipped to the canvas, NEON fast path kept.
 
void compose_window_scaled_to_clip (ChCanvas *canvas, Window *win, int src_w, int src_h, int dst_x, int dst_y, int dw, int dh, int clip_x, int clip_y, int clip_w, int clip_h)
 compose_window_scaled_to_clip – scales the window's own buffer (src_w x src_h) to (dw x dh) and alpha-blends it onto the canvas at (dst_x, dst_y). Clipped to the canvas, NEON fast path kept.
 
void _compose_entire_window (ChCanvas *canvas, Window *win, bool _window_update_all_, WinSharedInfo *info, Window *focusedWin, bool _window_moving_, bool _shadow_update)
 compose_entire_window – composes an entire window to canvas
 
void _compose_always_on_top_dirty (ChCanvas *canvas, WinSharedInfo *info, bool _window_moving_, Window *focusedWin, Window *win)
 _compose_always_on_top_dirty – compose always on top window's dirty rectangles
 
void _compose_always_on_top_entire (ChCanvas *canvas, Window *win, bool _always_on_top_update, bool _window_moving_, WinSharedInfo *info, Window *rootWin)
 _compose_always_on_top_entire – compose entire always on top window
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ WIN_MAX_DAMAGE

#define WIN_MAX_DAMAGE   256

Function Documentation

◆ _compose_always_on_top_dirty()

void _compose_always_on_top_dirty ( ChCanvas *  canvas,
WinSharedInfo *  info,
bool  _window_moving_,
Window *  focusedWin,
Window *  win 
)

_compose_always_on_top_dirty – compose always on top window's dirty rectangles

Parameters
canvas– Pointer to canvas
info– Pointer to window's shared info
_window_moving_– window moving bit
focusedWin– Pointer to focused Window
win– Pointer to main window

◆ _compose_always_on_top_entire()

void _compose_always_on_top_entire ( ChCanvas *  canvas,
Window *  win,
bool  _always_on_top_update,
bool  _window_moving_,
WinSharedInfo *  info,
Window *  rootWin 
)

_compose_always_on_top_entire – compose entire always on top window

◆ _compose_dirty_area_()

void _compose_dirty_area_ ( ChCanvas *  canvas,
Window *  win,
Window *  focusedWin,
WinSharedInfo *  info 
)

Check for small area updates !! not entire window.

◆ _compose_entire_window()

void _compose_entire_window ( ChCanvas *  canvas,
Window *  win,
bool  _window_update_all_,
WinSharedInfo *  info,
Window *  focusedWin,
bool  _window_moving_,
bool  _shadow_update 
)

compose_entire_window – composes an entire window to canvas

Parameters
canvas– Pointer to Deodhai canvas
win– Pointer to main window to compose
_window_update_all_– update all bit
info– Pointer to main window info struct
focusedWin– focused window pointer
_window_moving_– window moving bit
_shadow_update– shadow update bit which tells if we need to update shadows or not

if ((info->x - SHADOW_SIZE) <= 0) { info->x = 5 + SHADOW_SIZE; winx = info->x; glass_invalidate(win); }

if ((info->y - SHADOW_SIZE) <= 0) { info->y = 5 + SHADOW_SIZE; winy = info->y; glass_invalidate(win); }

if ((info->x + 24) >= (int)canvas->screenWidth) info->x = canvas->screenWidth - 24;

if ((info->y + 24) >= (int)canvas->screenHeight) info->y = canvas->screenHeight - 24;

◆ _get_always_on_top()

Window * _get_always_on_top ( )
extern

◆ compose_window_scaled_to()

void compose_window_scaled_to ( ChCanvas *  canvas,
Window *  win,
int  src_w,
int  src_h,
int  dst_x,
int  dst_y,
int  dw,
int  dh 
)

compose_window_scaled_to – scales the window's own buffer (src_w x src_h) to (dw x dh) and alpha-blends it onto the canvas at (dst_x, dst_y). Clipped to the canvas, NEON fast path kept.

Parameters
src_w,src_h– ORIGINAL size of win->backBuffer (not info->width/height, those change while resizing)
dst_x,dst_y– top-left of the scaled window on the canvas
dw,dh– size to scale to

◆ compose_window_scaled_to_clip()

void compose_window_scaled_to_clip ( ChCanvas *  canvas,
Window *  win,
int  src_w,
int  src_h,
int  dst_x,
int  dst_y,
int  dw,
int  dh,
int  clip_x,
int  clip_y,
int  clip_w,
int  clip_h 
)

compose_window_scaled_to_clip – scales the window's own buffer (src_w x src_h) to (dw x dh) and alpha-blends it onto the canvas at (dst_x, dst_y). Clipped to the canvas, NEON fast path kept.

Parameters
src_w,src_h– ORIGINAL size of win->backBuffer (not info->width/height, those change while resizing)
dst_x,dst_y– top-left of the scaled window on the canvas
dw,dh– size to scale to

◆ compose_window_zoomed()

void compose_window_zoomed ( ChCanvas *  canvas,
Window *  win,
WinSharedInfo *  info 
)

compose_window_zoomed – stretched-fill upscale of a window buffer into the compose canvas (the back surface the GPU flush presents from), honoring WinSharedInfo->zoomed. Fullscreen dirty is published by the caller so transfer moves the whole frame. The whole buffer (titlebar chrome included) stretches: the bar stays visible and its buttons stay clickable via remapped input. Nearest-neighbor. Fixed-point stepping (no float), 4-wide opaque fast path; only translucent pixels pay for a blend call.

compose_window_zoomed – stretched-fill bilinear upscale of a window buffer to the full scanout (WinSharedInfo->zoomed)

◆ is_window_fully_overlapped()

bool is_window_fully_overlapped ( WinSharedInfo *  curInfo,
Window *  alwaysOnTop 
)