From 70c067fc30c0c17fa3e4dabafb17a093d1d8167f Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Sat, 24 Jun 2017 12:03:11 +0300 Subject: Fixed race in texture manager --- drape/texture.hpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'drape/texture.hpp') diff --git a/drape/texture.hpp b/drape/texture.hpp index 41d6f92478..d5081f644e 100644 --- a/drape/texture.hpp +++ b/drape/texture.hpp @@ -7,6 +7,8 @@ #include "geometry/rect2d.hpp" +#include "base/macros.hpp" + #include "std/cstdint.hpp" #include "std/function.hpp" @@ -52,23 +54,21 @@ public: virtual bool HasEnoughSpace(uint32_t /*newKeysCount*/) const { return true; } 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); - virtual TextureFormat GetFormat() const; virtual uint32_t GetWidth() const; virtual uint32_t GetHeight() const; + virtual float GetS(uint32_t x) const; + virtual float GetT(uint32_t y) const; + virtual uint32_t GetID() const; - float GetS(uint32_t x) const; - float GetT(uint32_t y) const; - uint32_t GetID() const; - - void Bind() const; + virtual void Bind() const; // Texture must be bound before calling this method. - void SetFilter(glConst filter); + virtual void SetFilter(glConst filter); + + 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); static uint32_t GetMaxTextureSize(); @@ -77,5 +77,7 @@ protected: bool AllocateTexture(ref_ptr allocator); drape_ptr m_hwTexture; + + DISALLOW_COPY_AND_MOVE(Texture); }; } // namespace dp -- cgit v1.2.3