From 8aee15f7c089bae332c3acd2095b510937ca891e Mon Sep 17 00:00:00 2001 From: halx99 Date: Sat, 15 Feb 2020 03:10:01 +0800 Subject: [PATCH] fix ci error --- cocos/renderer/backend/metal/TextureMTL.h | 6 +++--- cocos/renderer/backend/opengl/TextureGL.cpp | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cocos/renderer/backend/metal/TextureMTL.h b/cocos/renderer/backend/metal/TextureMTL.h index 9fa85e9571..02c793631d 100644 --- a/cocos/renderer/backend/metal/TextureMTL.h +++ b/cocos/renderer/backend/metal/TextureMTL.h @@ -53,7 +53,7 @@ struct TextureInfoMTL id ensure(int index, int target); void destroy(); - id createTexture(id mtlDevice, const TextureDescriptor& descriptor, int target) + id createTexture(id mtlDevice, const TextureDescriptor& descriptor, int target); void recreateSampler(const SamplerDescriptor &descriptor); MTLSamplerAddressMode _sAddressMode; @@ -165,7 +165,7 @@ public: * Get MTLSamplerState object * @return A MTLSamplerState object. */ - inline id getMTLSamplerState() const { return _mtlSamplerState; } + inline id getMTLSamplerState() const { return _textureInfo._mtlSamplerState; } private: @@ -230,7 +230,7 @@ public: * Get MTLSamplerState object * @return A MTLSamplerState object. */ - inline id getMTLSamplerState() const { return _mtlSamplerState; } + inline id getMTLSamplerState() const { return _textureInfo._mtlSamplerState; } private: diff --git a/cocos/renderer/backend/opengl/TextureGL.cpp b/cocos/renderer/backend/opengl/TextureGL.cpp index df188c60b3..9b7052e9be 100644 --- a/cocos/renderer/backend/opengl/TextureGL.cpp +++ b/cocos/renderer/backend/opengl/TextureGL.cpp @@ -121,8 +121,9 @@ Texture2DGL::Texture2DGL(const TextureDescriptor& descriptor) #if CC_ENABLE_CACHE_TEXTURE_DATA // Listen this event to restored texture id after coming to foreground on Android. _backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*){ - glGenTextures(1, &(this->_textureInfo.textures[0])); - _textureInfo.setTexParameters(GL_TEXTURE_2D); + glGenTextures(1, &(_textureInfo.textures[0])); + _textureInfo.apply(0); + _textureInfo.setCurrentTexParameters(GL_TEXTURE_2D); // this->initWithZeros(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); @@ -340,8 +341,9 @@ TextureCubeGL::TextureCubeGL(const TextureDescriptor& descriptor) #if CC_ENABLE_CACHE_TEXTURE_DATA // Listen this event to restored texture id after coming to foreground on Android. _backToForegroundListener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*){ - glGenTextures(1, &(this->_textureInfo.textures[0])); - _textureInfo.setTexParameters(GL_TEXTURE_CUBE_MAP); + glGenTextures(1, &(_textureInfo.textures[0])); + _textureInfo.apply(0); + _textureInfo.setCurrentTexParameters(GL_TEXTURE_CUBE_MAP); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); #endif