Bug 730033 - Rip out WidgetTileLayer and associated gunk. r=snorp
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 23 Feb 2012 14:55:15 -0500
changeset 89234 1f96ca787c9fdc04ec1615fc155350017df29a29
parent 89233 9b31ddc829e540a4cdc9f9af63b012a2683d87a2
child 89235 61386b8c2272c57d899b12d59aa5ad7e56b157ef
push id22242
push userkgupta@mozilla.com
push dateWed, 14 Mar 2012 15:19:09 +0000
treeherdermozilla-central@936ef50fa498 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs730033
milestone13.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 730033 - Rip out WidgetTileLayer and associated gunk. r=snorp
mobile/android/base/GeckoAppShell.java
mobile/android/base/Makefile.in
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/WidgetTileLayer.java
widget/android/AndroidJNI.cpp
widget/android/AndroidJavaWrappers.cpp
widget/android/AndroidJavaWrappers.h
widget/android/nsWindow.cpp
widget/android/nsWindow.h
--- a/mobile/android/base/GeckoAppShell.java
+++ b/mobile/android/base/GeckoAppShell.java
@@ -172,17 +172,16 @@ public class GeckoAppShell
     public static native void notifySmsDeleteFailed(int aError, int aRequestId, long aProcessId);
     public static native void notifyNoMessageInList(int aRequestId, long aProcessId);
     public static native void notifyListCreated(int aListId, int aMessageId, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId, long aProcessId);
     public static native void notifyGotNextMessage(int aMessageId, String aReceiver, String aSender, String aBody, long aTimestamp, int aRequestId, long aProcessId);
     public static native void notifyReadingMessageListFailed(int aError, int aRequestId, long aProcessId);
 
     public static native ByteBuffer allocateDirectBuffer(long size);
     public static native void freeDirectBuffer(ByteBuffer buf);
-    public static native void bindWidgetTexture();
     public static native void scheduleComposite();
     public static native void schedulePauseComposition();
     public static native void scheduleResumeComposition();
 
     // A looper thread, accessed by GeckoAppShell.getHandler
     private static class LooperThread extends Thread {
         public SynchronousQueue<Handler> mHandlerQueue =
             new SynchronousQueue<Handler>();
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -129,17 +129,16 @@ FENNEC_JAVA_FILES = \
   gfx/SurfaceTextureLayer.java \
   gfx/TextLayer.java \
   gfx/TextureGenerator.java \
   gfx/TextureReaper.java \
   gfx/TileLayer.java \
   gfx/ViewTransform.java \
   gfx/ViewportMetrics.java \
   gfx/VirtualLayer.java \
-  gfx/WidgetTileLayer.java \
   ui/Axis.java \
   ui/PanZoomController.java \
   ui/SimpleScaleGestureDetector.java \
   ui/SubdocumentScrollHelper.java \
   GeckoNetworkManager.java \
   $(NULL)
 
 ifdef MOZ_WEBSMS_BACKEND
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -122,31 +122,30 @@ public class GeckoLayerClient implements
         LayerView view = layerController.getView();
         view.setListener(this);
 
         mLayerRenderer = new LayerRenderer(view);
     }
 
     /** This function is invoked by Gecko via JNI; be careful when modifying signature. */
     public Rect beginDrawing(int width, int height, int tileWidth, int tileHeight,
-                             String metadata, boolean hasDirectTexture) {
-        Log.e(LOGTAG, "### beginDrawing " + width + " " + height + " " + tileWidth + " " +
-              tileHeight + " " + hasDirectTexture);
+                             String metadata) {
+        Log.e(LOGTAG, "### beginDrawing " + width + " " + height + " " + tileWidth + " " + tileHeight);
 
         // If the viewport has changed but we still don't have the latest viewport
         // from Gecko, ignore the viewport passed to us from Gecko since that is going
         // to be wrong.
         if (!mFirstPaint && mIgnorePaintsPendingViewportSizeChange) {
             return null;
         }
         mFirstPaint = false;
 
         // If we've changed surface types, cancel this draw
-        if (handleDirectTextureChange(hasDirectTexture)) {
-            Log.e(LOGTAG, "### Cancelling draw due to direct texture change");
+        if (initializeVirtualLayer()) {
+            Log.e(LOGTAG, "### Cancelling draw due to virtual layer initialization");
             return null;
         }
 
         try {
             JSONObject viewportObject = new JSONObject(metadata);
             mNewGeckoViewport = new ViewportMetrics(viewportObject);
 
             Log.e(LOGTAG, "### beginDrawing new Gecko viewport " + mNewGeckoViewport);
@@ -313,17 +312,17 @@ public class GeckoLayerClient implements
         }
 
         int r = Integer.parseInt(matcher.group(1));
         int g = Integer.parseInt(matcher.group(2));
         int b = Integer.parseInt(matcher.group(3));
         return Color.rgb(r, g, b);
     }
 
-    private boolean handleDirectTextureChange(boolean hasDirectTexture) {
+    private boolean initializeVirtualLayer() {
         if (mTileLayer != null) {
             return false;
         }
 
         Log.e(LOGTAG, "### Creating virtual layer");
         VirtualLayer virtualLayer = new VirtualLayer();
         virtualLayer.setSize(getBufferSize());
         mLayerController.setRoot(virtualLayer);
deleted file mode 100644
--- a/mobile/android/base/gfx/WidgetTileLayer.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Android code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009-2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   James Willcox <jwillcox@mozilla.com>
- *   Arkady Blyakher <rkadyb@mit.edu>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-package org.mozilla.gecko.gfx;
-
-import org.mozilla.gecko.gfx.LayerController;
-import org.mozilla.gecko.gfx.SingleTileLayer;
-import org.mozilla.gecko.GeckoAppShell;
-import android.graphics.RectF;
-import android.util.Log;
-import android.opengl.GLES20;
-import java.nio.FloatBuffer;
-
-/**
- * Encapsulates the logic needed to draw the single-tiled Gecko texture
- */
-public class WidgetTileLayer extends Layer {
-    private static final String LOGTAG = "WidgetTileLayer";
-
-    private int[] mTextureIDs;
-    private CairoImage mImage;
-
-    public WidgetTileLayer(CairoImage image) {
-        mImage = image;
-    }
-
-    protected boolean initialized() { return mTextureIDs != null; }
-
-    @Override
-    public IntSize getSize() { return mImage.getSize(); }
-
-    protected 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);
-    }
-
-    @Override
-    protected void finalize() throws Throwable {
-        if (mTextureIDs != null)
-            TextureReaper.get().add(mTextureIDs);
-    }
-
-    @Override
-    protected boolean performUpdates(RenderContext context) {
-        super.performUpdates(context);
-
-        if (mTextureIDs == null) {
-            mTextureIDs = new int[1];
-            GLES20.glGenTextures(1, mTextureIDs, 0);
-        }
-
-        bindAndSetGLParameters();
-        GeckoAppShell.bindWidgetTexture();
-
-        return true;
-    }
-
-    @Override
-    public void draw(RenderContext context) {
-        // mTextureIDs may be null here during startup if Layer.java's draw method
-        // failed to acquire the transaction lock and call performUpdates.
-        if (!initialized())
-            return;
-
-        GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mTextureIDs[0]);
-
-        RectF bounds;
-        int[] cropRect;
-        IntSize size = getSize();
-        RectF viewport = context.viewport;
-
-        bounds = getBounds(context, new FloatSize(size));
-        cropRect = new int[] { 0, 0, size.width, size.height };
-        bounds.offset(-viewport.left, -viewport.top);
-
-        float top = viewport.height() - (bounds.top + bounds.height());
-
-        // There may be errors from a previous GL call, so clear them first because
-        // we want to check for one below
-        while (GLES20.glGetError() != GLES20.GL_NO_ERROR);
-
-        float[] coords = {
-            //x, y, z, texture_x, texture_y
-            bounds.left/viewport.width(), top/viewport.height(), 0,
-            cropRect[0]/size.width, cropRect[1]/size.height,
-
-            bounds.left/viewport.width(), (top+bounds.height())/viewport.height(), 0,
-            cropRect[0]/size.width, cropRect[3]/size.height,
-
-            (bounds.left+bounds.width())/viewport.width(), top/viewport.height(), 0,
-            cropRect[2]/size.width, cropRect[1]/size.height,
-
-            (bounds.left+bounds.width())/viewport.width(), (top+bounds.height())/viewport.height(),
-                0,
-            cropRect[2]/size.width, cropRect[3]/size.height
-        };
-
-        // Get the buffer and handles from the context
-        FloatBuffer coordBuffer = context.coordBuffer;
-        int positionHandle = context.positionHandle;
-        int textureHandle = context.textureHandle;
-
-        // Make sure we are at position zero in the buffer in case other draw methods did not clean
-        // up after themselves
-        coordBuffer.position(0);
-        coordBuffer.put(coords);
-
-        // Vertex coordinates are x,y,z starting at position 0 into the buffer.
-        coordBuffer.position(0);
-        GLES20.glVertexAttribPointer(positionHandle, 3, GLES20.GL_FLOAT, false, 20, coordBuffer);
-
-        // Texture coordinates are texture_x, texture_y starting at position 3 into the buffer.
-        coordBuffer.position(3);
-        GLES20.glVertexAttribPointer(textureHandle, 2, GLES20.GL_FLOAT, false, 20, coordBuffer);
-        GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
-
-        int error = GLES20.glGetError();
-        if (error != GLES20.GL_NO_ERROR) {
-            Log.i(LOGTAG, "Failed to draw texture: " + error);
-        }
-    }
-}
-
--- a/widget/android/AndroidJNI.cpp
+++ b/widget/android/AndroidJNI.cpp
@@ -99,17 +99,16 @@ extern "C" {
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifySmsDeleted(JNIEnv* jenv, jclass, jboolean, jint, jlong);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifySmsDeleteFailed(JNIEnv* jenv, jclass, jint, jint, jlong);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyNoMessageInList(JNIEnv* jenv, jclass, jint, jlong);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyListCreated(JNIEnv* jenv, jclass, jint, jint, jstring, jstring, jstring, jlong, jint, jlong);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyGotNextMessage(JNIEnv* jenv, jclass, jint, jstring, jstring, jstring, jlong, jint, jlong);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_notifyReadingMessageListFailed(JNIEnv* jenv, jclass, jint, jint, jlong);
 
 #ifdef MOZ_JAVA_COMPOSITOR
-    NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_bindWidgetTexture(JNIEnv* jenv, jclass);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_scheduleComposite(JNIEnv* jenv, jclass);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_schedulePauseComposition(JNIEnv* jenv, jclass);
     NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_scheduleResumeComposition(JNIEnv* jenv, jclass);
 #endif
 
 }
 
 
@@ -888,22 +887,16 @@ Java_org_mozilla_gecko_GeckoAppShell_not
     nsCOMPtr<nsIRunnable> runnable =
       new NotifyReadListFailedRunnable(aError, aRequestId, aProcessId);
     NS_DispatchToMainThread(runnable);
 }
 
 #ifdef MOZ_JAVA_COMPOSITOR
 
 NS_EXPORT void JNICALL
-Java_org_mozilla_gecko_GeckoAppShell_bindWidgetTexture(JNIEnv* jenv, jclass)
-{
-    nsWindow::BindToTexture();
-}
-
-NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_GeckoAppShell_scheduleComposite(JNIEnv*, jclass)
 {
     __android_log_print(ANDROID_LOG_ERROR, "Gecko", "### scheduleComposite()");
     AndroidBridge::Bridge()->ScheduleComposite();
 }
 
 NS_EXPORT void JNICALL
 Java_org_mozilla_gecko_GeckoAppShell_schedulePauseComposition(JNIEnv*, jclass)
--- a/widget/android/AndroidJavaWrappers.cpp
+++ b/widget/android/AndroidJavaWrappers.cpp
@@ -342,17 +342,17 @@ AndroidRect::InitRectClass(JNIEnv *jEnv)
 void
 AndroidGeckoLayerClient::InitGeckoLayerClientClass(JNIEnv *jEnv)
 {
 #ifdef MOZ_JAVA_COMPOSITOR
     initInit();
 
     jGeckoLayerClientClass = getClassGlobalRef("org/mozilla/gecko/gfx/GeckoLayerClient");
 
-    jBeginDrawingMethod = getMethod("beginDrawing", "(IIIILjava/lang/String;Z)Landroid/graphics/Rect;");
+    jBeginDrawingMethod = getMethod("beginDrawing", "(IIIILjava/lang/String;)Landroid/graphics/Rect;");
     jEndDrawingMethod = getMethod("endDrawing", "(IIII)V");
     jGetViewTransformMethod = getMethod("getViewTransform",
                                         "()Lorg/mozilla/gecko/gfx/ViewTransform;");
     jCreateFrameMethod = getMethod("createFrame", "()Lorg/mozilla/gecko/gfx/LayerRenderer$Frame;");
     jActivateProgramMethod = getMethod("activateProgram", "()V");
     jDeactivateProgramMethod = getMethod("deactivateProgram", "()V");
 #endif
 }
@@ -760,29 +760,29 @@ AndroidGeckoSurfaceView::Draw2D(jobject 
     if (!env)
         return;
 
     env->CallVoidMethod(wrapped_obj, jDraw2DBufferMethod, buffer, stride);
 }
 
 bool
 AndroidGeckoLayerClient::BeginDrawing(int aWidth, int aHeight, int aTileWidth, int aTileHeight,
-                                      nsIntRect &aDirtyRect, const nsAString &aMetadata, bool aHasDirectTexture)
+                                      nsIntRect &aDirtyRect, const nsAString &aMetadata)
 {
     NS_ASSERTION(!isNull(), "BeginDrawing() called on null layer client!");
     JNIEnv *env = AndroidBridge::GetJNIEnv();
     if (!env)
         return false;
 
     AndroidBridge::AutoLocalJNIFrame(env, 1);
     jstring jMetadata = env->NewString(nsPromiseFlatString(aMetadata).get(), aMetadata.Length());
 
     jobject rectObject = env->CallObjectMethod(wrapped_obj, jBeginDrawingMethod,
                                                aWidth, aHeight, aTileWidth, aTileHeight,
-                                               jMetadata, aHasDirectTexture);
+                                               jMetadata);
 
     if (rectObject == nsnull)
         return false;
 
     AndroidRect rect(env, rectObject);
     nsIntRect newDirtyRect = aDirtyRect.Intersect(nsIntRect(rect.Top(), rect.Left(),
                                                             rect.Width(), rect.Height()));
     aDirtyRect.SetRect(newDirtyRect.x, newDirtyRect.y, newDirtyRect.width, newDirtyRect.height);
--- a/widget/android/AndroidJavaWrappers.h
+++ b/widget/android/AndroidJavaWrappers.h
@@ -220,17 +220,17 @@ public:
 
     AndroidGeckoLayerClient()
     : mViewTransformGetter(*this) {}
 
     AndroidGeckoLayerClient(jobject jobj)
     : mViewTransformGetter(*this) { Init(jobj); }
 
     bool BeginDrawing(int aWidth, int aHeight, int aTileWidth, int aTileHeight,
-                      nsIntRect &aDirtyRect, const nsAString &aMetadata, bool aHasDirectTexture);
+                      nsIntRect &aDirtyRect, const nsAString &aMetadata);
     void EndDrawing(const nsIntRect &aRect);
     void GetViewTransform(AndroidViewTransform& aViewTransform);
     void CreateFrame(AndroidLayerRendererFrame& aFrame);
     void ActivateProgram();
     void DeactivateProgram();
 
 protected:
     static jclass jGeckoLayerClientClass;
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -93,22 +93,16 @@ static gfxIntSize gAndroidScreenBounds;
 
 #ifdef ACCESSIBILITY
 bool nsWindow::sAccessibilityEnabled = false;
 #endif
 
 #ifdef MOZ_JAVA_COMPOSITOR
 #include "mozilla/Mutex.h"
 #include "nsThreadUtils.h"
-#include "AndroidDirectTexture.h"
-
-static AndroidDirectTexture* sDirectTexture = new AndroidDirectTexture(2048, 2048,
-        AndroidGraphicBuffer::UsageSoftwareWrite | AndroidGraphicBuffer::UsageTexture,
-        gfxASurface::ImageFormatRGB16_565);
-
 #endif
 
 
 class ContentCreationNotifier;
 static nsCOMPtr<ContentCreationNotifier> gContentCreationNotifier;
 // A helper class to send updates when content processes
 // are created. Currently an update for the screen size is sent.
 class ContentCreationNotifier : public nsIObserver
@@ -837,81 +831,16 @@ nsWindow::GetThebesSurface()
      * we need a RenderingContext to measure text against.
      */
 
     // XXX this really wants to return already_AddRefed, but this only really gets used
     // on direct assignment to a gfxASurface
     return new gfxImageSurface(gfxIntSize(5,5), gfxImageSurface::ImageFormatRGB24);
 }
 
-#ifdef MOZ_JAVA_COMPOSITOR
-
-void
-nsWindow::BindToTexture()
-{
-    sDirectTexture->Bind();
-}
-
-bool
-nsWindow::HasDirectTexture()
-{
-  // XXX: Checking fix me
-  // This is currently causes some crashes so disable it for now
-  if (true)
-    return false;
-
-  static bool sTestedDirectTexture = false;
-  static bool sHasDirectTexture = false;
-
-  // If we already tested, return early
-  if (sTestedDirectTexture)
-    return sHasDirectTexture;
-
-  sTestedDirectTexture = true;
-
-  nsAutoString board;
-  AndroidGraphicBuffer* buffer = NULL;
-  unsigned char* bits = NULL;
-
-  if (AndroidGraphicBuffer::IsBlacklisted()) {
-    ALOG("device is blacklisted for direct texture");
-    goto cleanup;
-  }
-
-  buffer = new AndroidGraphicBuffer(512, 512,
-      AndroidGraphicBuffer::UsageSoftwareWrite | AndroidGraphicBuffer::UsageTexture,
-      gfxASurface::ImageFormatRGB16_565);
-
-  if (buffer->Lock(AndroidGraphicBuffer::UsageSoftwareWrite, &bits) != 0 || !bits) {
-    ALOG("failed to lock graphic buffer");
-    buffer->Unlock();
-    goto cleanup;
-  }
-
-  if (buffer->Unlock() != 0) {
-    ALOG("failed to unlock graphic buffer");
-    goto cleanup;
-  }
-
-  if (!buffer->Reallocate(1024, 1024, gfxASurface::ImageFormatRGB16_565)) {
-    ALOG("failed to reallocate graphic buffer");
-    goto cleanup;
-  }
-
-  sHasDirectTexture = true;
-
-cleanup:
-  if (buffer)
-    delete buffer;
-
-  return sHasDirectTexture;
-}
-
-#endif
-
 void
 nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae)
 {
     if (!AndroidBridge::Bridge())
         return;
 
     nsWindow *win = TopWindow();
     if (!win)
@@ -1283,43 +1212,30 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
     // END HACK: gl layers
 #endif
 
     nsIntRect dirtyRect = ae->Rect().Intersect(nsIntRect(0, 0, gAndroidBounds.width, gAndroidBounds.height));
 
     AndroidGeckoLayerClient &client = AndroidBridge::Bridge()->GetLayerClient();
     if (!client.BeginDrawing(gAndroidBounds.width, gAndroidBounds.height,
                              gAndroidTileSize.width, gAndroidTileSize.height,
-                             dirtyRect, metadata, HasDirectTexture())) {
+                             dirtyRect, metadata)) {
         __android_log_print(ANDROID_LOG_ERROR, "Gecko", "### BeginDrawing returned false!");
         return;
     }
 
     unsigned char *bits = NULL;
-    if (HasDirectTexture()) {
-      __android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Have direct texture!");
-      if (sDirectTexture->Width() != gAndroidBounds.width ||
-          sDirectTexture->Height() != gAndroidBounds.height) {
-        sDirectTexture->Reallocate(gAndroidBounds.width, gAndroidBounds.height);
-      }
-
-      sDirectTexture->Lock(AndroidGraphicBuffer::UsageSoftwareWrite, dirtyRect, &bits);
-    }
 
     if (targetSurface->CairoStatus()) {
         ALOG("### Failed to create a valid surface from the bitmap");
     } else {
         __android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Calling DrawTo()!");
         DrawTo(targetSurface, dirtyRect);
     }
 
-    if (HasDirectTexture()) {
-        sDirectTexture->Unlock();
-    }
-
     __android_log_print(ANDROID_LOG_ERROR, "Gecko", "### Calling EndDrawing()!");
     client.EndDrawing(dirtyRect);
     return;
 #endif
 
     if (!sSurfaceExists) {
         return;
     }
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -177,19 +177,16 @@ public:
 
     NS_IMETHOD ReparentNativeWidget(nsIWidget* aNewParent);
 
 #ifdef ACCESSIBILITY
     static bool sAccessibilityEnabled;
 #endif
 
 #ifdef MOZ_JAVA_COMPOSITOR
-    static void BindToTexture();
-    static bool HasDirectTexture();
-
     virtual void DrawWindowUnderlay(LayerManager* aManager, nsIntRect aRect);
     virtual void DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect);
 #endif
 
 protected:
     void BringToFront();
     nsWindow *FindTopLevel();
     bool DrawTo(gfxASurface *targetSurface);