Fixes from Try.
draft
Fixes from Try.
--- a/dom/canvas/WebGL2ContextFramebuffers.cpp
+++ b/dom/canvas/WebGL2ContextFramebuffers.cpp
@@ -156,17 +156,19 @@ WebGL2Context::BlitFramebuffer(GLint src
} else {
dstSamples = gl->Screen()->Samples();
GetBackbufferFormats(mOptions, &dstColorFormat, &dstDepthFormat,
&dstStencilFormat);
}
if (mask & LOCAL_GL_COLOR_BUFFER_BIT) {
- const auto fnSignlessType = [](const webgl::FormatInfo* format) {
+ const auto fnSignlessType = [](const webgl::FormatInfo* format)
+ -> webgl::ComponentType
+ {
if (!format)
return webgl::ComponentType::None;
switch (format->componentType) {
case webgl::ComponentType::UInt:
return webgl::ComponentType::Int;
case webgl::ComponentType::NormUInt:
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -1690,17 +1690,21 @@ public:
UniqueBuffer()
: mBuffer(nullptr)
{ }
explicit UniqueBuffer(void* buffer)
: mBuffer(buffer)
{ }
- explicit UniqueBuffer(UniqueBuffer&& other) {
+ ~UniqueBuffer() {
+ free(mBuffer);
+ }
+
+ UniqueBuffer(UniqueBuffer&& other) {
this->mBuffer = other.mBuffer;
other.mBuffer = nullptr;
}
UniqueBuffer& operator =(UniqueBuffer&& other) {
free(this->mBuffer);
this->mBuffer = other.mBuffer;
other.mBuffer = nullptr;
--- a/dom/canvas/WebGLFormats.h
+++ b/dom/canvas/WebGLFormats.h
@@ -242,17 +242,17 @@ struct FormatUsageInfo
{
const FormatInfo* const format;
bool isRenderable;
bool isFilterable;
std::map<PackingInfo, DriverUnpackInfo> validUnpacks;
const DriverUnpackInfo* idealUnpack;
//const GLint* textureSwizzleRGBA;
- FormatUsageInfo(const FormatInfo* _format)
+ explicit FormatUsageInfo(const FormatInfo* _format)
: format(_format)
, isRenderable(false)
, isFilterable(false)
, idealUnpack(nullptr)
{ }
void AddUnpack(const PackingInfo& key, const DriverUnpackInfo& value);
bool IsUnpackValid(const PackingInfo& key,
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -1171,17 +1171,17 @@ WebGLTexture::TexImage(const char* funcN
funcName, dstFormat->name);
return;
}
}
////////////////////////////////////
// Do the thing!
- mContext->gl->MakeCurrent();
+ MOZ_ALWAYS_TRUE( mContext->gl->MakeCurrent() );
// It's tempting to do allocation first, and TexSubImage second, but this is generally
// slower.
const bool isSubImage = false;
const GLint xOffset = 0;
const GLint yOffset = 0;
const GLint zOffset = 0;
--- a/gfx/gl/ScopedGLHelpers.h
+++ b/gfx/gl/ScopedGLHelpers.h
@@ -40,16 +40,17 @@ protected:
virtual ~ScopedGLWrapper() {
if (!mIsUnwrapped)
Unwrap();
}
public:
void Unwrap() {
MOZ_ASSERT(!mIsUnwrapped);
+ MOZ_ASSERT(IsContextCurrent(mGL));
Derived* derived = static_cast<Derived*>(this);
derived->UnwrapImpl();
mIsUnwrapped = true;
}
};