Browse Source

adds profiling to the various gbitmap loaders*
*note, DDS bypasses the gbitmap method chain in question.

Azaezel 8 years ago
parent
commit
66c7173fda

+ 1 - 0
Engine/source/gfx/bitmap/gBitmap.cpp

@@ -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 )

+ 3 - 0
Engine/source/gfx/bitmap/gBitmap.h

@@ -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;

+ 1 - 0
Engine/source/gfx/bitmap/loaders/bitmapBmp.cpp

@@ -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];

+ 1 - 0
Engine/source/gfx/bitmap/loaders/bitmapGif.cpp

@@ -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;

+ 1 - 0
Engine/source/gfx/bitmap/loaders/bitmapJpeg.cpp

@@ -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;
 
 

+ 1 - 0
Engine/source/gfx/bitmap/loaders/bitmapMng.cpp

@@ -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));
 
 

+ 1 - 0
Engine/source/gfx/bitmap/loaders/bitmapPng.cpp

@@ -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];

+ 1 - 0
Engine/source/gfx/bitmap/loaders/bitmapTga.cpp

@@ -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.