mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
adds profiling to the various gbitmap loaders*
*note, DDS bypasses the gbitmap method chain in question.
This commit is contained in:
parent
513789c2c7
commit
f889aebcea
8 changed files with 10 additions and 0 deletions
|
|
@ -1057,6 +1057,7 @@ bool GBitmap::write(Stream& io_rStream) const
|
||||||
|
|
||||||
bool GBitmap::readBitmap( const String &bmType, Stream &ioStream )
|
bool GBitmap::readBitmap( const String &bmType, Stream &ioStream )
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(ResourceGBitmap_readBitmap);
|
||||||
const GBitmap::Registration *regInfo = GBitmap::sFindRegInfo( bmType );
|
const GBitmap::Registration *regInfo = GBitmap::sFindRegInfo( bmType );
|
||||||
|
|
||||||
if ( regInfo == NULL )
|
if ( regInfo == NULL )
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@
|
||||||
#include "gfx/gfxEnums.h" // For the format
|
#include "gfx/gfxEnums.h" // For the format
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PROFILER_H_
|
||||||
|
#include "platform/profiler.h"
|
||||||
|
#endif
|
||||||
//-------------------------------------- Forward decls.
|
//-------------------------------------- Forward decls.
|
||||||
class Stream;
|
class Stream;
|
||||||
class RectI;
|
class RectI;
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ struct BITMAPINFOHEADER
|
||||||
|
|
||||||
static bool sReadBMP(Stream &stream, GBitmap *bitmap)
|
static bool sReadBMP(Stream &stream, GBitmap *bitmap)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(sReadBMP);
|
||||||
BITMAPINFOHEADER bi;
|
BITMAPINFOHEADER bi;
|
||||||
BITMAPFILEHEADER bf;
|
BITMAPFILEHEADER bf;
|
||||||
RGBQUAD rgb[256];
|
RGBQUAD rgb[256];
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ static S32 gifWriteDataFn(GifFileType *gifinfo, GifByteType *data, S32 length)
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
static bool sReadGIF( Stream &stream, GBitmap *bitmap )
|
static bool sReadGIF( Stream &stream, GBitmap *bitmap )
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(sReadGIF);
|
||||||
GifFileType *gifinfo = DGifOpen( (void*)&stream, gifReadDataFn);
|
GifFileType *gifinfo = DGifOpen( (void*)&stream, gifReadDataFn);
|
||||||
if (!gifinfo)
|
if (!gifinfo)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ static S32 jpegErrorFn(void *client_data)
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
static bool sReadJPG(Stream &stream, GBitmap *bitmap)
|
static bool sReadJPG(Stream &stream, GBitmap *bitmap)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(sReadJPG);
|
||||||
JFREAD = jpegReadDataFn;
|
JFREAD = jpegReadDataFn;
|
||||||
JFERROR = jpegErrorFn;
|
JFERROR = jpegErrorFn;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,7 @@ static mng_bool mngFatalErrorFn(mng_handle mng, mng_int32 code, mng_int8 severit
|
||||||
|
|
||||||
static bool sReadMNG(Stream &stream, GBitmap *bitmap)
|
static bool sReadMNG(Stream &stream, GBitmap *bitmap)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(sReadMNG);
|
||||||
mngstuff mnginfo;
|
mngstuff mnginfo;
|
||||||
dMemset(&mnginfo, 0, sizeof(mngstuff));
|
dMemset(&mnginfo, 0, sizeof(mngstuff));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,7 @@ static void pngWarningFn(png_structp, png_const_charp /*pMessage*/)
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
static bool sReadPNG(Stream &stream, GBitmap *bitmap)
|
static bool sReadPNG(Stream &stream, GBitmap *bitmap)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(sReadPNG);
|
||||||
static const U32 cs_headerBytesChecked = 8;
|
static const U32 cs_headerBytesChecked = 8;
|
||||||
|
|
||||||
U8 header[cs_headerBytesChecked];
|
U8 header[cs_headerBytesChecked];
|
||||||
|
|
|
||||||
|
|
@ -228,6 +228,7 @@ is_15_bit_in_disguise:
|
||||||
|
|
||||||
static bool sReadTGA(Stream &stream, GBitmap *bitmap)
|
static bool sReadTGA(Stream &stream, GBitmap *bitmap)
|
||||||
{
|
{
|
||||||
|
PROFILE_SCOPE(sReadTGA);
|
||||||
struct Header
|
struct Header
|
||||||
{
|
{
|
||||||
U8 idLength; // length of the image_id string below.
|
U8 idLength; // length of the image_id string below.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue