Merge "lock TestDeviceSetup to one SDK to allow running PTS for older systems" into jb-mr2-dev
diff --git a/suite/pts/deviceTests/opengl/jni/Android.mk b/suite/pts/deviceTests/opengl/jni/Android.mk
index 7ab7f89..be69522 100644
--- a/suite/pts/deviceTests/opengl/jni/Android.mk
+++ b/suite/pts/deviceTests/opengl/jni/Android.mk
@@ -26,6 +26,6 @@
 
 LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
 
-LOCAL_SHARED_LIBRARIES := libEGL libGLESv2 libandroid libutils
+LOCAL_SHARED_LIBRARIES := libEGL libGLESv2 libandroid libutils libcutils
 
 include $(BUILD_SHARED_LIBRARY)
\ No newline at end of file
diff --git a/suite/pts/deviceTests/opengl/jni/GLUtils.cpp b/suite/pts/deviceTests/opengl/jni/graphics/GLUtils.cpp
similarity index 79%
rename from suite/pts/deviceTests/opengl/jni/GLUtils.cpp
rename to suite/pts/deviceTests/opengl/jni/graphics/GLUtils.cpp
index 9e75f2c..439e451 100644
--- a/suite/pts/deviceTests/opengl/jni/GLUtils.cpp
+++ b/suite/pts/deviceTests/opengl/jni/graphics/GLUtils.cpp
@@ -12,12 +12,12 @@
  * the License.
  */
 
-#include <GLUtils.h>
+#include "GLUtils.h"
 #include <stdlib.h>
 
 #define LOG_TAG "PTS_OPENGL"
 #define LOG_NDEBUG 0
-#include "utils/Log.h"
+#include <utils/Log.h>
 
 // Loads the given source code as a shader of the given type.
 static GLuint loadShader(GLenum shaderType, const char** source) {
@@ -120,3 +120,28 @@
     delete[] m;
     return textureId;
 }
+
+bool GLUtils::createFBO(GLuint& fboId, GLuint& rboId, GLuint& cboId, int width, int height) {
+    glGenFramebuffers(1, &fboId);
+    glBindFramebuffer(GL_FRAMEBUFFER, fboId);
+
+    glGenRenderbuffers(1, &rboId);
+    glBindRenderbuffer(GL_RENDERBUFFER, rboId);
+    glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
+    glBindRenderbuffer(GL_RENDERBUFFER, 0);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rboId);
+
+    glGenRenderbuffers(1, &cboId);
+    glBindRenderbuffer(GL_RENDERBUFFER, cboId);
+    glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB565, width, height);
+    glBindRenderbuffer(GL_RENDERBUFFER, 0);
+    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, cboId);
+
+    GLuint err = glGetError();
+    if (err != GL_NO_ERROR) {
+        ALOGV("GLError %d", err);
+        return false;
+    }
+
+    return glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
+}
diff --git a/suite/pts/deviceTests/opengl/jni/GLUtils.h b/suite/pts/deviceTests/opengl/jni/graphics/GLUtils.h
similarity index 92%
rename from suite/pts/deviceTests/opengl/jni/GLUtils.h
rename to suite/pts/deviceTests/opengl/jni/graphics/GLUtils.h
index a0525bc..8708103 100644
--- a/suite/pts/deviceTests/opengl/jni/GLUtils.h
+++ b/suite/pts/deviceTests/opengl/jni/graphics/GLUtils.h
@@ -27,6 +27,7 @@
     static int roundUpToSmallestPowerOf2(int x);
     // Generates a random texture of the given dimensions.
     static GLuint genRandTex(int texWidth, int texHeight);
+    static bool createFBO(GLuint& fboId, GLuint& rboId, GLuint& cboId, int width, int height);
 };
 
 #endif
diff --git a/suite/pts/deviceTests/opengl/jni/GLNative.cpp b/suite/pts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/GLNative.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/GLPrimitive.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/Renderer.cpp b/suite/pts/deviceTests/opengl/jni/primitive/Renderer.cpp
similarity index 78%
rename from suite/pts/deviceTests/opengl/jni/Renderer.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/Renderer.cpp
index 0f5c3ba..4bc0cda 100644
--- a/suite/pts/deviceTests/opengl/jni/Renderer.cpp
+++ b/suite/pts/deviceTests/opengl/jni/primitive/Renderer.cpp
@@ -12,11 +12,14 @@
  * the License.
  */
 #include "Renderer.h"
-#include <GLUtils.h>
+#include <graphics/GLUtils.h>
 
 #define LOG_TAG "PTS_OPENGL"
 #define LOG_NDEBUG 0
-#include "utils/Log.h"
+#include <utils/Log.h>
+
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include <utils/Trace.h>
 
 static const EGLint contextAttribs[] = {
         EGL_CONTEXT_CLIENT_VERSION, 2,
@@ -39,6 +42,7 @@
 }
 
 bool Renderer::setUp() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     mEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
     if (EGL_NO_DISPLAY == mEglDisplay || EGL_SUCCESS != eglGetError()) {
         return false;
@@ -85,7 +89,7 @@
     if (mOffscreen) {
         int w = GLUtils::roundUpToSmallestPowerOf2(width);
         int h = GLUtils::roundUpToSmallestPowerOf2(height);
-        if (!createFBO(mFboId, mRboId, mCboId, w, h)) {
+        if (!GLUtils::createFBO(mFboId, mRboId, mCboId, w, h)) {
             return false;
         }
     } else {
@@ -102,32 +106,8 @@
     return true;
 }
 
-bool Renderer::createFBO(GLuint& fboId, GLuint& rboId, GLuint& cboId, int width, int height) {
-    glGenFramebuffers(1, &fboId);
-    glBindFramebuffer(GL_FRAMEBUFFER, fboId);
-
-    glGenRenderbuffers(1, &rboId);
-    glBindRenderbuffer(GL_RENDERBUFFER, rboId);
-    glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
-    glBindRenderbuffer(GL_RENDERBUFFER, 0);
-    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rboId);
-
-    glGenRenderbuffers(1, &cboId);
-    glBindRenderbuffer(GL_RENDERBUFFER, cboId);
-    glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB565, width, height);
-    glBindRenderbuffer(GL_RENDERBUFFER, 0);
-    glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, cboId);
-
-    GLuint err = glGetError();
-    if (err != GL_NO_ERROR) {
-        ALOGV("GLError %d", err);
-        return false;
-    }
-
-    return glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
-}
-
 bool Renderer::tearDown() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (mFboId != 0) {
         glDeleteFramebuffers(1, &mFboId);
         mFboId = 0;
diff --git a/suite/pts/deviceTests/opengl/jni/Renderer.h b/suite/pts/deviceTests/opengl/jni/primitive/Renderer.h
similarity index 93%
rename from suite/pts/deviceTests/opengl/jni/Renderer.h
rename to suite/pts/deviceTests/opengl/jni/primitive/Renderer.h
index a50d81c..49c7e98 100644
--- a/suite/pts/deviceTests/opengl/jni/Renderer.h
+++ b/suite/pts/deviceTests/opengl/jni/primitive/Renderer.h
@@ -28,7 +28,6 @@
     virtual bool draw() = 0;
     virtual ~Renderer() {};
 protected:
-    bool createFBO(GLuint& fboId, GLuint& rboId, GLuint& cboId, int width, int height);
     ANativeWindow* mWindow;
     EGLDisplay mEglDisplay;
     EGLSurface mEglSurface;
diff --git a/suite/pts/deviceTests/opengl/jni/contextswitch/ContextSwitchRenderer.cpp b/suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
similarity index 94%
rename from suite/pts/deviceTests/opengl/jni/contextswitch/ContextSwitchRenderer.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
index 0d85cae..cdfaaec 100644
--- a/suite/pts/deviceTests/opengl/jni/contextswitch/ContextSwitchRenderer.cpp
+++ b/suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.cpp
@@ -21,11 +21,14 @@
 #include <GLES2/gl2ext.h>
 
 #include "ContextSwitchRenderer.h"
-#include <GLUtils.h>
+#include <graphics/GLUtils.h>
 
 #define LOG_TAG "PTS_OPENGL"
 #define LOG_NDEBUG 0
-#include "utils/Log.h"
+#include <utils/Log.h>
+
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include <utils/Trace.h>
 
 static const EGLint contextAttribs[] =
         { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
@@ -70,6 +73,7 @@
 }
 
 bool ContextSwitchRenderer::setUp() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (!Renderer::setUp()) {
         return false;
     }
@@ -105,7 +109,7 @@
 
         if (mOffscreen) {
             // Setup FBOs.
-            if (!Renderer::createFBO(mFboIds[i], mRboIds[i], mCboIds[i], w, h)) {
+            if (!GLUtils::createFBO(mFboIds[i], mRboIds[i], mCboIds[i], w, h)) {
                 return false;
             }
         }
@@ -137,6 +141,7 @@
 }
 
 bool ContextSwitchRenderer::tearDown() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (mContexts) {
         for (int i = 0; i < mWorkload; i++) {
             eglDestroyContext(mEglDisplay, mContexts[i]);
@@ -168,6 +173,7 @@
 }
 
 bool ContextSwitchRenderer::draw() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     for (int i = 0; i < mWorkload; i++) {
         if (!eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mContexts[i])
                 || EGL_SUCCESS != eglGetError()) {
diff --git a/suite/pts/deviceTests/opengl/jni/contextswitch/ContextSwitchRenderer.h b/suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h
similarity index 97%
rename from suite/pts/deviceTests/opengl/jni/contextswitch/ContextSwitchRenderer.h
rename to suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h
index 3dfe9f3..24d8df1 100644
--- a/suite/pts/deviceTests/opengl/jni/contextswitch/ContextSwitchRenderer.h
+++ b/suite/pts/deviceTests/opengl/jni/primitive/contextswitch/ContextSwitchRenderer.h
@@ -14,7 +14,7 @@
 #ifndef CONTEXTSWITCHRENDERER_H
 #define CONTEXTSWITCHRENDERER_H
 
-#include <Renderer.h>
+#include <primitive/Renderer.h>
 
 class ContextSwitchRenderer: public Renderer {
 public:
diff --git a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineMesh.cpp b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineMesh.cpp
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineMesh.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineMesh.cpp
diff --git a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineMesh.h b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineMesh.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineMesh.h
rename to suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineMesh.h
diff --git a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineProgram.cpp b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineProgram.cpp
similarity index 97%
rename from suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineProgram.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineProgram.cpp
index e3abc2c..b06cdd2 100644
--- a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineProgram.cpp
+++ b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineProgram.cpp
@@ -23,7 +23,7 @@
     mLightPosInModelSpace[0] = 0.0f;
     mLightPosInModelSpace[1] = 2.0f;
     mLightPosInModelSpace[2] = 2.0f;
-    mLightPosInModelSpace[3] = 1.0f;
+    mLightPosInModelSpace[3] = 2.0f;
     mMVMatrixHandle = glGetUniformLocation(programId, "u_MVMatrix");
     mMVPMatrixHandle = glGetUniformLocation(programId, "u_MVPMatrix");
     mLightPosHandle = glGetUniformLocation(programId, "u_LightPos");
diff --git a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineProgram.h b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineProgram.h
similarity index 100%
rename from suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineProgram.h
rename to suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineProgram.h
diff --git a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineRenderer.cpp b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
similarity index 96%
rename from suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineRenderer.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
index 4cab669..3db5eea 100644
--- a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineRenderer.cpp
+++ b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.cpp
@@ -21,11 +21,14 @@
 #include "FullPipelineRenderer.h"
 #include <graphics/Mesh.h>
 #include <graphics/TransformationNode.h>
-#include <GLUtils.h>
+#include <graphics/GLUtils.h>
 
 #define LOG_TAG "PTS_OPENGL"
 #define LOG_NDEBUG 0
-#include "utils/Log.h"
+#include <utils/Log.h>
+
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include <utils/Trace.h>
 
 static const int FP_NUM_VERTICES = 6;
 
@@ -101,6 +104,7 @@
 }
 
 bool FullPipelineRenderer::setUp() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (!Renderer::setUp()) {
         return false;
     }
@@ -169,6 +173,7 @@
 }
 
 bool FullPipelineRenderer::tearDown() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (mTextureId != 0) {
         glDeleteTextures(1, &mTextureId);
         mTextureId = 0;
@@ -192,6 +197,7 @@
 }
 
 bool FullPipelineRenderer::draw() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (mOffscreen) {
         glBindFramebuffer(GL_FRAMEBUFFER, mFboId);
     }
diff --git a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineRenderer.h b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h
similarity index 97%
rename from suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineRenderer.h
rename to suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h
index 0c5acae..14efcf6 100644
--- a/suite/pts/deviceTests/opengl/jni/fullpipeline/FullPipelineRenderer.h
+++ b/suite/pts/deviceTests/opengl/jni/primitive/fullpipeline/FullPipelineRenderer.h
@@ -16,7 +16,7 @@
 
 #include "FullPipelineProgram.h"
 
-#include <Renderer.h>
+#include <primitive/Renderer.h>
 #include <graphics/Matrix.h>
 #include <graphics/Mesh.h>
 #include <graphics/ProgramNode.h>
diff --git a/suite/pts/deviceTests/opengl/jni/pixeloutput/PixelOutputRenderer.cpp b/suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
similarity index 93%
rename from suite/pts/deviceTests/opengl/jni/pixeloutput/PixelOutputRenderer.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
index 95bf52b..d2fd762 100644
--- a/suite/pts/deviceTests/opengl/jni/pixeloutput/PixelOutputRenderer.cpp
+++ b/suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.cpp
@@ -12,11 +12,14 @@
  * the License.
  */
 #include "PixelOutputRenderer.h"
-#include <GLUtils.h>
+#include <graphics/GLUtils.h>
 
 #define LOG_TAG "PTS_OPENGL"
 #define LOG_NDEBUG 0
-#include "utils/Log.h"
+#include <utils/Log.h>
+
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include <utils/Trace.h>
 
 static const int PO_NUM_VERTICES = 6;
 
@@ -57,6 +60,7 @@
 }
 
 bool PixelOutputRenderer::setUp() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (!Renderer::setUp()) {
         return false;
     }
@@ -79,6 +83,7 @@
 }
 
 bool PixelOutputRenderer::tearDown() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (mTextureId != 0) {
         glDeleteTextures(1, &mTextureId);
         mTextureId = 0;
@@ -90,6 +95,7 @@
 }
 
 bool PixelOutputRenderer::draw() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (mOffscreen) {
         glBindFramebuffer(GL_FRAMEBUFFER, mFboId);
     }
diff --git a/suite/pts/deviceTests/opengl/jni/pixeloutput/PixelOutputRenderer.h b/suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h
similarity index 96%
rename from suite/pts/deviceTests/opengl/jni/pixeloutput/PixelOutputRenderer.h
rename to suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h
index 6422517..90b3f2a 100644
--- a/suite/pts/deviceTests/opengl/jni/pixeloutput/PixelOutputRenderer.h
+++ b/suite/pts/deviceTests/opengl/jni/primitive/pixeloutput/PixelOutputRenderer.h
@@ -14,7 +14,7 @@
 #ifndef PIXELOUTPUTRENDERER_H
 #define PIXELOUTPUTRENDERER_H
 
-#include <Renderer.h>
+#include <primitive/Renderer.h>
 
 class PixelOutputRenderer: public Renderer {
 public:
diff --git a/suite/pts/deviceTests/opengl/jni/shaderperf/ShaderPerfRenderer.cpp b/suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
similarity index 96%
rename from suite/pts/deviceTests/opengl/jni/shaderperf/ShaderPerfRenderer.cpp
rename to suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
index 6d98c9a..62fe1ac 100644
--- a/suite/pts/deviceTests/opengl/jni/shaderperf/ShaderPerfRenderer.cpp
+++ b/suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.cpp
@@ -12,13 +12,16 @@
  * the License.
  */
 #include "ShaderPerfRenderer.h"
-#include <GLUtils.h>
+#include <graphics/GLUtils.h>
 
 #include <math.h>
 
 #define LOG_TAG "PTS_OPENGL"
 #define LOG_NDEBUG 0
-#include "utils/Log.h"
+#include <utils/Log.h>
+
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include <utils/Trace.h>
 
 static const float GOLDEN_RATIO = (1.0 + sqrt(5.0)) / 2.0;
 
@@ -98,6 +101,7 @@
 }
 
 bool ShaderPerfRenderer::setUp() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (!Renderer::setUp()) {
         return false;
     }
@@ -148,6 +152,7 @@
 }
 
 bool ShaderPerfRenderer::draw() {
+    android::ScopedTrace st(ATRACE_TAG, __func__);
     if (mOffscreen) {
         glBindFramebuffer(GL_FRAMEBUFFER, mFboId);
     }
diff --git a/suite/pts/deviceTests/opengl/jni/shaderperf/ShaderPerfRenderer.h b/suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h
similarity index 96%
rename from suite/pts/deviceTests/opengl/jni/shaderperf/ShaderPerfRenderer.h
rename to suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h
index 4460174..3537eba 100644
--- a/suite/pts/deviceTests/opengl/jni/shaderperf/ShaderPerfRenderer.h
+++ b/suite/pts/deviceTests/opengl/jni/primitive/shaderperf/ShaderPerfRenderer.h
@@ -14,7 +14,7 @@
 #ifndef SHADERPERFRENDERER_H
 #define SHADERPERFRENDERER_H
 
-#include <Renderer.h>
+#include <primitive/Renderer.h>
 
 class ShaderPerfRenderer: public Renderer {
 public:
diff --git a/suite/pts/utils/grapher.py b/suite/pts/utils/grapher.py
index 42b5f11..94bf25e 100755
--- a/suite/pts/utils/grapher.py
+++ b/suite/pts/utils/grapher.py
@@ -41,7 +41,7 @@
       # Create a new figure
       fig = plt.figure()
       # Set the title of the graph
-      plt.title(benchmark)
+      plt.title(benchmark[benchmark.index('#') + 1:])
       # For each result in the data set
       for r in results:
         score = r['result']
@@ -60,6 +60,9 @@
           ax.plot(x, y, 'o-', label=r['device'] + ' (%s)'%score)
           # Add a legend
           ax.legend(loc='upper right').get_frame().set_fill(False)
+      (ymin, ymax) = plt.ylim()
+      if ymax < 90:# So that on screen tests are easier to compare
+        plt.ylim(0, 90)
       plt.xlabel('Iteration')
       plt.ylabel('FPS')
       fig.autofmt_xdate()
diff --git a/tools/vm-tests-tf/src/util/build/BuildDalvikSuite.java b/tools/vm-tests-tf/src/util/build/BuildDalvikSuite.java
index bd688fe..20429f0 100644
--- a/tools/vm-tests-tf/src/util/build/BuildDalvikSuite.java
+++ b/tools/vm-tests-tf/src/util/build/BuildDalvikSuite.java
@@ -576,14 +576,6 @@
         }
 
         // find the @title/@constraint in javadoc comment for this method
-        Scanner scanner2;
-        try {
-            // using platform's default charset
-            scanner2 = new Scanner(f);
-        } catch (FileNotFoundException e) {
-            throw new RuntimeException("error while reading to file: " + e.getClass().getName() +
-                    ", msg:" + e.getMessage());
-        }
         // using platform's default charset
         String all = new String(FileUtils.readFile(f));
         // System.out.println("grepping javadoc found for method " + method +
@@ -630,9 +622,6 @@
         if (scanner != null) {
             scanner.close();
         }
-        if (scanner2 != null) {
-            scanner2.close();
-        }
         return md;
     }