Bug 1446412 - Forbid implicit construction of WebGLFBAttachPoint. - r=kvark
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 28 Mar 2018 17:16:23 -0700
changeset 410759 4a9e0098d23b7faa6203cdf548d3d35889c1b677
parent 410758 4ffac3c10aa55ac06a6681f3747966f4ddbcc482
child 410760 9b4b4e4924b31d2c408c6e65f30775babd31a99f
push id33736
push usershindli@mozilla.com
push dateFri, 30 Mar 2018 09:56:41 +0000
treeherdermozilla-central@b7fa9d95150e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1446412
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1446412 - Forbid implicit construction of WebGLFBAttachPoint. - r=kvark MozReview-Commit-ID: AM7xfXwJxkV
dom/canvas/WebGLContextState.cpp
dom/canvas/WebGLFramebuffer.h
--- a/dom/canvas/WebGLContextState.cpp
+++ b/dom/canvas/WebGLContextState.cpp
@@ -314,17 +314,17 @@ WebGLContext::GetParameter(JSContext* cx
         case LOCAL_GL_GREEN_BITS:
         case LOCAL_GL_BLUE_BITS:
         case LOCAL_GL_ALPHA_BITS:
         case LOCAL_GL_DEPTH_BITS:
         case LOCAL_GL_STENCIL_BITS: {
             const auto format = [&]() -> const webgl::FormatInfo* {
                 if (mBoundDrawFramebuffer) {
                     const auto& fb = *mBoundDrawFramebuffer;
-                    const auto& attachment = [&]() {
+                    const auto& attachment = [&]() -> const auto& {
                         switch (pname) {
                         case LOCAL_GL_DEPTH_BITS:
                             return fb.AnyDepthAttachment();
 
                         case LOCAL_GL_STENCIL_BITS:
                             return fb.AnyStencilAttachment();
 
                         default:
--- a/dom/canvas/WebGLFramebuffer.h
+++ b/dom/canvas/WebGLFramebuffer.h
@@ -33,27 +33,28 @@ namespace gl {
 
 class WebGLFBAttachPoint final
 {
     friend class WebGLFramebuffer;
 public:
     WebGLFramebuffer* const mFB;
     const GLenum mAttachmentPoint;
 
-protected:
+private:
     WebGLRefPtr<WebGLTexture> mTexturePtr;
     WebGLRefPtr<WebGLRenderbuffer> mRenderbufferPtr;
     TexImageTarget mTexImageTarget;
     GLint mTexImageLayer;
     uint32_t mTexImageLevel;
 
     ////
 
     WebGLFBAttachPoint();
     WebGLFBAttachPoint(WebGLFramebuffer* fb, GLenum attachmentPoint);
+    explicit WebGLFBAttachPoint(WebGLFBAttachPoint&) = default; // Make this private.
 
 public:
     ~WebGLFBAttachPoint();
 
     ////
 
     void Unlink();