From 327514dcc366c09fa10fe9d04e2e3e3c7c8c18bf Mon Sep 17 00:00:00 2001 From: ExMix Date: Thu, 11 Dec 2014 12:02:43 +0300 Subject: [PATCH] [drape] not hardcoded texture filtration using --- drape/dynamic_texture.hpp | 2 +- drape/stipple_pen_resource.cpp | 10 ++++++++++ drape/stipple_pen_resource.hpp | 2 ++ drape/texture_of_colors.cpp | 10 ++++++++++ drape/texture_of_colors.hpp | 2 ++ 5 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drape/dynamic_texture.hpp b/drape/dynamic_texture.hpp index 60bd4ad6b2..7dcd12f477 100644 --- a/drape/dynamic_texture.hpp +++ b/drape/dynamic_texture.hpp @@ -13,7 +13,7 @@ public: : m_indexer(size) { Create(size.x, size.y, format); - SetFilterParams(gl_const::GLNearest, gl_const::GLNearest); + SetFilterParams(m_indexer.GetMinFilter(), m_indexer.GetMagFilter()); } virtual ResourceInfo const * FindResource(Key const & key) const diff --git a/drape/stipple_pen_resource.cpp b/drape/stipple_pen_resource.cpp index 3ec2a980e0..36a2e4d391 100644 --- a/drape/stipple_pen_resource.cpp +++ b/drape/stipple_pen_resource.cpp @@ -231,6 +231,16 @@ void StipplePenIndex::UploadResources(RefPointer texture) m_pendingNodes.clear(); } +glConst StipplePenIndex::GetMinFilter() const +{ + return gl_const::GLNearest; +} + +glConst StipplePenIndex::GetMagFilter() const +{ + return gl_const::GLNearest; +} + string DebugPrint(StipplePenHandle const & key) { ostringstream out; diff --git a/drape/stipple_pen_resource.hpp b/drape/stipple_pen_resource.hpp index bb585bbdf2..094542325f 100644 --- a/drape/stipple_pen_resource.hpp +++ b/drape/stipple_pen_resource.hpp @@ -101,6 +101,8 @@ public: StipplePenIndex(m2::PointU const & canvasSize) : m_packer(canvasSize) {} StipplePenResourceInfo const * MapResource(StipplePenKey const & key); void UploadResources(RefPointer texture); + glConst GetMinFilter() const; + glConst GetMagFilter() const; private: typedef MasterPointer TResourcePtr; diff --git a/drape/texture_of_colors.cpp b/drape/texture_of_colors.cpp index b837db0d28..cfa2458e8b 100644 --- a/drape/texture_of_colors.cpp +++ b/drape/texture_of_colors.cpp @@ -141,6 +141,16 @@ void ColorPalette::UploadResources(RefPointer texture) m_pendingNodes.clear(); } +glConst ColorPalette::GetMinFilter() const +{ + return gl_const::GLNearest; +} + +glConst ColorPalette::GetMagFilter() const +{ + return gl_const::GLNearest; +} + void ColorPalette::MoveCursor() { m_cursor.x += RESOURCE_SIZE; diff --git a/drape/texture_of_colors.hpp b/drape/texture_of_colors.hpp index 5100239d1e..80e6d2b574 100644 --- a/drape/texture_of_colors.hpp +++ b/drape/texture_of_colors.hpp @@ -31,6 +31,8 @@ public: ~ColorPalette(); ColorResourceInfo const * MapResource(ColorKey const & key); void UploadResources(RefPointer texture); + glConst GetMinFilter() const; + glConst GetMagFilter() const; void SetIsDebug(bool isDebug) { m_isDebug = isDebug; }