Bug 740061. Use set() instead of union(). r=kats
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sat, 31 Mar 2012 13:04:14 -0400
changeset 90789 bb5bcfa28977d99073afae7754403e64759dd981
parent 90788 3cd77601c2056b1959664972626e493a97d970ea
child 90790 7284cf8a2c5e77ff0de92c88966d8d073c5d76dc
push id22382
push userbmo@edmorley.co.uk
push dateSat, 31 Mar 2012 21:44:34 +0000
treeherdermozilla-central@bbe5086163c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs740061
milestone14.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 740061. Use set() instead of union(). r=kats mBufferrRect is either new Rect(0, 0, bufferSize.width, bufferSize.height) or Rect() so we can just set() instead of unioning. This is cheaper and avoids an allocation.
mobile/android/base/gfx/TileLayer.java
--- a/mobile/android/base/gfx/TileLayer.java
+++ b/mobile/android/base/gfx/TileLayer.java
@@ -95,17 +95,17 @@ public abstract class TileLayer extends 
      * Invalidates the entire buffer so that it will be uploaded again. Only valid inside a
      * transaction.
      */
 
     public void invalidate() {
         if (!inTransaction())
             throw new RuntimeException("invalidate() is only valid inside a transaction");
         IntSize bufferSize = mImage.getSize();
-        mDirtyRect.union(new Rect(0, 0, bufferSize.width, bufferSize.height));
+        mDirtyRect.set(0, 0, bufferSize.width, bufferSize.height);
     }
 
     public boolean isDirty() {
         return mImage.getSize().isPositive() && (mTextureIDs == null || !mDirtyRect.isEmpty());
     }
 
     private void validateTexture() {
         /* Calculate the ideal texture size. This must be a power of two if