From c1f9b0cf5868159ce49176bb7c9929c642e75aca Mon Sep 17 00:00:00 2001 From: ExMix Date: Tue, 18 Aug 2015 12:48:50 +0300 Subject: [drape, ios] fast textures. --- drape/texture.hpp | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'drape/texture.hpp') diff --git a/drape/texture.hpp b/drape/texture.hpp index 705bfcc96e..de60ec5add 100644 --- a/drape/texture.hpp +++ b/drape/texture.hpp @@ -3,6 +3,7 @@ #include "drape/pointers.hpp" #include "drape/glconstants.hpp" #include "drape/drape_global.hpp" +#include "drape/hw_texture.hpp" #include "geometry/rect2d.hpp" @@ -47,19 +48,17 @@ public: Texture(); virtual ~Texture(); - void Create(uint32_t width, uint32_t height, TextureFormat format); - void Create(uint32_t width, uint32_t height, TextureFormat format, ref_ptr data); - - void SetFilterParams(glConst minFilter, glConst magFilter); - void SetWrapMode(glConst sMode, glConst tMode); - - void UploadData(uint32_t x, uint32_t y, uint32_t width, uint32_t height, TextureFormat format, - ref_ptr data); - virtual ref_ptr FindResource(Key const & key, bool & newResource) = 0; virtual void UpdateState() {} virtual bool HasAsyncRoutines() const { return false; } + using Params = HWTexture::Params; + + void Create(Params const & params); + void Create(Params const & params, ref_ptr data); + + void UploadData(uint32_t x, uint32_t y, uint32_t width, uint32_t height, ref_ptr data); + TextureFormat GetFormat() const; uint32_t GetWidth() const; uint32_t GetHeight() const; @@ -72,16 +71,10 @@ public: protected: void Destroy(); + bool AllocateTexture(ref_ptr allocator); private: - void UnpackFormat(TextureFormat format, glConst & layout, glConst & pixelType); - int32_t GetID() const; - -private: - int32_t m_textureID; - uint32_t m_width; - uint32_t m_height; - TextureFormat m_format; + drape_ptr m_hwTexture; }; } // namespace dp -- cgit v1.2.3