NetSurf
Macros | Functions | Variables
buffer.c File Reference
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <swis.h>
#include <oslib/colourtrans.h>
#include <oslib/os.h>
#include <oslib/osspriteop.h>
#include <oslib/wimp.h>
#include <oslib/wimpreadsysinfo.h>
#include "utils/nsoption.h"
#include "utils/log.h"
#include "riscos/buffer.h"
#include "riscos/gui.h"
#include "riscos/tinct.h"
#include "riscos/wimp.h"
#include "riscos/wimputils.h"
Include dependency graph for buffer.c:

Go to the source code of this file.

Macros

#define BUFFER_EXCLUSIVE_USER_REDRAW   "Only support pure user redraw (faster)"
 
#define osspriteop_TYPEEXPANSION   ((osspriteop_mode_word) 0xFu)
 Absent from OSLib. More...
 
#define osspriteop_TYPE16BPP4K   ((osspriteop_mode_word) 0x10u)
 

Functions

static void ro_gui_buffer_free (void)
 Releases any buffer memory depending on cache constraints. More...
 
void ro_gui_buffer_open (const wimp_draw *redraw)
 Opens a buffer for writing to. More...
 
void ro_gui_buffer_close (void)
 Closes any open buffer and flushes the contents to screen. More...
 

Variables

static osspriteop_area * buffer = NULL
 The buffer characteristics. More...
 
static char buffer_name [12] = "scr_buffer"
 
static os_box clipping
 The current clip area. More...
 
static osspriteop_save_area * save_area
 The current save area. More...
 
static int context0
 
static int context1
 
static int context2
 
static int context3
 
static os_mode mode
 The current sprite mode. More...
 

Macro Definition Documentation

◆ BUFFER_EXCLUSIVE_USER_REDRAW

#define BUFFER_EXCLUSIVE_USER_REDRAW   "Only support pure user redraw (faster)"

Definition at line 38 of file buffer.c.

◆ osspriteop_TYPE16BPP4K

#define osspriteop_TYPE16BPP4K   ((osspriteop_mode_word) 0x10u)

Definition at line 47 of file buffer.c.

◆ osspriteop_TYPEEXPANSION

#define osspriteop_TYPEEXPANSION   ((osspriteop_mode_word) 0xFu)

Absent from OSLib.

Definition at line 44 of file buffer.c.

Function Documentation

◆ ro_gui_buffer_close()

void ro_gui_buffer_close ( void  )

Closes any open buffer and flushes the contents to screen.

Definition at line 370 of file buffer.c.

References buffer, clipping, context0, context1, context2, context3, mode, nsoption_int, ro_gui_buffer_free(), ro_plot_origin_x, ro_plot_origin_y, save_area, Tinct_Plot, and tinct_SPRITE_MODE.

Referenced by ro_gui_buffer_open(), ro_gui_cleanup(), and ro_gui_window__redraw_rect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ro_gui_buffer_free()

static void ro_gui_buffer_free ( void  )
static

Releases any buffer memory depending on cache constraints.

Definition at line 406 of file buffer.c.

References buffer.

Referenced by ro_gui_buffer_close(), and ro_gui_buffer_open().

Here is the caller graph for this function:

◆ ro_gui_buffer_open()

void ro_gui_buffer_open ( const wimp_draw *  redraw)

Opens a buffer for writing to.

The ro_plot_origin_ variables are updated to reflect the new screen origin, so the variables should be set before calling this function, and not changed until after ro_gui_buffer_close() has been called.

Parameters
redrawthe current WIMP redraw area to buffer

Definition at line 84 of file buffer.c.

References buffer, buffer_name, clipping, context0, context1, context2, context3, mode, NSLOG, osspriteop_TYPE16BPP4K, osspriteop_TYPEEXPANSION, PTR_OS_VDU_VAR_LIST, ro_convert_os_units_to_pixels(), ro_gui_buffer_close(), ro_gui_buffer_free(), ro_plot_origin_x, ro_plot_origin_y, save_area, tinct_SPRITE_MODE, and type.

Referenced by ro_gui_window__redraw_rect().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ buffer

osspriteop_area* buffer = NULL
static

◆ buffer_name

char buffer_name[12] = "scr_buffer"
static

Definition at line 56 of file buffer.c.

Referenced by ro_gui_buffer_open().

◆ clipping

os_box clipping
static

The current clip area.

Definition at line 60 of file buffer.c.

Referenced by ro_gui_buffer_close(), and ro_gui_buffer_open().

◆ context0

int context0
static

Definition at line 65 of file buffer.c.

Referenced by ro_gui_buffer_close(), and ro_gui_buffer_open().

◆ context1

int context1
static

Definition at line 66 of file buffer.c.

Referenced by ro_gui_buffer_close(), and ro_gui_buffer_open().

◆ context2

int context2
static

Definition at line 67 of file buffer.c.

Referenced by ro_gui_buffer_close(), and ro_gui_buffer_open().

◆ context3

int context3
static

Definition at line 68 of file buffer.c.

Referenced by ro_gui_buffer_close(), and ro_gui_buffer_open().

◆ mode

os_mode mode
static

◆ save_area

osspriteop_save_area* save_area
static