clanSWRender Display

Classes

class  clan::BlitARGB8SSE
 SSE accelerated rendering operations for ARGB8888. More...
 
class  clan::GraphicContext_SWRender
 SWRender Graphic Context. More...
 
class  clan::PixelBufferData
 Frame buffer or texture data for pixel commands. More...
 
class  clan::PixelCommand
 Interface for commands participating in the rendering pipeline. More...
 
class  clan::PixelThreadContext
 Thread specific rendering data for pixel commands. More...
 
class  clan::ProgramObject_SWRender
 SWRender Graphic Context. More...
 
class  clan::SoftwareProgram
 Interface for commands participating in drawing primitives. More...
 
class  clan::SWRenderTarget
 Display target for clanDisplay. More...
 

Macros

#define cl_blitargb8sse_blend_normal(dest, src, one, half)
 
#define cl_blitargb8sse_multiply_color(src, primcolor)
 
#define cl_blitargb8sse_sample_nearest(out0, tx, ty, data, width)
 
#define cl_blitargb8sse_texture_repeat(tx, ty, width, height)
 

Enumerations

enum  { clan::PixelThreadContext::max_samplers = 6 }
 

Functions

 clan::GraphicContext_SWRender::GraphicContext_SWRender ()
 Construction. More...
 
 clan::GraphicContext_SWRender::GraphicContext_SWRender (GraphicContext &gc)
 Create a SWRender specific graphics context. More...
 
 clan::PixelBufferData::PixelBufferData ()
 Construction. More...
 
 clan::PixelThreadContext::PixelThreadContext (int core, int num_cores)
 Construction. More...
 
 clan::ProgramObject_SWRender::ProgramObject_SWRender ()
 Construction. More...
 
 clan::ProgramObject_SWRender::ProgramObject_SWRender (SoftwareProgram *program, bool is_sprite_program)
 Create a SWRender specific graphics context. More...
 
 clan::ProgramObject_SWRender::ProgramObject_SWRender (const ProgramObject &program_object)
 Create a SWRender specific program object. More...
 
 clan::GraphicContext_SWRender::~GraphicContext_SWRender ()
 
virtual clan::PixelCommand::~PixelCommand ()
 Operations. More...
 
 clan::ProgramObject_SWRender::~ProgramObject_SWRender ()
 
virtual clan::SoftwareProgram::~SoftwareProgram ()
 Operations. More...
 
static void clan::BlitARGB8SSE::blend_lcd (__m128i &dest, __m128i &src, __m128i &one, __m128i &half, __m128i &color)
 
static void clan::BlitARGB8SSE::blend_normal (__m128i &dest, __m128i &src, __m128i &one, __m128i &half)
 
static void clan::BlitARGB8SSE::blend_premultiplied (__m128i &dest, __m128i &src, __m128i &one, __m128i &half)
 
static void clan::BlitARGB8SSE::channels_to_pixels (__m128i &dest0, __m128i &dest1, __m128i &red, __m128i &green, __m128i &blue, __m128i &alpha)
 
static void clan::BlitARGB8SSE::copy_pixels (unsigned int *dest, const unsigned int *src)
 Operations. More...
 
virtual PixelCommand * clan::SoftwareProgram::draw_line (PixelPipeline *pipeline, const std::vector< Vec4f > &attribute_values)=0
 
void clan::GraphicContext_SWRender::draw_pixels (float x, float y, float zoom_x, float zoom_y, const PixelBuffer &pixel_buffer, const Rect &src_rect, const Colorf &color)
 Operations. More...
 
void clan::GraphicContext_SWRender::draw_pixels_bicubic (int x, int y, int zoom_number, int zoom_denominator, const PixelBuffer &pixels)
 
virtual PixelCommand * clan::SoftwareProgram::draw_sprite (PixelPipeline *pipeline, const std::vector< Vec4f > &attribute_values)=0
 
virtual PixelCommand * clan::SoftwareProgram::draw_triangle (PixelPipeline *pipeline, const std::vector< Vec4f > &attribute_values)=0
 
static int clan::PixelCommand::find_first_line_for_core (int y_start, int core, int num_cores)
 Returns the first line to be rendered by the specified core. More...
 
virtual int clan::SoftwareProgram::get_attribute_count () const =0
 
virtual Vec4f clan::SoftwareProgram::get_attribute_default (int index)
 
virtual int clan::SoftwareProgram::get_attribute_index (const std::string &name) const =0
 
PixelPipeline * clan::GraphicContext_SWRender::get_pipeline () const
 Returns the pixel pipeline class needed to allocated PixelCommand objects. More...
 
SoftwareProgram * clan::ProgramObject_SWRender::get_program () const
 Attributes. More...
 
SWRenderProgramObjectProvider * clan::ProgramObject_SWRender::get_provider () const
 Retrieves the provider. More...
 
bool clan::GraphicContext_SWRender::is_null () const
 Attributes. More...
 
bool clan::ProgramObject_SWRender::is_sprite_program () const
 Returns true if this program object was created as a sprite program. More...
 
static void clan::BlitARGB8SSE::load_pixel (__m128i &xmm, const unsigned int &pixel)
 
static void clan::BlitARGB8SSE::load_pixel_linear (__m128i &xmm, const unsigned int &p1, const unsigned int &p2, const unsigned int &p3, const unsigned int &p4, unsigned int ifracx, unsigned int ifracy)
 
static void clan::BlitARGB8SSE::load_pixels (__m128i &xmm, const unsigned int *pixels)
 
static void clan::BlitARGB8SSE::load_pixels (__m128i &xmm, const unsigned int &p1, unsigned int &p2)
 
static void clan::BlitARGB8SSE::multiply_color (__m128i &src, __m128i primcolor)
 
void clan::PixelCommand::operator delete (void *obj, PixelPipeline *p)
 
void clan::PixelCommand::operator delete (void *obj)
 
void * clan::PixelCommand::operator new (size_t s, PixelPipeline *p)
 
static void clan::BlitARGB8SSE::pixels_to_channels (__m128i &red, __m128i &green, __m128i &blue, __m128i &alpha, const __m128i &src0, const __m128i &src1)
 
template<typename T >
void clan::GraphicContext_SWRender::queue_command (T *command)
 Queues a pixel command in the pipeline. More...
 
void clan::GraphicContext_SWRender::queue_command (std::unique_ptr< PixelCommand > &command)
 
virtual void clan::PixelCommand::run (PixelThreadContext *context)=0
 Called by each rendering thread in the pipeline to run the command. More...
 
void clan::PixelBufferData::set (const PixelBuffer &new_pixelbuffer)
 Operations. More...
 
static void clan::BlitARGB8SSE::set_color (__m128i &xmm, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha)
 
static void clan::BlitARGB8SSE::set_color (__m128i &xmm, unsigned short r1, unsigned short g1, unsigned short b1, unsigned short a1, unsigned short r2, unsigned short g2, unsigned short b2, unsigned short a2)
 
static void clan::BlitARGB8SSE::set_half (__m128i &xmm)
 
static void clan::BlitARGB8SSE::set_one (__m128i &xmm)
 
virtual void clan::SoftwareProgram::set_uniform (int location, const Vec4f &vec)=0
 
virtual void clan::SoftwareProgram::set_uniform_matrix (int location, const Mat4f &mat)=0
 
static void clan::BlitARGB8SSE::store_pixel (unsigned int &pixel, __m128i &xmm)
 
static void clan::BlitARGB8SSE::store_pixels (unsigned int *pixels, __m128i &xmm)
 
void clan::GraphicContext_SWRender::throw_if_null () const
 Throw an exception if this object is invalid. More...
 

Variables

Rect clan::PixelThreadContext::clip_rect
 
PixelBufferData clan::PixelThreadContext::colorbuffer0
 
int clan::PixelThreadContext::core
 Attributes. More...
 
Colorf clan::PixelThreadContext::cur_blend_color
 
BlendFunc clan::PixelThreadContext::cur_blend_dest
 
BlendFunc clan::PixelThreadContext::cur_blend_dest_alpha
 
BlendFunc clan::PixelThreadContext::cur_blend_src
 
BlendFunc clan::PixelThreadContext::cur_blend_src_alpha
 
unsigned int * clan::PixelBufferData::data
 
int clan::PixelThreadContext::num_cores
 
PixelBuffer clan::PixelBufferData::pixelbuffer
 Attributes. More...
 
PixelBuffer clan::PixelThreadContext::pixelbuffer_white
 
PixelBufferData clan::PixelThreadContext::samplers [max_samplers]
 
Size clan::PixelBufferData::size
 

Construction

 clan::SWRenderTarget::SWRenderTarget ()
 Constructs a SWRender target. More...
 
 clan::SWRenderTarget::~SWRenderTarget ()
 

Attributes

static bool clan::SWRenderTarget::is_current ()
 Returns true if this display target is the current target. More...
 

Operations

static void clan::SWRenderTarget::set_current ()
 Set this display target to be the current target. More...
 

Detailed Description

Macro Definition Documentation

#define cl_blitargb8sse_blend_normal (   dest,
  src,
  one,
  half 
)
Value:
{ \
__m128i src_alpha, invsrc_alpha; \
\
src_alpha = src; \
src_alpha = _mm_shufflelo_epi16(src_alpha, 0xff); \
src_alpha = _mm_shufflehi_epi16(src_alpha, 0xff); \
\
invsrc_alpha = _mm_sub_epi16(one, src_alpha); \
\
src = _mm_mullo_epi16(src, src_alpha); \
dest = _mm_mullo_epi16(dest, invsrc_alpha); \
\
dest = _mm_add_epi16(dest, src); \
dest = _mm_add_epi16(dest, half); \
dest = _mm_srli_epi16(dest, 8); \
}
#define cl_blitargb8sse_multiply_color (   src,
  primcolor 
)
Value:
{ \
src = _mm_mullo_epi16(src, primcolor); \
src = _mm_srli_epi16(src, 8); \
}
#define cl_blitargb8sse_sample_nearest (   out0,
  tx,
  ty,
  data,
  width 
)
Value:
{ \
__attribute__ ((aligned(16))) unsigned int x[4], y[4]; \
_mm_store_si128((__m128i*) x, _mm_srai_epi32(tx, 16)); \
_mm_store_si128((__m128i*) y, _mm_srai_epi32(ty, 16)); \
out0 = _mm_set_epi32(data[x[0]+y[0]*width], data[x[1]+y[1]*width], data[x[2]+y[2]*width], data[x[3]+y[3]*width]); \
}
#define cl_blitargb8sse_texture_repeat (   tx,
  ty,
  width,
  height 
)

Enumeration Type Documentation

anonymous enum
Enumerator
max_samplers 

Function Documentation

clan::GraphicContext_SWRender::GraphicContext_SWRender ( )
inline

Construction.

clan::GraphicContext_SWRender::GraphicContext_SWRender ( GraphicContext gc)

Create a SWRender specific graphics context.

clan::PixelBufferData::PixelBufferData ( )
inline

Construction.

clan::PixelThreadContext::PixelThreadContext ( int  core,
int  num_cores 
)

Construction.

clan::ProgramObject_SWRender::ProgramObject_SWRender ( )
inline

Construction.

clan::ProgramObject_SWRender::ProgramObject_SWRender ( SoftwareProgram program,
bool  is_sprite_program 
)

Create a SWRender specific graphics context.

Parameters
program= The software program
is_sprite_program= true when the specified triangles will form rectangles (This is slightly faster)
clan::ProgramObject_SWRender::ProgramObject_SWRender ( const ProgramObject program_object)

Create a SWRender specific program object.

An exception is thrown if the program object is not a SWRender object

clan::SWRenderTarget::SWRenderTarget ( )

Constructs a SWRender target.

clan::GraphicContext_SWRender::~GraphicContext_SWRender ( )
virtual clan::PixelCommand::~PixelCommand ( )
inlinevirtual

Operations.

clan::ProgramObject_SWRender::~ProgramObject_SWRender ( )
virtual clan::SoftwareProgram::~SoftwareProgram ( )
inlinevirtual

Operations.

clan::SWRenderTarget::~SWRenderTarget ( )
void clan::BlitARGB8SSE::blend_lcd ( __m128i &  dest,
__m128i &  src,
__m128i &  one,
__m128i &  half,
__m128i &  color 
)
inlinestatic
void clan::BlitARGB8SSE::blend_normal ( __m128i &  dest,
__m128i &  src,
__m128i &  one,
__m128i &  half 
)
inlinestatic
void clan::BlitARGB8SSE::blend_premultiplied ( __m128i &  dest,
__m128i &  src,
__m128i &  one,
__m128i &  half 
)
inlinestatic
void clan::BlitARGB8SSE::channels_to_pixels ( __m128i &  dest0,
__m128i &  dest1,
__m128i &  red,
__m128i &  green,
__m128i &  blue,
__m128i &  alpha 
)
inlinestatic
void clan::BlitARGB8SSE::copy_pixels ( unsigned int *  dest,
const unsigned int *  src 
)
inlinestatic

Operations.

virtual PixelCommand* clan::SoftwareProgram::draw_line ( PixelPipeline *  pipeline,
const std::vector< Vec4f > &  attribute_values 
)
pure virtual
void clan::GraphicContext_SWRender::draw_pixels ( float  x,
float  y,
float  zoom_x,
float  zoom_y,
const PixelBuffer pixel_buffer,
const Rect src_rect,
const Colorf color 
)

Operations.

void clan::GraphicContext_SWRender::draw_pixels_bicubic ( int  x,
int  y,
int  zoom_number,
int  zoom_denominator,
const PixelBuffer pixels 
)
virtual PixelCommand* clan::SoftwareProgram::draw_sprite ( PixelPipeline *  pipeline,
const std::vector< Vec4f > &  attribute_values 
)
pure virtual
virtual PixelCommand* clan::SoftwareProgram::draw_triangle ( PixelPipeline *  pipeline,
const std::vector< Vec4f > &  attribute_values 
)
pure virtual
static int clan::PixelCommand::find_first_line_for_core ( int  y_start,
int  core,
int  num_cores 
)
static

Returns the first line to be rendered by the specified core.

virtual int clan::SoftwareProgram::get_attribute_count ( ) const
pure virtual
virtual Vec4f clan::SoftwareProgram::get_attribute_default ( int  index)
inlinevirtual
virtual int clan::SoftwareProgram::get_attribute_index ( const std::string &  name) const
pure virtual
PixelPipeline* clan::GraphicContext_SWRender::get_pipeline ( ) const

Returns the pixel pipeline class needed to allocated PixelCommand objects.

SoftwareProgram* clan::ProgramObject_SWRender::get_program ( ) const

Attributes.

Get the attached program

SWRenderProgramObjectProvider* clan::ProgramObject_SWRender::get_provider ( ) const

Retrieves the provider.

static bool clan::SWRenderTarget::is_current ( )
static

Returns true if this display target is the current target.

This may change after a display window has been created

bool clan::GraphicContext_SWRender::is_null ( ) const
inline

Attributes.

Returns true if this object is invalid.

bool clan::ProgramObject_SWRender::is_sprite_program ( ) const

Returns true if this program object was created as a sprite program.

void clan::BlitARGB8SSE::load_pixel ( __m128i &  xmm,
const unsigned int &  pixel 
)
inlinestatic
void clan::BlitARGB8SSE::load_pixel_linear ( __m128i &  xmm,
const unsigned int &  p1,
const unsigned int &  p2,
const unsigned int &  p3,
const unsigned int &  p4,
unsigned int  ifracx,
unsigned int  ifracy 
)
inlinestatic
void clan::BlitARGB8SSE::load_pixels ( __m128i &  xmm,
const unsigned int *  pixels 
)
inlinestatic
void clan::BlitARGB8SSE::load_pixels ( __m128i &  xmm,
const unsigned int &  p1,
unsigned int &  p2 
)
inlinestatic
void clan::BlitARGB8SSE::multiply_color ( __m128i &  src,
__m128i  primcolor 
)
inlinestatic
void clan::PixelCommand::operator delete ( void *  obj,
PixelPipeline *  p 
)
void clan::PixelCommand::operator delete ( void *  obj)
void* clan::PixelCommand::operator new ( size_t  s,
PixelPipeline *  p 
)
void clan::BlitARGB8SSE::pixels_to_channels ( __m128i &  red,
__m128i &  green,
__m128i &  blue,
__m128i &  alpha,
const __m128i &  src0,
const __m128i &  src1 
)
inlinestatic
template<typename T >
void clan::GraphicContext_SWRender::queue_command ( T *  command)
inline

Queues a pixel command in the pipeline.

References clan::GraphicContext_SWRender::queue_command().

Referenced by clan::GraphicContext_SWRender::queue_command().

void clan::GraphicContext_SWRender::queue_command ( std::unique_ptr< PixelCommand > &  command)
virtual void clan::PixelCommand::run ( PixelThreadContext context)
pure virtual

Called by each rendering thread in the pipeline to run the command.

void clan::BlitARGB8SSE::set_color ( __m128i &  xmm,
unsigned short  red,
unsigned short  green,
unsigned short  blue,
unsigned short  alpha 
)
inlinestatic
void clan::BlitARGB8SSE::set_color ( __m128i &  xmm,
unsigned short  r1,
unsigned short  g1,
unsigned short  b1,
unsigned short  a1,
unsigned short  r2,
unsigned short  g2,
unsigned short  b2,
unsigned short  a2 
)
inlinestatic
static void clan::SWRenderTarget::set_current ( )
static

Set this display target to be the current target.

void clan::BlitARGB8SSE::set_half ( __m128i &  xmm)
inlinestatic
void clan::BlitARGB8SSE::set_one ( __m128i &  xmm)
inlinestatic
virtual void clan::SoftwareProgram::set_uniform ( int  location,
const Vec4f vec 
)
pure virtual
virtual void clan::SoftwareProgram::set_uniform_matrix ( int  location,
const Mat4f mat 
)
pure virtual
void clan::BlitARGB8SSE::store_pixel ( unsigned int &  pixel,
__m128i &  xmm 
)
inlinestatic
void clan::BlitARGB8SSE::store_pixels ( unsigned int *  pixels,
__m128i &  xmm 
)
inlinestatic
void clan::GraphicContext_SWRender::throw_if_null ( ) const

Throw an exception if this object is invalid.

Variable Documentation

Rect clan::PixelThreadContext::clip_rect
PixelBufferData clan::PixelThreadContext::colorbuffer0
int clan::PixelThreadContext::core

Attributes.

Colorf clan::PixelThreadContext::cur_blend_color
BlendFunc clan::PixelThreadContext::cur_blend_dest
BlendFunc clan::PixelThreadContext::cur_blend_dest_alpha
BlendFunc clan::PixelThreadContext::cur_blend_src
BlendFunc clan::PixelThreadContext::cur_blend_src_alpha
unsigned int* clan::PixelBufferData::data
int clan::PixelThreadContext::num_cores
PixelBuffer clan::PixelBufferData::pixelbuffer

Attributes.

Referenced by clan::PixelBufferData::set().

PixelBuffer clan::PixelThreadContext::pixelbuffer_white
PixelBufferData clan::PixelThreadContext::samplers[max_samplers]
Size clan::PixelBufferData::size