Bug 733184 - Maple: Remove some Java logging. r=pcwalton
authorBenoit Girard <b56girard@gmail.com>
Mon, 05 Mar 2012 18:50:00 -0500
changeset 89298 e8c2aa855b238289196711d206943dd9dba871d4
parent 89297 cd72bc8eac4998fb6594e31801c8e1fb77242ab7
child 89299 43de0f031f61558ff700874e45103dfd42270cd9
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)
reviewerspcwalton
bugs733184
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 733184 - Maple: Remove some Java logging. r=pcwalton
mobile/android/base/GeckoApp.java
mobile/android/base/gfx/FlexibleGLSurfaceView.java
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/LayerRenderer.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -1728,19 +1728,17 @@ abstract public class GeckoApp
             cameraView = new SurfaceView(this);
             cameraView.getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
         }
 
         if (mLayerController == null) {
             /*
              * Create a layer client, but don't hook it up to the layer controller yet.
              */
-            Log.e(LOGTAG, "### Creating GeckoLayerClient");
             mLayerClient = new GeckoLayerClient(this);
-            Log.e(LOGTAG, "### Done creating GeckoLayerClient");
 
             /*
              * Hook a placeholder layer client up to the layer controller so that the user can pan
              * and zoom a cached screenshot of the previous page. This call will return null if
              * there is no cached screenshot; in that case, we have no choice but to display a
              * checkerboard.
              *
              * TODO: Fall back to a built-in screenshot of the Fennec Start page for a nice first-
--- a/mobile/android/base/gfx/FlexibleGLSurfaceView.java
+++ b/mobile/android/base/gfx/FlexibleGLSurfaceView.java
@@ -98,38 +98,35 @@ public class FlexibleGLSurfaceView exten
      * like a GLSurfaceView. It is illegal to access the controller after this has been called.
      */
     public synchronized void createGLThread() {
         if (mGLThread != null) {
             throw new FlexibleGLSurfaceViewException("createGLThread() called with a GL thread " +
                                                      "already in place!");
         }
 
-        Log.e(LOGTAG, "### Creating GL thread!");
         mGLThread = new GLThread(mController);
         mGLThread.start();
         notifyAll();
     }
 
     /**
      * Destroys the Java GL thread. Returns a Thread that completes when the Java GL thread is
      * fully shut down.
      */
     public synchronized Thread destroyGLThread() {
         // Wait for the GL thread to be started.
-        Log.e(LOGTAG, "### Waiting for GL thread to be created...");
         while (mGLThread == null) {
             try {
                 wait();
             } catch (InterruptedException e) {
                 throw new RuntimeException(e);
             }
         }
 
-        Log.e(LOGTAG, "### Destroying GL thread!");
         Thread glThread = mGLThread;
         mGLThread.shutdown();
         mGLThread = null;
         return glThread;
     }
 
     public synchronized void recreateSurface() {
         if (mGLThread == null) {
@@ -177,25 +174,20 @@ public class FlexibleGLSurfaceView exten
         if (mListener != null) {
             mListener.compositionPauseRequested();
         }
     }
 
     // Called from the compositor thread
     public static GLController registerCxxCompositor() {
         try {
-            Log.e(LOGTAG, "### registerCxxCompositor point A");
-            System.out.println("register layer comp");
-            Log.e(LOGTAG, "### registerCxxCompositor point B");
             FlexibleGLSurfaceView flexView = (FlexibleGLSurfaceView)GeckoApp.mAppContext.getLayerController().getView();
-            Log.e(LOGTAG, "### registerCxxCompositor point C: " + flexView);
             try {
                 flexView.destroyGLThread().join();
             } catch (InterruptedException e) {}
-            Log.e(LOGTAG, "### registerCxxCompositor point D: " + flexView.getGLController());
             return flexView.getGLController();
         } catch (Exception e) {
             Log.e(LOGTAG, "### Exception! " + e);
             return null;
         }
     }
 
     public interface Listener {
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -121,18 +121,16 @@ 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 boolean beginDrawing(int width, int height, String metadata) {
-        Log.e(LOGTAG, "### beginDrawing " + width + " " + height);
-
         // 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 false;
         }
         mFirstPaint = false;
 
@@ -140,18 +138,16 @@ public class GeckoLayerClient implements
         if (initializeVirtualLayer()) {
             Log.e(LOGTAG, "### Cancelling draw due to virtual layer initialization");
             return false;
         }
 
         try {
             JSONObject viewportObject = new JSONObject(metadata);
             mNewGeckoViewport = new ViewportMetrics(viewportObject);
-
-            Log.e(LOGTAG, "### beginDrawing new Gecko viewport " + mNewGeckoViewport);
         } catch (JSONException e) {
             Log.e(LOGTAG, "Aborting draw, bad viewport description: " + metadata);
             return false;
         }
 
         if (mBufferSize.width != width || mBufferSize.height != height) {
             mBufferSize = new IntSize(width, height);
         }
@@ -168,19 +164,16 @@ public class GeckoLayerClient implements
             // to override can lead to race conditions where this data gets clobbered.
             FloatSize viewportSize = mLayerController.getViewportSize();
             mGeckoViewport = mNewGeckoViewport;
             mGeckoViewport.setSize(viewportSize);
 
             RectF position = mGeckoViewport.getViewport();
             mRootLayer.setPositionAndResolution(RectUtils.round(position), mGeckoViewport.getZoomFactor());
 
-            Log.e(LOGTAG, "### updateViewport onlyUpdatePageSize=" + !mUpdateViewportOnEndDraw +
-                  " getTileViewport " + mGeckoViewport);
-
             if (mUpdateViewportOnEndDraw) {
                 mLayerController.setViewportMetrics(mGeckoViewport);
                 mLayerController.abortPanZoomAnimation();
                 mUpdateViewportOnEndDraw = false;
             } else {
                 // Don't adjust page size when zooming unless zoom levels are
                 // approximately equal.
                 if (FloatUtils.fuzzyEquals(mLayerController.getZoomFactor(),
@@ -202,18 +195,16 @@ public class GeckoLayerClient implements
         displayPort.top -= mDisplayPortMargins.top;
         displayPort.right += mDisplayPortMargins.right;
         displayPort.bottom += mDisplayPortMargins.bottom;
         return displayPort;
     }
 
     /* Informs Gecko that the screen size has changed. */
     private void sendResizeEventIfNecessary(boolean force) {
-        Log.d(LOGTAG, "### sendResizeEventIfNecessary " + force);
-
         DisplayMetrics metrics = new DisplayMetrics();
         GeckoApp.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
 
         IntSize newScreenSize = new IntSize(metrics.widthPixels, metrics.heightPixels);
         IntSize newWindowSize = getBufferSize();
 
         boolean screenSizeChanged = mScreenSize == null || !mScreenSize.equals(newScreenSize);
         boolean windowSizeChanged = mWindowSize == null || !mWindowSize.equals(newWindowSize);
@@ -238,17 +229,16 @@ public class GeckoLayerClient implements
         GeckoAppShell.sendEventToGecko(event);
     }
 
     private boolean initializeVirtualLayer() {
         if (mRootLayer != null) {
             return false;
         }
 
-        Log.e(LOGTAG, "### Creating virtual layer");
         VirtualLayer virtualLayer = new VirtualLayer(getBufferSize());
         mLayerController.setRoot(virtualLayer);
         mRootLayer = virtualLayer;
 
         sendResizeEventIfNecessary(true);
         return true;
     }
 
@@ -279,25 +269,23 @@ public class GeckoLayerClient implements
             mViewportSizeChanged = false;
             GeckoAppShell.viewSizeChanged();
         }
     }
 
     /** Implementation of GeckoEventResponder/GeckoEventListener. */
     public void handleMessage(String event, JSONObject message) {
         if ("Viewport:UpdateAndDraw".equals(event)) {
-            Log.e(LOGTAG, "### Java side Viewport:UpdateAndDraw()!");
             mUpdateViewportOnEndDraw = true;
             mIgnorePaintsPendingViewportSizeChange = false;
 
             // Redraw everything.
             Rect rect = new Rect(0, 0, mBufferSize.width, mBufferSize.height);
             GeckoAppShell.sendEventToGecko(GeckoEvent.createDrawEvent(rect));
         } else if ("Viewport:UpdateLater".equals(event)) {
-            Log.e(LOGTAG, "### Java side Viewport:UpdateLater()!");
             mUpdateViewportOnEndDraw = true;
             mIgnorePaintsPendingViewportSizeChange = false;
         }
     }
 
     /** Implementation of GeckoEventResponder. */
     public String getResponse() {
         // We are responding to the events handled in handleMessage() above with
@@ -326,29 +314,25 @@ public class GeckoLayerClient implements
         // Return a copy, as we modify this inside the Gecko thread
         if (mGeckoViewport != null)
             return new ViewportMetrics(mGeckoViewport);
         return null;
     }
 
     /** This function is invoked by Gecko via JNI; be careful when modifying signature. */
     public ViewTransform getViewTransform() {
-        Log.e(LOGTAG, "### getViewTransform()");
-
         // NB: We don't begin a transaction here because this can be called in a synchronous
         // manner between beginDrawing() and endDrawing(), and that will cause a deadlock.
 
         synchronized (mLayerController) {
             ViewportMetrics viewportMetrics = mLayerController.getViewportMetrics();
             PointF viewportOrigin = viewportMetrics.getOrigin();
             float scrollX = viewportOrigin.x; 
             float scrollY = viewportOrigin.y;
             float zoomFactor = viewportMetrics.getZoomFactor();
-            Log.e(LOGTAG, "### Viewport metrics = " + viewportMetrics + " tile reso = " +
-                  mRootLayer.getResolution());
             return new ViewTransform(scrollX, scrollY, zoomFactor);
         }
     }
 
     /** This function is invoked by Gecko via JNI; be careful when modifying signature. */
     public LayerRenderer.Frame createFrame() {
         // Create the shaders and textures if necessary.
         if (!mLayerRendererInitialized) {
@@ -370,29 +354,26 @@ public class GeckoLayerClient implements
 
     /** This function is invoked by Gecko via JNI; be careful when modifying signature. */
     public void deactivateProgram() {
         mLayerRenderer.deactivateDefaultProgram();
     }
 
     /** Implementation of FlexibleGLSurfaceView.Listener */
     public void renderRequested() {
-        Log.e(LOGTAG, "### Render requested, scheduling composite");
         GeckoAppShell.scheduleComposite();
     }
 
     /** Implementation of FlexibleGLSurfaceView.Listener */
     public void compositionPauseRequested() {
-        Log.e(LOGTAG, "### Scheduling PauseComposition");
         GeckoAppShell.schedulePauseComposition();
     }
 
     /** Implementation of FlexibleGLSurfaceView.Listener */
     public void compositionResumeRequested() {
-        Log.e(LOGTAG, "### Scheduling ResumeComposition");
         GeckoAppShell.scheduleResumeComposition();
     }
 
     /** Implementation of FlexibleGLSurfaceView.Listener */
     public void surfaceChanged(int width, int height) {
         compositionPauseRequested();
         mLayerController.setViewportSize(new FloatSize(width, height));
         compositionResumeRequested();
--- a/mobile/android/base/gfx/LayerRenderer.java
+++ b/mobile/android/base/gfx/LayerRenderer.java
@@ -215,19 +215,16 @@ public class LayerRenderer implements GL
     // Activates the shader program.
     public void activateDefaultProgram() {
         // Add the program to the OpenGL environment
         GLES20.glUseProgram(mProgram);
 
         // Set the transformation matrix
         GLES20.glUniformMatrix4fv(mTMatrixHandle, 1, false, DEFAULT_TEXTURE_MATRIX, 0);
 
-        Log.e(LOGTAG, "### Position handle is " + mPositionHandle + ", texture handle is " +
-              mTextureHandle + ", last error is " + GLES20.glGetError());
-
         // Enable the arrays from which we get the vertex and texture coordinates
         GLES20.glEnableVertexAttribArray(mPositionHandle);
         GLES20.glEnableVertexAttribArray(mTextureHandle);
 
         GLES20.glUniform1i(mSampleHandle, 0);
 
         TextureGenerator.get().fill();