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 359336 95d20a617288dde9faff91e847d414bb3403c157
parent 359335 f075eb03fc049a2c0a8e0995575c007a7847bd9e
child 359337 6e945963ef7b6b04b33ae6763cde3bde23949809
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, jcristau
bugs1329044
milestone51.0
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;