From 704fd74d8d709f643d38266e1b484c16a441fb8b Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Fri, 3 Aug 2018 13:16:59 +0300 Subject: Removed glConst from render state and texture --- drape/hw_texture_ios.mm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'drape/hw_texture_ios.mm') diff --git a/drape/hw_texture_ios.mm b/drape/hw_texture_ios.mm index 68ac455b97..9f7a9f3cc1 100644 --- a/drape/hw_texture_ios.mm +++ b/drape/hw_texture_ios.mm @@ -1,10 +1,9 @@ -#include "hw_texture_ios.hpp" - -#include "base/logging.hpp" - +#include "drape/hw_texture_ios.hpp" #include "drape/glfunctions.hpp" #include "drape/glIncludes.hpp" +#include "base/logging.hpp" + #import #import @@ -37,7 +36,6 @@ using boost::gil::copy_pixels; namespace dp { - HWTextureAllocatorApple::HWTextureAllocatorApple() { CVReturn cvRetval = CVOpenGLESTextureCacheCreate(kCFAllocatorDefault, nullptr, @@ -52,7 +50,8 @@ HWTextureAllocatorApple::~HWTextureAllocatorApple() CFRelease(m_textureCache); } -CVPixelBufferRef HWTextureAllocatorApple::CVCreatePixelBuffer(uint32_t width, uint32_t height, int format) +CVPixelBufferRef HWTextureAllocatorApple::CVCreatePixelBuffer(uint32_t width, uint32_t height, + dp::TextureFormat format) { NSDictionary * attrs = [NSDictionary dictionaryWithObjectsAndKeys: [NSDictionary dictionary], kCVPixelBufferIOSurfacePropertiesKey, @@ -66,10 +65,11 @@ CVPixelBufferRef HWTextureAllocatorApple::CVCreatePixelBuffer(uint32_t width, ui CVReturn cvRetval = 0; switch (format) { - case dp::RGBA8: - cvRetval = CVPixelBufferCreate(kCFAllocatorDefault, width, height, kCVPixelFormatType_32BGRA, attrsRef, &result); + case dp::TextureFormat::RGBA8: + cvRetval = CVPixelBufferCreate(kCFAllocatorDefault, width, height, kCVPixelFormatType_32BGRA, + attrsRef, &result); break; - case dp::ALPHA: + case dp::TextureFormat::Alpha: cvRetval = CVPixelBufferCreate(kCFAllocatorDefault, width, height, kCVPixelFormatType_OneComponent8, attrsRef, &result); break; @@ -156,10 +156,11 @@ void HWTextureApple::Create(Params const & params, ref_ptr data) m_textureID = CVOpenGLESTextureGetName(m_texture); GLFunctions::glBindTexture(m_textureID); - GLFunctions::glTexParameter(gl_const::GLMinFilter, params.m_filter); - GLFunctions::glTexParameter(gl_const::GLMagFilter, params.m_filter); - GLFunctions::glTexParameter(gl_const::GLWrapS, params.m_wrapSMode); - GLFunctions::glTexParameter(gl_const::GLWrapT, params.m_wrapTMode); + auto const f = DecodeTextureFilter(params.m_filter); + GLFunctions::glTexParameter(gl_const::GLMinFilter, f); + GLFunctions::glTexParameter(gl_const::GLMagFilter, f); + GLFunctions::glTexParameter(gl_const::GLWrapS, DecodeTextureWrapping(params.m_wrapSMode)); + GLFunctions::glTexParameter(gl_const::GLWrapT, DecodeTextureWrapping(params.m_wrapTMode)); if (data == nullptr) return; @@ -211,5 +212,4 @@ void HWTextureApple::Unlock() CHECK_EQUAL(CVPixelBufferUnlockBaseAddress(m_directBuffer, 0), kCVReturnSuccess, ()); m_allocator->RiseFlushFlag(); } - -} +} // namespace dp -- cgit v1.2.3