zenilib: zenilib/jni/external/sdl/src/render/software/SDL_render_sw.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
SDL_render_sw.c File Reference
`#include "SDL_config.h"`
`#include "../SDL_sysrender.h"`
`#include "SDL_render_sw_c.h"`
`#include "SDL_hints.h"`
`#include "SDL_draw.h"`
`#include "SDL_blendfillrect.h"`
`#include "SDL_blendline.h"`
`#include "SDL_blendpoint.h"`
`#include "SDL_drawline.h"`
`#include "SDL_drawpoint.h"`
`#include "SDL_rotate.h"`

Go to the source code of this file.

## Functions

static int | GetScaleQuality (void)
static SDL_Surface * | SW_ActivateRenderer (SDL_Renderer *renderer)
static SDL_Renderer * | SW_CreateRenderer (SDL_Window *window, Uint32 flags)
SDL_Renderer * | SW_CreateRendererForSurface (SDL_Surface *surface)
static int | SW_CreateTexture (SDL_Renderer *renderer, SDL_Texture *texture)
static void | SW_DestroyRenderer (SDL_Renderer *renderer)
static void | SW_DestroyTexture (SDL_Renderer *renderer, SDL_Texture *texture)
static int | SW_GetOutputSize (SDL_Renderer *renderer, int *w, int *h)
static int | SW_LockTexture (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
static int | SW_RenderClear (SDL_Renderer *renderer)
static int | SW_RenderCopy (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
static int | SW_RenderCopyEx (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
static int | SW_RenderDrawLines (SDL_Renderer *renderer, const SDL_FPoint *points, int count)
static int | SW_RenderDrawPoints (SDL_Renderer *renderer, const SDL_FPoint *points, int count)
static int | SW_RenderFillRects (SDL_Renderer *renderer, const SDL_FRect *rects, int count)
static void | SW_RenderPresent (SDL_Renderer *renderer)
static int | SW_RenderReadPixels (SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
static int | SW_SetRenderTarget (SDL_Renderer *renderer, SDL_Texture *texture)
static int | SW_SetTextureAlphaMod (SDL_Renderer *renderer, SDL_Texture *texture)
static int | SW_SetTextureBlendMode (SDL_Renderer *renderer, SDL_Texture *texture)
static int | SW_SetTextureColorMod (SDL_Renderer *renderer, SDL_Texture *texture)
static void | SW_UnlockTexture (SDL_Renderer *renderer, SDL_Texture *texture)
static int | SW_UpdateClipRect (SDL_Renderer *renderer)
static int | SW_UpdateTexture (SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
static int | SW_UpdateViewport (SDL_Renderer *renderer)
static void | SW_WindowEvent (SDL_Renderer *renderer, const SDL_WindowEvent *event)

## Variables

SDL_RenderDriver | SW_RenderDriver

## Function Documentation

static int GetScaleQuality | ( | void |  | ) |

static

Definition at line 562 of file SDL_render_sw.c.

References SDL_GetHint(), SDL_HINT_RENDER_SCALE_QUALITY, and SDL_strcasecmp().

Referenced by SW_RenderCopyEx().

static SDL_Surface* SW_ActivateRenderer | ( | SDL_Renderer * | renderer | ) |

static

Definition at line 106 of file SDL_render_sw.c.

References SDL_Renderer::driverdata, if(), SDL_GetWindowSurface(), SW_UpdateClipRect(), SW_UpdateViewport(), and SDL_Renderer::window.

Referenced by SW_CreateRendererForSurface(), SW_GetOutputSize(), SW_RenderClear(), SW_RenderCopy(), SW_RenderCopyEx(), SW_RenderDrawLines(), SW_RenderDrawPoints(), SW_RenderFillRects(), and SW_RenderReadPixels().

SDL_Renderer * SW_CreateRenderer | ( | SDL_Window * | window,
|  | Uint32 | flags
| ) |  |

static

Definition at line 181 of file SDL_render_sw.c.

References NULL, SDL_GetWindowSurface(), and SW_CreateRendererForSurface().

SDL_Renderer* SW_CreateRendererForSurface | ( | SDL_Surface * | surface | ) |

Definition at line 126 of file SDL_render_sw.c.

References SDL_Renderer::CreateTexture, SDL_Renderer::DestroyRenderer, SDL_Renderer::DestroyTexture, SDL_Renderer::driverdata, SDL_Renderer::GetOutputSize, SDL_Renderer::info, SDL_RenderDriver::info, SDL_Renderer::LockTexture, NULL, SDL_Renderer::RenderClear, SDL_Renderer::RenderCopy, SDL_Renderer::RenderCopyEx, SDL_Renderer::RenderDrawLines, SDL_Renderer::RenderDrawPoints, SDL_Renderer::RenderFillRects, SDL_Renderer::RenderPresent, SDL_Renderer::RenderReadPixels, SDL_calloc(), SDL_OutOfMemory, SDL_SetError(), SDL_Renderer::SetRenderTarget, SDL_Renderer::SetTextureAlphaMod, SDL_Renderer::SetTextureBlendMode, SDL_Renderer::SetTextureColorMod, SW_ActivateRenderer(), SW_CreateTexture(), SW_DestroyRenderer(), SW_DestroyTexture(), SW_GetOutputSize(), SW_LockTexture(), SW_RenderClear(), SW_RenderCopy(), SW_RenderCopyEx(), SW_RenderDrawLines(), SW_RenderDrawPoints(), SW_RenderFillRects(), SW_RenderPresent(), SW_RenderReadPixels(), SW_SetRenderTarget(), SW_SetTextureAlphaMod(), SW_SetTextureBlendMode(), SW_SetTextureColorMod(), SW_UnlockTexture(), SW_UpdateClipRect(), SW_UpdateTexture(), SW_UpdateViewport(), SW_WindowEvent(), SDL_Renderer::UnlockTexture, SDL_Renderer::UpdateClipRect, SDL_Renderer::UpdateTexture, SDL_Renderer::UpdateViewport, and SDL_Renderer::WindowEvent.

Referenced by SDL_CreateSoftwareRenderer(), and SW_CreateRenderer().

static int SW_CreateTexture | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture
| ) |  |

static

Definition at line 223 of file SDL_render_sw.c.

References SDL_Texture::a, SDL_Texture::access, SDL_Texture::b, SDL_Texture::blendMode, SDL_Texture::driverdata, SDL_Texture::format, SDL_Texture::g, SDL_Texture::h, SDL_Texture::r, SDL_CreateRGBSurface(), SDL_PixelFormatEnumToMasks(), SDL_SetError(), SDL_SetSurfaceAlphaMod(), SDL_SetSurfaceBlendMode(), SDL_SetSurfaceColorMod(), SDL_SetSurfaceRLE(), SDL_TEXTUREACCESS_STATIC, and SDL_Texture::w.

Referenced by SW_CreateRendererForSurface().

static void SW_DestroyRenderer | ( | SDL_Renderer * | renderer | ) |

static

Definition at line 717 of file SDL_render_sw.c.

References SDL_Renderer::driverdata, and SDL_free().

Referenced by SW_CreateRendererForSurface().

static void SW_DestroyTexture | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture
| ) |  |

static

Definition at line 709 of file SDL_render_sw.c.

References SDL_Texture::driverdata, and SDL_FreeSurface().

Referenced by SW_CreateRendererForSurface().

static int SW_GetOutputSize | ( | SDL_Renderer * | renderer,
|  | int * | w,
|  | int * | h
| ) |  |

static

Definition at line 204 of file SDL_render_sw.c.

References SDL_Surface::h, SDL_SetError(), SW_ActivateRenderer(), and SDL_Surface::w.

Referenced by SW_CreateRendererForSurface().

static int SW_LockTexture | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture,
|  | const SDL_Rect * | rect,
|  | void ** | pixels,
|  | int * | pitch
| ) |  |

static

Definition at line 300 of file SDL_render_sw.c.

References SDL_PixelFormat::BytesPerPixel, SDL_Texture::driverdata, SDL_Surface::format, SDL_Surface::pitch, SDL_Surface::pixels, SDL_Rect::x, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static int SW_RenderClear | ( | SDL_Renderer * | renderer | ) |

static

Definition at line 363 of file SDL_render_sw.c.

References SDL_Renderer::a, SDL_Renderer::b, SDL_Surface::clip_rect, SDL_Surface::format, SDL_Renderer::g, NULL, SDL_Renderer::r, SDL_FillRect(), SDL_MapRGBA(), SDL_SetClipRect(), and SW_ActivateRenderer().

Referenced by SW_CreateRendererForSurface().

static int SW_RenderCopy | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture,
|  | const SDL_Rect * | srcrect,
|  | const SDL_FRect * | dstrect
| ) |  |

static

Definition at line 533 of file SDL_render_sw.c.

References SDL_Texture::driverdata, SDL_FRect::h, SDL_Rect::h, if(), int, SDL_BlitScaled, SDL_BlitSurface, SW_ActivateRenderer(), SDL_Renderer::viewport, SDL_FRect::w, SDL_Rect::w, SDL_FRect::x, SDL_Rect::x, SDL_FRect::y, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static int SW_RenderCopyEx | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture,
|  | const SDL_Rect * | srcrect,
|  | const SDL_FRect * | dstrect,
|  | const double | angle,
|  | const SDL_FPoint * | center,
|  | const SDL_RendererFlip | flip
| ) |  |

static

Definition at line 574 of file SDL_render_sw.c.

References _rotateSurface(), _rotozoomSurfaceSizeTrig(), SDL_PixelFormat::Amask, SDL_PixelFormat::BitsPerPixel, SDL_PixelFormat::Bmask, SDL_Texture::driverdata, SDL_Surface::format, GetScaleQuality(), SDL_PixelFormat::Gmask, SDL_FRect::h, SDL_Rect::h, if(), int, MIN, NULL, SDL_PixelFormat::Rmask, SDL_BlitScaled, SDL_BlitSurface, SDL_CreateRGBSurface(), SDL_FLIP_HORIZONTAL, SDL_FLIP_VERTICAL, SDL_FreeSurface(), SDL_GetColorKey(), SDL_SetColorKey(), SDL_SWSURFACE, SDL_TRUE, SW_ActivateRenderer(), SDL_Renderer::viewport, SDL_FRect::w, SDL_Rect::w, SDL_FPoint::x, SDL_FRect::x, SDL_Rect::x, SDL_FPoint::y, SDL_FRect::y, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static int SW_RenderDrawLines | ( | SDL_Renderer * | renderer,
|  | const SDL_FPoint * | points,
|  | int | count
| ) |  |

static

Definition at line 434 of file SDL_render_sw.c.

References SDL_Renderer::a, SDL_Renderer::b, SDL_Renderer::blendMode, SDL_Surface::format, SDL_Renderer::g, i, int, SDL_Renderer::r, SDL_BlendLines(), SDL_BLENDMODE_NONE, SDL_DrawLines(), SDL_MapRGBA(), SDL_OutOfMemory, SDL_stack_alloc, SDL_stack_free, SW_ActivateRenderer(), SDL_Renderer::viewport, SDL_Point::x, SDL_Rect::x, SDL_Point::y, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static int SW_RenderDrawPoints | ( | SDL_Renderer * | renderer,
|  | const SDL_FPoint * | points,
|  | int | count
| ) |  |

static

Definition at line 385 of file SDL_render_sw.c.

References SDL_Renderer::a, SDL_Renderer::b, SDL_Renderer::blendMode, SDL_Surface::format, SDL_Renderer::g, i, int, SDL_Renderer::r, SDL_BLENDMODE_NONE, SDL_BlendPoints(), SDL_DrawPoints(), SDL_MapRGBA(), SDL_OutOfMemory, SDL_stack_alloc, SDL_stack_free, SW_ActivateRenderer(), SDL_Renderer::viewport, SDL_Point::x, SDL_Rect::x, SDL_Point::y, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static int SW_RenderFillRects | ( | SDL_Renderer * | renderer,
|  | const SDL_FRect * | rects,
|  | int | count
| ) |  |

static

Definition at line 483 of file SDL_render_sw.c.

References SDL_Renderer::a, SDL_Renderer::b, SDL_Renderer::blendMode, SDL_Surface::format, SDL_Renderer::g, SDL_Rect::h, i, int, SDL_Renderer::r, SDL_BlendFillRects(), SDL_BLENDMODE_NONE, SDL_FillRects(), SDL_MapRGBA(), SDL_max, SDL_OutOfMemory, SDL_stack_alloc, SDL_stack_free, SW_ActivateRenderer(), SDL_Renderer::viewport, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static void SW_RenderPresent | ( | SDL_Renderer * | renderer | ) |

static

Definition at line 699 of file SDL_render_sw.c.

References SDL_UpdateWindowSurface(), and SDL_Renderer::window.

Referenced by SW_CreateRendererForSurface().

static int SW_RenderReadPixels | ( | SDL_Renderer * | renderer,
|  | const SDL_Rect * | rect,
|  | Uint32 | format,
|  | void * | pixels,
|  | int | pitch
| ) |  |

static

Definition at line 663 of file SDL_render_sw.c.

References SDL_PixelFormat::BytesPerPixel, SDL_Surface::format, SDL_PixelFormat::format, SDL_Rect::h, SDL_Surface::h, SDL_Surface::pitch, SDL_Surface::pixels, SDL_ConvertPixels(), SDL_SetError(), SW_ActivateRenderer(), SDL_Renderer::viewport, SDL_Rect::w, SDL_Surface::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static int SW_SetRenderTarget | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture
| ) |  |

static

Definition at line 318 of file SDL_render_sw.c.

References SDL_Texture::driverdata, SDL_Renderer::driverdata, and if().

Referenced by SW_CreateRendererForSurface().

static int SW_SetTextureAlphaMod | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture
| ) |  |

static

Definition at line 260 of file SDL_render_sw.c.

References SDL_Texture::a, SDL_Texture::driverdata, and SDL_SetSurfaceAlphaMod().

Referenced by SW_CreateRendererForSurface().

static int SW_SetTextureBlendMode | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture
| ) |  |

static

Definition at line 267 of file SDL_render_sw.c.

References SDL_Texture::blendMode, SDL_Texture::driverdata, and SDL_SetSurfaceBlendMode().

Referenced by SW_CreateRendererForSurface().

static int SW_SetTextureColorMod | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture
| ) |  |

static

Definition at line 252 of file SDL_render_sw.c.

References SDL_Texture::b, SDL_Texture::driverdata, SDL_Texture::g, SDL_Texture::r, and SDL_SetSurfaceColorMod().

Referenced by SW_CreateRendererForSurface().

static void SW_UnlockTexture | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture
| ) |  |

static

Definition at line 313 of file SDL_render_sw.c.

Referenced by SW_CreateRendererForSurface().

static int SW_UpdateClipRect | ( | SDL_Renderer * | renderer | ) |

static

Definition at line 346 of file SDL_render_sw.c.

References SDL_Renderer::clip_rect, SDL_Renderer::driverdata, if(), NULL, SDL_RectEmpty(), and SDL_SetClipRect().

Referenced by SW_ActivateRenderer(), and SW_CreateRendererForSurface().

static int SW_UpdateTexture | ( | SDL_Renderer * | renderer,
|  | SDL_Texture * | texture,
|  | const SDL_Rect * | rect,
|  | const void * | pixels,
|  | int | pitch
| ) |  |

static

Definition at line 274 of file SDL_render_sw.c.

References SDL_PixelFormat::BytesPerPixel, SDL_Texture::driverdata, for(), SDL_Surface::format, SDL_Rect::h, SDL_Surface::pitch, SDL_Surface::pixels, SDL_LockSurface(), SDL_memcpy(), SDL_MUSTLOCK, SDL_UnlockSurface(), SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

Referenced by SW_CreateRendererForSurface().

static int SW_UpdateViewport | ( | SDL_Renderer * | renderer | ) |

static

Definition at line 331 of file SDL_render_sw.c.

References SDL_Renderer::driverdata, if(), SDL_SetClipRect(), and SDL_Renderer::viewport.

Referenced by SW_ActivateRenderer(), and SW_CreateRendererForSurface().

static void SW_WindowEvent | ( | SDL_Renderer * | renderer,
|  | const SDL_WindowEvent * | event
| ) |  |

static

Definition at line 193 of file SDL_render_sw.c.

References SDL_Renderer::driverdata, SDL_WindowEvent::event, if(), NULL, and SDL_WINDOWEVENT_SIZE_CHANGED.

Referenced by SW_CreateRendererForSurface().

## Variable Documentation

SDL_RenderDriver SW_RenderDriver

Initial value:
= {
SW_CreateRenderer,
{
"software",
SDL_RENDERER_SOFTWARE | SDL_RENDERER_TARGETTEXTURE,
8,
{
SDL_PIXELFORMAT_RGB555,
SDL_PIXELFORMAT_RGB565,
SDL_PIXELFORMAT_RGB888,
SDL_PIXELFORMAT_BGR888,
SDL_PIXELFORMAT_ARGB8888,
SDL_PIXELFORMAT_RGBA8888,
SDL_PIXELFORMAT_ABGR8888,
SDL_PIXELFORMAT_BGRA8888
},
0,
0}
}
SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:230
SDL_RENDERER_TARGETTEXTURE
Definition: SDL_render.h:71
SDL_PIXELFORMAT_RGB565
Definition: SDL_pixels.h:200
SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:233
SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:224
SDL_PIXELFORMAT_RGB555
Definition: SDL_pixels.h:170
SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:227
SDL_RENDERER_SOFTWARE
Definition: SDL_render.h:66
SDL_PIXELFORMAT_RGB888
Definition: SDL_pixels.h:212
SW_CreateRenderer
static SDL_Renderer * SW_CreateRenderer(SDL_Window *window, Uint32 flags)
Definition: SDL_render_sw.c:181
SDL_PIXELFORMAT_BGR888
Definition: SDL_pixels.h:218

Definition at line 78 of file SDL_render_sw.c.