From: David Steele Date: Fri, 28 Oct 2022 09:09:44 +0000 (+0100) Subject: Fix static analysis bug in GLES::Context X-Git-Tag: dali_2.2.0~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0231b1cb39eeae17854dd08944e0c0a87d5be346;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Fix static analysis bug in GLES::Context Change-Id: I1fcfedbde1531650bf0916e88be9f79f0836ee09 --- diff --git a/dali/internal/graphics/gles-impl/gles-context.cpp b/dali/internal/graphics/gles-impl/gles-context.cpp index 2f2d617..1d981bc 100644 --- a/dali/internal/graphics/gles-impl/gles-context.cpp +++ b/dali/internal/graphics/gles-impl/gles-context.cpp @@ -17,6 +17,7 @@ #include "gles-context.h" #include +#include #include #include #include @@ -257,6 +258,13 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES:: newProgram = static_cast(mImpl->mNewPipeline->GetCreateInfo().programState->program); } + if(!currentProgram && !newProgram) + { + // Early out if we have no program for this pipeline. + DALI_LOG_ERROR("No program defined for pipeline\n"); + return; + } + if(mImpl->mNewPipeline && mImpl->mCurrentPipeline != mImpl->mNewPipeline) { if(!currentProgram || currentProgram->GetImplementation()->GetGlProgram() != newProgram->GetImplementation()->GetGlProgram()) @@ -287,7 +295,7 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES:: { // Attempt to reinitialize // @todo need to put this somewhere else where it isn't const. - // Maybe post it bac/k on end of initialize queue if initialization fails? + // Maybe post it back on end of initialize queue if initialization fails? texture->InitializeResource(); } @@ -359,7 +367,6 @@ void Context::Flush(bool reset, const GLES::DrawCallDescriptor& drawCall, GLES:: mImpl->FlushVertexAttributeLocations(); } - //@todo Wait if textures need syncing gl.DrawArrays(GLESTopology(ia->topology), drawCall.draw.firstVertex, drawCall.draw.vertexCount);