Bug 911848 - WebGLBuffer's mByteLength should be a WebGLsizeiptr - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 04 Sep 2013 08:14:35 -0400
changeset 145415 e7486d3f5ce818916127b6a92fee5ac20f0be6a4
parent 145414 5a5948b148fc6d35637fec9a4fa72f9b81f15497
child 145416 49daf6b00b8f3026a649e7225b1c9d6128bb9c58
push id33280
push userbjacob@mozilla.com
push dateWed, 04 Sep 2013 15:29:51 +0000
treeherdermozilla-inbound@36aacf27a24e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs911848
milestone26.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 911848 - WebGLBuffer's mByteLength should be a WebGLsizeiptr - r=jgilbert
content/canvas/src/WebGLBuffer.h
content/canvas/src/WebGLContextBuffers.cpp
--- a/content/canvas/src/WebGLBuffer.h
+++ b/content/canvas/src/WebGLBuffer.h
@@ -35,20 +35,20 @@ public:
     size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
         size_t sizeOfCache = mCache ? mCache->SizeOfIncludingThis(aMallocSizeOf) : 0;
         return aMallocSizeOf(this) + sizeOfCache;
     }
 
     bool HasEverBeenBound() { return mHasEverBeenBound; }
     void SetHasEverBeenBound(bool x) { mHasEverBeenBound = x; }
     GLuint GLName() const { return mGLName; }
-    GLuint ByteLength() const { return mByteLength; }
+    WebGLsizeiptr ByteLength() const { return mByteLength; }
     GLenum Target() const { return mTarget; }
 
-    void SetByteLength(GLuint byteLength) { mByteLength = byteLength; }
+    void SetByteLength(WebGLsizeiptr byteLength) { mByteLength = byteLength; }
 
     void SetTarget(GLenum target);
 
     bool ElementArrayCacheBufferData(const void* ptr, size_t buffer_size_in_bytes);
 
     void ElementArrayCacheBufferSubData(size_t pos, const void* ptr, size_t update_size_in_bytes);
 
     bool Validate(WebGLenum type, uint32_t max_allowed, size_t first, size_t count) {
@@ -64,15 +64,15 @@ public:
 
     NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLBuffer)
     NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLBuffer)
 
 protected:
 
     WebGLuint mGLName;
     bool mHasEverBeenBound;
-    GLuint mByteLength;
+    WebGLsizeiptr mByteLength;
     GLenum mTarget;
 
     nsAutoPtr<WebGLElementArrayCache> mCache;
 };
 }
 #endif //WEBGLBUFFER_H_
--- a/content/canvas/src/WebGLContextBuffers.cpp
+++ b/content/canvas/src/WebGLContextBuffers.cpp
@@ -276,17 +276,17 @@ WebGLContext::BufferSubData(GLenum targe
     if (byteOffset < 0)
         return ErrorInvalidValue("bufferSubData: negative offset");
 
     WebGLBuffer* boundBuffer = bufferSlot->get();
 
     if (!boundBuffer)
         return ErrorInvalidOperation("bufferData: no buffer bound!");
 
-    CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + data.Length();
+    CheckedInt<WebGLsizeiptr> checked_neededByteLength = CheckedInt<WebGLsizeiptr>(byteOffset) + data.Length();
     if (!checked_neededByteLength.isValid())
         return ErrorInvalidValue("bufferSubData: integer overflow computing the needed byte length");
 
     if (checked_neededByteLength.value() > boundBuffer->ByteLength())
         return ErrorInvalidValue("bufferSubData: not enough data - operation requires %d bytes, but buffer only has %d bytes",
                                  checked_neededByteLength.value(), boundBuffer->ByteLength());
 
     MakeContextCurrent();
@@ -312,17 +312,17 @@ WebGLContext::BufferSubData(WebGLenum ta
     if (byteOffset < 0)
         return ErrorInvalidValue("bufferSubData: negative offset");
 
     WebGLBuffer* boundBuffer = bufferSlot->get();
 
     if (!boundBuffer)
         return ErrorInvalidOperation("bufferSubData: no buffer bound!");
 
-    CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + data.Length();
+    CheckedInt<WebGLsizeiptr> checked_neededByteLength = CheckedInt<WebGLsizeiptr>(byteOffset) + data.Length();
     if (!checked_neededByteLength.isValid())
         return ErrorInvalidValue("bufferSubData: integer overflow computing the needed byte length");
 
     if (checked_neededByteLength.value() > boundBuffer->ByteLength())
         return ErrorInvalidValue("bufferSubData: not enough data -- operation requires %d bytes, but buffer only has %d bytes",
                                  checked_neededByteLength.value(), boundBuffer->ByteLength());
 
     boundBuffer->ElementArrayCacheBufferSubData(byteOffset, data.Data(), data.Length());