Skip to content

Commit

Permalink
TextureCacheJob: Inline CBaseTexture::LoadFromFile
Browse files Browse the repository at this point in the history
  • Loading branch information
popcornmix committed Apr 3, 2020
1 parent 1dd9016 commit a73826c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xbmc/TextureCacheJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ bool CTextureCacheJob::CacheTexture(CBaseTexture **out_texture)
if (!(!(file.IsPicture() && !(file.IsZIP() || file.IsRAR() || file.IsCBR() || file.IsCBZ() ))
&& !StringUtils::StartsWithNoCase(file.GetMimeType(), "image/") && !StringUtils::EqualsNoCase(file.GetMimeType(), "application/octet-stream"))) // ignore non-pictures
{
texture = CBaseTexture::LoadFromFile(image, width, height, true, file.GetMimeType());
texture = new CTexture();
if (!(texture->LoadFromFileInternal(image, width, height, true, file.GetMimeType())))
{
delete texture;
texture = nullptr;
}
if (texture)
{
// EXIF bits are interpreted as: <flipXY><flipY*flipX><flipX>
Expand Down
2 changes: 2 additions & 0 deletions xbmc/guilib/Texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ class CBaseTexture
protected:
bool LoadFromFileInMem(unsigned char* buffer, size_t size, const std::string& mimeType,
unsigned int maxWidth, unsigned int maxHeight);
public:
bool LoadFromFileInternal(const std::string& texturePath, unsigned int maxWidth, unsigned int maxHeight, bool requirePixels, const std::string& strMimeType = "");
protected:
bool LoadIImage(IImage* pImage, unsigned char* buffer, unsigned int bufSize, unsigned int width, unsigned int height);
// helpers for computation of texture parameters for compressed textures
unsigned int GetPitch(unsigned int width) const;
Expand Down

0 comments on commit a73826c

Please sign in to comment.