From a2d098481d71122047c4eb8788d7c68f371efb5a Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Tue, 19 Jan 2016 20:14:27 +0100 Subject: [PATCH] Bug 1240708 - Various trivial coverity warning fixes (part 2). r=kats --- gfx/gl/GLContext.cpp | 4 +++- gfx/gl/GLContext.h | 1 - gfx/gl/GLLibraryEGL.cpp | 5 +++-- gfx/gl/GLLibraryLoader.cpp | 3 ++- gfx/gl/GLTextureImage.cpp | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index 56398101b1fc..6bf485c1bbb1 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -418,11 +418,14 @@ GLContext::GLContext(const SurfaceCaps& caps, mMaxCubeMapTextureSize(0), mMaxTextureImageSize(0), mMaxRenderbufferSize(0), + mMaxSamples(0), mNeedsTextureSizeChecks(false), mNeedsFlushBeforeDeleteFB(false), mWorkAroundDriverBugs(true), mHeavyGLCallsSinceLastFlush(false) { + mMaxViewportDims[0] = 0; + mMaxViewportDims[1] = 0; mOwningThreadId = PlatformThread::CurrentId(); } @@ -1739,7 +1742,6 @@ GLContext::InitWithPrefix(const char *prefix, bool trygl) mMaxTextureImageSize = mMaxTextureSize; - mMaxSamples = 0; if (IsSupported(GLFeature::framebuffer_multisample)) { fGetIntegerv(LOCAL_GL_MAX_SAMPLES, (GLint*)&mMaxSamples); } diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index 5c735986364f..f2ffc7b27e52 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -341,7 +341,6 @@ public: protected: bool mInitialized; bool mIsOffscreen; - bool mIsGlobalSharedContext; bool mContextLost; /** diff --git a/gfx/gl/GLLibraryEGL.cpp b/gfx/gl/GLLibraryEGL.cpp index 15cf58886dfc..585324a3b97d 100644 --- a/gfx/gl/GLLibraryEGL.cpp +++ b/gfx/gl/GLLibraryEGL.cpp @@ -8,6 +8,7 @@ #include "gfxUtils.h" #include "mozilla/Preferences.h" #include "mozilla/Assertions.h" +#include "mozilla/unused.h" #include "nsDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include "nsIGfxInfo.h" @@ -306,8 +307,8 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel) }; // Do not warn about the failure to load this - see bug 1092191 - GLLibraryLoader::LoadSymbols(mEGLLibrary, &optionalSymbols[0], nullptr, nullptr, - false); + Unused << GLLibraryLoader::LoadSymbols(mEGLLibrary, &optionalSymbols[0], + nullptr, nullptr, false); #if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 18 MOZ_RELEASE_ASSERT(mSymbols.fQueryStringImplementationANDROID, diff --git a/gfx/gl/GLLibraryLoader.cpp b/gfx/gl/GLLibraryLoader.cpp index a66bd372b167..1f0eeec2b84c 100644 --- a/gfx/gl/GLLibraryLoader.cpp +++ b/gfx/gl/GLLibraryLoader.cpp @@ -95,8 +95,9 @@ GLLibraryLoader::LoadSymbols(PRLibrary *lib, } if (*ss->symPointer == 0) { - if (warnOnFailure) + if (warnOnFailure) { printf_stderr("Can't find symbol '%s'.\n", ss->symNames[0]); + } failCount++; } diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index fa81ba30dd1d..6973231126e7 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -270,6 +270,7 @@ TextureImage::TextureImage(const gfx::IntSize& aSize, : mSize(aSize) , mWrapMode(aWrapMode) , mContentType(aContentType) + , mTextureFormat(gfx::SurfaceFormat::UNKNOWN) , mFilter(Filter::GOOD) , mFlags(aFlags) {} @@ -313,6 +314,7 @@ TiledTextureImage::TiledTextureImage(GLContext* aGL, : TextureImage(aSize, LOCAL_GL_CLAMP_TO_EDGE, aContentType, aFlags) , mCurrentImage(0) , mIterationCallback(nullptr) + , mIterationCallbackData(nullptr) , mInUpdate(false) , mRows(0) , mColumns(0)