Fix ScopedCopyTex* and fix build error on Mac.
draft
Fix ScopedCopyTex* and fix build error on Mac.
--- a/dom/canvas/WebGLContextDraw.cpp
+++ b/dom/canvas/WebGLContextDraw.cpp
@@ -24,18 +24,18 @@ namespace mozilla {
static const int MAX_DRAW_CALLS_SINCE_FLUSH = 100;
////////////////////////////////////////
class ScopedResolveTexturesForDraw
{
struct TexRebindRequest
{
- const uint32_t texUnit;
- WebGLTexture* const tex;
+ uint32_t texUnit;
+ WebGLTexture* tex;
};
WebGLContext* const mWebGL;
std::vector<TexRebindRequest> mRebindRequests;
public:
ScopedResolveTexturesForDraw(WebGLContext* webgl, const char* funcName,
bool* const out_error);
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -1664,16 +1664,22 @@ template<typename T>
static inline GLenum
ToGLHandle(const T& obj)
{
return (obj ? obj->mGLName : 0);
}
ScopedCopyTexImageSource::~ScopedCopyTexImageSource()
{
+ if (!mFB) {
+ MOZ_ASSERT(!mRB);
+ return;
+ }
+ MOZ_ASSERT(mRB);
+
gl::GLContext* gl = mWebGL->gl;
// If we're swizzling, it's because we're on a GL core (3.2+) profile, which has
// split framebuffer support.
gl->fBindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER,
ToGLHandle(mWebGL->mBoundDrawFramebuffer));
gl->fBindFramebuffer(LOCAL_GL_READ_FRAMEBUFFER,
ToGLHandle(mWebGL->mBoundReadFramebuffer));