Only cache processed textures

This commit is contained in:
Zach Pomerantz 2016-03-08 13:31:23 -08:00
parent 925ea8bcda
commit 883d4ba006
2 changed files with 4 additions and 0 deletions

View file

@ -344,6 +344,7 @@ void NetworkTexture::setImage(const QImage& image, void* voidTexture, int origin
_width = _height = 0; _width = _height = 0;
} }
_isCacheable = true;
finishedLoading(true); finishedLoading(true);
emit networkTextureCreated(qWeakPointerCast<NetworkTexture, Resource> (_self)); emit networkTextureCreated(qWeakPointerCast<NetworkTexture, Resource> (_self));

View file

@ -132,6 +132,8 @@ signals:
protected: protected:
virtual bool isCacheable() const override { return _isCacheable; }
virtual void downloadFinished(const QByteArray& data) override; virtual void downloadFinished(const QByteArray& data) override;
Q_INVOKABLE void loadContent(const QByteArray& content); Q_INVOKABLE void loadContent(const QByteArray& content);
@ -146,6 +148,7 @@ private:
int _originalHeight { 0 }; int _originalHeight { 0 };
int _width { 0 }; int _width { 0 };
int _height { 0 }; int _height { 0 };
bool _isCacheable { false };
}; };
#endif // hifi_TextureCache_h #endif // hifi_TextureCache_h