diff --git a/cocos/renderer/CCGLProgramState.cpp b/cocos/renderer/CCGLProgramState.cpp index 7b1b4d5f65..e4e7fa5226 100644 --- a/cocos/renderer/CCGLProgramState.cpp +++ b/cocos/renderer/CCGLProgramState.cpp @@ -281,17 +281,11 @@ GLProgramState::GLProgramState() #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) // listen the event when app go to foreground CCLOG("create _backToForegroundlistener for GLProgramState"); - _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, CC_CALLBACK_1(GLProgramState::setProgramStateDirty, this)); + _backToForegroundlistener = EventListenerCustom::create(EVENT_COME_TO_FOREGROUND, [this](EventCustom*) { _uniformAttributeValueDirty = true; }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundlistener, -1); #endif } -void GLProgramState::setProgramStateDirty(EventCustom *event) -{ - CCLOG("GLProgramState to background---------"); - _uniformAttributeValueDirty = true; -} - GLProgramState::~GLProgramState() { CC_SAFE_RELEASE(_glprogram); diff --git a/cocos/renderer/CCGLProgramState.h b/cocos/renderer/CCGLProgramState.h index f2b5d4000b..019cd95222 100644 --- a/cocos/renderer/CCGLProgramState.h +++ b/cocos/renderer/CCGLProgramState.h @@ -185,7 +185,6 @@ protected: ~GLProgramState(); bool init(GLProgram* program); void resetGLProgram(); - void setProgramStateDirty(EventCustom* event); VertexAttribValue* getVertexAttribValue(const std::string &attributeName); UniformValue* getUniformValue(const std::string &uniformName);