diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-08-03 13:16:59 +0300 |
---|---|---|
committer | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2018-08-06 14:09:53 +0300 |
commit | 704fd74d8d709f643d38266e1b484c16a441fb8b (patch) | |
tree | 09b594294973956482178ec173f27d899112ecd8 /drape/hw_texture_ios.mm | |
parent | c43305029839d5c7c9ab2eeed370e56bd777cc41 (diff) |
Removed glConst from render state and texture
Diffstat (limited to 'drape/hw_texture_ios.mm')
-rw-r--r-- | drape/hw_texture_ios.mm | 30 |
1 files changed, 15 insertions, 15 deletions
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 <QuartzCore/CAEAGLLayer.h> #import <Foundation/NSDictionary.h> @@ -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<void> 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 |