Bug 800612 - 1/2 - fix WebGLElementArrayCache bug and increase test repetitions to catch this bug - r=jgilbert
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 09 Nov 2012 16:42:21 -0500
changeset 112879 d7d0cb3b68e01bf60f5a4b635d3e775f4900b265
parent 112878 1a69f5c63aab3cd5b2c04bf29d2d84bbbb2251c7
child 112880 a31d3b784446ca8eaf92c2f22dbed388297a47e1
push id17812
push userbjacob@mozilla.com
push dateFri, 09 Nov 2012 21:42:35 +0000
treeherdermozilla-inbound@a31d3b784446 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs800612
milestone19.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 800612 - 1/2 - fix WebGLElementArrayCache bug and increase test repetitions to catch this bug - r=jgilbert
content/canvas/src/WebGLElementArrayCache.cpp
--- a/content/canvas/src/WebGLElementArrayCache.cpp
+++ b/content/canvas/src/WebGLElementArrayCache.cpp
@@ -328,16 +328,19 @@ struct TreeForType<uint16_t>
 };
 
 // When the buffer gets updated from firstByte to lastByte,
 // calling this method will notify the tree accordingly
 template<typename T>
 void WebGLElementArrayCacheTree<T>::Invalidate(size_t firstByte, size_t lastByte)
 {
   lastByte = NS_MIN(lastByte, mNumLeaves * sElementsPerLeaf * sizeof(T) - 1);
+  if (firstByte > lastByte) {
+    return;
+  }
 
   size_t firstLeaf = LeafForByte(firstByte);
   size_t lastLeaf = LeafForByte(lastByte);
 
   if (mInvalidated) {
     mFirstInvalidatedLeaf = NS_MIN(firstLeaf, mFirstInvalidatedLeaf);
     mLastInvalidatedLeaf = NS_MAX(lastLeaf, mLastInvalidatedLeaf);
   } else {