Bug 740061. Remove support for subuploads. r=kats
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sat, 31 Mar 2012 13:30:11 -0400
changeset 94104 02782c390352cd4a537671fa3df77686bac115c0
parent 94103 7284cf8a2c5e77ff0de92c88966d8d073c5d76dc
child 94105 a963db912f08dc7adf7b4a8889084c9726c44350
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [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. Remove support for subuploads. r=kats Since, the dirtyRect is either the size of the buffer or empty we don't need to support subuploads anymore.
mobile/android/base/gfx/TileLayer.java
--- a/mobile/android/base/gfx/TileLayer.java
+++ b/mobile/android/base/gfx/TileLayer.java
@@ -177,63 +177,28 @@ public abstract class TileLayer extends 
         if (dirtyRect.isEmpty())
             return;
 
         // It's possible that the buffer will be null, check for that and return
         ByteBuffer imageBuffer = mImage.getBuffer();
         if (imageBuffer == null)
             return;
 
-        boolean newlyCreated = false;
-
         if (mTextureIDs == null) {
             mTextureIDs = new int[1];
             GLES20.glGenTextures(mTextureIDs.length, mTextureIDs, 0);
-            newlyCreated = true;
         }
 
-        IntSize bufferSize = mImage.getSize();
-        Rect bufferRect = new Rect(0, 0, bufferSize.width, bufferSize.height);
-
         int cairoFormat = mImage.getFormat();
         CairoGLInfo glInfo = new CairoGLInfo(cairoFormat);
 
         bindAndSetGLParameters();
 
-        if (newlyCreated || dirtyRect.contains(bufferRect)) {
-            GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, glInfo.internalFormat, mSize.width,
-                                mSize.height, 0, glInfo.format, glInfo.type, imageBuffer);
-            return;
-        }
-
-        // Make sure that the dirty region intersects with the buffer rect,
-        // otherwise we'll end up with an invalid buffer pointer.
-        if (!Rect.intersects(dirtyRect, bufferRect)) {
-            return;
-        }
-
-        /*
-         * Upload the changed rect. We have to widen to the full width of the texture
-         * because we can't count on the device having support for GL_EXT_unpack_subimage,
-         * and going line-by-line is too slow.
-         *
-         * XXX We should still use GL_EXT_unpack_subimage when available.
-         */
-        Buffer viewBuffer = imageBuffer.slice();
-        int bpp = CairoUtils.bitsPerPixelForCairoFormat(cairoFormat) / 8;
-        int position = dirtyRect.top * bufferSize.width * bpp;
-        if (position > viewBuffer.limit()) {
-            Log.e(LOGTAG, "### Position outside tile! " + dirtyRect.top);
-            return;
-        }
-
-        viewBuffer.position(position);
-        GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, dirtyRect.top, bufferSize.width,
-                               Math.min(bufferSize.height - dirtyRect.top, dirtyRect.height()),
-                               glInfo.format, glInfo.type, viewBuffer);
+        GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, glInfo.internalFormat, mSize.width,
+                            mSize.height, 0, glInfo.format, glInfo.type, imageBuffer);
     }
 
     private void bindAndSetGLParameters() {
         GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIDs[0]);
         GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER,
                                GLES20.GL_NEAREST);
         GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER,
                                GLES20.GL_LINEAR);