adds profiling to the various gbitmap loaders*

*note, DDS bypasses the gbitmap method chain in question.
This commit is contained in:
Azaezel 2017-04-10 21:43:38 -05:00
parent 513789c2c7
commit f889aebcea
8 changed files with 10 additions and 0 deletions

View file

@ -1057,6 +1057,7 @@ bool GBitmap::write(Stream& io_rStream) const
bool GBitmap::readBitmap( const String &bmType, Stream &ioStream )
{
PROFILE_SCOPE(ResourceGBitmap_readBitmap);
const GBitmap::Registration *regInfo = GBitmap::sFindRegInfo( bmType );
if ( regInfo == NULL )

View file

@ -39,6 +39,9 @@
#include "gfx/gfxEnums.h" // For the format
#endif
#ifndef _PROFILER_H_
#include "platform/profiler.h"
#endif
//-------------------------------------- Forward decls.
class Stream;
class RectI;

View file

@ -92,6 +92,7 @@ struct BITMAPINFOHEADER
static bool sReadBMP(Stream &stream, GBitmap *bitmap)
{
PROFILE_SCOPE(sReadBMP);
BITMAPINFOHEADER bi;
BITMAPFILEHEADER bf;
RGBQUAD rgb[256];

View file

@ -86,6 +86,7 @@ static S32 gifWriteDataFn(GifFileType *gifinfo, GifByteType *data, S32 length)
//--------------------------------------
static bool sReadGIF( Stream &stream, GBitmap *bitmap )
{
PROFILE_SCOPE(sReadGIF);
GifFileType *gifinfo = DGifOpen( (void*)&stream, gifReadDataFn);
if (!gifinfo)
return false;

View file

@ -97,6 +97,7 @@ static S32 jpegErrorFn(void *client_data)
//--------------------------------------
static bool sReadJPG(Stream &stream, GBitmap *bitmap)
{
PROFILE_SCOPE(sReadJPG);
JFREAD = jpegReadDataFn;
JFERROR = jpegErrorFn;

View file

@ -206,6 +206,7 @@ static mng_bool mngFatalErrorFn(mng_handle mng, mng_int32 code, mng_int8 severit
static bool sReadMNG(Stream &stream, GBitmap *bitmap)
{
PROFILE_SCOPE(sReadMNG);
mngstuff mnginfo;
dMemset(&mnginfo, 0, sizeof(mngstuff));

View file

@ -136,6 +136,7 @@ static void pngWarningFn(png_structp, png_const_charp /*pMessage*/)
//--------------------------------------
static bool sReadPNG(Stream &stream, GBitmap *bitmap)
{
PROFILE_SCOPE(sReadPNG);
static const U32 cs_headerBytesChecked = 8;
U8 header[cs_headerBytesChecked];

View file

@ -228,6 +228,7 @@ is_15_bit_in_disguise:
static bool sReadTGA(Stream &stream, GBitmap *bitmap)
{
PROFILE_SCOPE(sReadTGA);
struct Header
{
U8 idLength; // length of the image_id string below.