Bug 1329044 - Avoid taking const references to fields behind accessors. r=jgilbert a=jcristau
authorkvark <kvark@mozilla.com>
Mon, 09 Jan 2017 10:16:00 -0500
changeset 353479 b1207646a147355d57b39255c48f635efbaba2eb
parent 353478 636a4707dc9322b275d2dcd724664077222822f2
child 353480 f3f71b2a62937c62d6d45f65be81d540c73ada4e
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, jcristau
bugs1329044
milestone52.0a2
Bug 1329044 - Avoid taking const references to fields behind accessors. r=jgilbert a=jcristau
dom/canvas/TexUnpackBlob.cpp
--- a/dom/canvas/TexUnpackBlob.cpp
+++ b/dom/canvas/TexUnpackBlob.cpp
@@ -292,17 +292,16 @@ TexUnpackBlob::TexUnpackBlob(const WebGL
 }
 
 bool
 TexUnpackBlob::ConvertIfNeeded(WebGLContext* webgl, const char* funcName,
                                const uint32_t rowLength, const uint32_t rowCount,
                                WebGLTexelFormat srcFormat,
                                const uint8_t* const srcBegin, const ptrdiff_t srcStride,
                                WebGLTexelFormat dstFormat, const ptrdiff_t dstStride,
-
                                const uint8_t** const out_begin,
                                UniqueBuffer* const out_anchoredBuffer) const
 {
     MOZ_ASSERT(srcFormat != WebGLTexelFormat::FormatNotSupportingAnyConversion);
     MOZ_ASSERT(dstFormat != WebGLTexelFormat::FormatNotSupportingAnyConversion);
 
     *out_begin = srcBegin;
 
@@ -568,17 +567,17 @@ TexUnpackImage::~TexUnpackImage()
 
 bool
 TexUnpackImage::Validate(WebGLContext* webgl, const char* funcName,
                          const webgl::PackingInfo& pi)
 {
     if (!ValidatePIForDOM(webgl, funcName, pi))
         return false;
 
-    const auto& fullRows = mImage->GetSize().height;
+    const auto fullRows = mImage->GetSize().height;
     return ValidateUnpackPixels(webgl, funcName, fullRows, 0, this);
 }
 
 bool
 TexUnpackImage::TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName,
                               WebGLTexture* tex, TexImageTarget target, GLint level,
                               const webgl::DriverUnpackInfo* dui, GLint xOffset,
                               GLint yOffset, GLint zOffset, GLenum* const out_error) const
@@ -734,33 +733,33 @@ GetFormatForSurf(gfx::SourceSurface* sur
 
 bool
 TexUnpackSurface::Validate(WebGLContext* webgl, const char* funcName,
                            const webgl::PackingInfo& pi)
 {
     if (!ValidatePIForDOM(webgl, funcName, pi))
         return false;
 
-    const auto& fullRows = mSurf->GetSize().height;
+    const auto fullRows = mSurf->GetSize().height;
     return ValidateUnpackPixels(webgl, funcName, fullRows, 0, this);
 }
 
 bool
 TexUnpackSurface::TexOrSubImage(bool isSubImage, bool needsRespec, const char* funcName,
                                 WebGLTexture* tex, TexImageTarget target, GLint level,
                                 const webgl::DriverUnpackInfo* dstDUI, GLint xOffset,
                                 GLint yOffset, GLint zOffset,
                                 GLenum* const out_error) const
 {
     const auto& webgl = tex->mContext;
 
     ////
 
-    const auto& rowLength = mSurf->GetSize().width;
-    const auto& rowCount = mSurf->GetSize().height;
+    const auto rowLength = mSurf->GetSize().width;
+    const auto rowCount = mSurf->GetSize().height;
 
     const auto& dstPI = dstDUI->ToPacking();
     const auto& dstBPP = webgl::BytesPerPixel(dstPI);
     const auto dstFormat = FormatForPackingInfo(dstPI);
 
     ////
 
     WebGLTexelFormat srcFormat;