Merge "Update diff files which break benchmark suite"
am: 8e6687fd5e

Change-Id: I598a6256a480b8c0cb84ddac7452145636cc5f44
diff --git a/Binder_flags_internal.diff b/Binder_flags_internal.diff
index 5492b91..5d8e45b 100644
--- a/Binder_flags_internal.diff
+++ b/Binder_flags_internal.diff
@@ -16,28 +16,3 @@
          },
      },
  
-@@ -76,4 +78,22 @@ cc_library {
-     },
- }
- 
--subdirs = ["tests"]
-+cc_test {
-+    name: "binderThroughputTest",
-+    srcs: ["tests/binderThroughputTest.cpp"],
-+    shared_libs: [
-+        "libbinder",
-+        "libutils",
-+    ],
-+    clang: true,
-+    cflags: [
-+        "-g",
-+        "-Wall",
-+        "-Werror",
-+        "-Wno-missing-field-initializers",
-+        "-Wno-sign-compare",
-+	 "-O3",
-+        CFLAGS_FOR_BENCH_SUITE
-+    ],
-+    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
-+}
-+
diff --git a/Dex2oat_flags_internal.diff b/Dex2oat_flags_internal.diff
index 2efb120..a52a67f 100644
--- a/Dex2oat_flags_internal.diff
+++ b/Dex2oat_flags_internal.diff
@@ -1,14 +1,14 @@
 diff --git a/compiler/Android.bp b/compiler/Android.bp
-index 1e4cdf2bd5..e14dce8d7b 100644
+index fe0f3c75c5..d0430bcd55 100644
 --- a/compiler/Android.bp
 +++ b/compiler/Android.bp
-@@ -197,6 +197,9 @@ art_cc_defaults {
-         "art_cmdlineparser_headers",  // For compiler_options.
+@@ -199,6 +199,9 @@ art_cc_defaults {
      ],
  
+     export_include_dirs: ["."],
++
 +    cflags: [CFLAGS_FOR_BENCH_SUITE],
 +    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
-+
-     export_include_dirs: ["."],
  }
  
+ gensrcs {
diff --git a/Skia_flags_internal.diff b/Skia_flags_internal.diff
index aefb2bd..3b3cdc7 100644
--- a/Skia_flags_internal.diff
+++ b/Skia_flags_internal.diff
@@ -1,24 +1,34 @@
 diff --git a/Android.bp b/Android.bp
-index b4e1f5f701..13e1c6645f 100644
+index b721f34c50..06942d7e16 100644
 --- a/Android.bp
 +++ b/Android.bp
-@@ -9,7 +9,9 @@ cc_library {
-         "-D_FORTIFY_SOURCE=1",
-         "-DSKIA_IMPLEMENTATION=1",
-         "-DATRACE_TAG=ATRACE_TAG_VIEW",
+@@ -58,8 +58,11 @@ cc_library_static {
+         "-Wsign-compare",
+         "-Wvla",
+         "-fvisibility=hidden",
 +        CFLAGS_FOR_BENCH_SUITE
      ],
+ 
++    ldflags:[LDFLAGS_FOR_BENCH_SUITE],
++
+     cppflags:[
+         "-Wno-abstract-vbase-init",
+         "-Wno-c++98-compat",
+@@ -940,6 +943,9 @@ cc_test {
+         "skia_tool_deps"
+     ],
+ 
++    cflags: [CFLAGS_FOR_BENCH_SUITE],
 +    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
- 
-     export_include_dirs: [
-         "include/android/",
-@@ -1603,8 +1605,11 @@ cc_test {
- 
-     cflags: [
-         "-Wno-unused-parameter",
-+        CFLAGS_FOR_BENCH_SUITE
++
+     local_include_dirs: [
+         "experimental/svg/model/",
+         "gm/",
+@@ -1701,6 +1707,9 @@ cc_test {
+         "skia_tool_deps"
      ],
  
++    cflags: [CFLAGS_FOR_BENCH_SUITE],
 +    ldflags: [LDFLAGS_FOR_BENCH_SUITE],
 +
      local_include_dirs: [
diff --git a/autotest.diff b/autotest.diff
index 798fdcf..0b7f822 100644
--- a/autotest.diff
+++ b/autotest.diff
@@ -237,7 +237,7 @@
 +parallel_simple(run_dex2oat, machines)
 diff --git a/server/site_tests/android_Hwui/android_Hwui.py b/server/site_tests/android_Hwui/android_Hwui.py
 new file mode 100644
-index 000000000..9a1accb09
+index 000000000..21e77fd54
 --- /dev/null
 +++ b/server/site_tests/android_Hwui/android_Hwui.py
 @@ -0,0 +1,67 @@
@@ -663,10 +663,10 @@
 +parallel_simple(run_set_device_test, machines)
 diff --git a/server/site_tests/android_Skia/android_Skia.py b/server/site_tests/android_Skia/android_Skia.py
 new file mode 100644
-index 000000000..fc8d09dab
+index 000000000..80b39a027
 --- /dev/null
 +++ b/server/site_tests/android_Skia/android_Skia.py
-@@ -0,0 +1,65 @@
+@@ -0,0 +1,59 @@
 +# Tests for android Skia
 +from __future__ import print_function
 +
@@ -687,10 +687,6 @@
 +                              'out/target/product/' + bench_config.product)
 +
 +        # Set binary directories
-+        lib_dir = os.path.join(out_dir, 'system/lib/libskia.so')
-+        lib_dir_DUT = '/system/lib/libskia.so'
-+        lib64_dir = os.path.join(out_dir, 'system/lib64/libskia.so')
-+        lib64_dir_DUT = '/system/lib64/libskia.so'
 +        bench_dir = os.path.join(out_dir,
 +                                 'data/nativetest64/',
 +                                 'skia_nanobench/skia_nanobench')
@@ -699,8 +695,6 @@
 +        # Push binary to the device
 +        print('Pushing Skia benchmark onto device!')
 +        host.send_file(bench_dir, bench_dir_DUT, delete_dest=True)
-+        host.send_file(lib_dir, lib_dir_DUT, delete_dest=True)
-+        host.send_file(lib64_dir, lib64_dir_DUT, delete_dest=True)
 +
 +        # Make sure the binary is executable
 +        self.client.run('chmod u+x ' + bench_dir_DUT)
diff --git a/panorama.diff b/panorama.diff
index 42c9b5d..87f0746 100644
--- a/panorama.diff
+++ b/panorama.diff
@@ -2302,10 +2302,10 @@
 +#endif
 diff --git a/benchmark/feature_mos/src/mosaic/Blend.cpp b/benchmark/feature_mos/src/mosaic/Blend.cpp
 new file mode 100644
-index 00000000..b6a843a2
+index 00000000..625196c6
 --- /dev/null
 +++ b/benchmark/feature_mos/src/mosaic/Blend.cpp
-@@ -0,0 +1,1395 @@
+@@ -0,0 +1,1385 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -2444,10 +2444,8 @@
 +    global_rect.lft = global_rect.bot = 2e30; // min values
 +    global_rect.rgt = global_rect.top = -2e30; // max values
 +    MosaicFrame *mb = NULL;
-+    double halfwidth = width / 2.0;
-+    double halfheight = height / 2.0;
 +
-+    double z, x0, y0, x1, y1, x2, y2, x3, y3;
++    double x0, y0, x1, y1, x2, y2, x3, y3;
 +
 +    // Corners of the left-most and right-most frames respectively in the
 +    // mosaic coordinate system.
@@ -2943,9 +2941,6 @@
 +    ImageType uimg;
 +    ImageType vimg;
 +
-+    int cx = (int)imgMos.Y.width/2;
-+    int cy = (int)imgMos.Y.height/2;
-+
 +    // 2D boolean array that contains true wherever the mosaic image data is
 +    // invalid (i.e. in the gray border).
 +    bool **b = new bool*[imgMos.Y.height];
@@ -3114,7 +3109,6 @@
 +{
 +    PyramidShort *dptr = m_pMosaicYPyr;
 +
-+    int nC = m_wb.nlevsC;
 +    int l = (int) ((vcrect.lft - rect.left));
 +    int b = (int) ((vcrect.bot - rect.top));
 +    int r = (int) ((vcrect.rgt - rect.left));
@@ -3160,7 +3154,6 @@
 +                continue;
 +
 +            // scan the neighbors to see if this is a valid position
-+            unsigned char mask = (unsigned char) 255;
 +            SEdgeVector *ce;
 +            int ecnt;
 +            for (ce = csite->getNeighbor(), ecnt = csite->getNumNeighbors(); ecnt--; ce++)
@@ -3509,8 +3502,6 @@
 +    MosaicFrame *last = frames[frames_size-1];
 +    MosaicFrame *mb;
 +
-+    double fxpos = first->trs[0][2], fypos = first->trs[1][2];
-+
 +    double midX = last->width / 2.0;
 +    double midY = last->height / 2.0;
 +    double z = ProjZ(first->trs, midX, midY, 1.0);
@@ -3530,7 +3521,6 @@
 +        currY = ProjY(mb->trs, midX, midY, z, 1.0);
 +        double deltaX = currX - prevX;
 +        double deltaY = currY - prevY;
-+        double center2centerDist = sqrt(deltaY * deltaY + deltaX * deltaX);
 +
 +        if (fabs(deltaX) > STRIP_SEPARATION_THRESHOLD_PXLS ||
 +                fabs(deltaY) > STRIP_SEPARATION_THRESHOLD_PXLS)
@@ -3906,10 +3896,10 @@
 +#endif
 diff --git a/benchmark/feature_mos/src/mosaic/Delaunay.cpp b/benchmark/feature_mos/src/mosaic/Delaunay.cpp
 new file mode 100644
-index 00000000..0ce09fc5
+index 00000000..e8015dfd
 --- /dev/null
 +++ b/benchmark/feature_mos/src/mosaic/Delaunay.cpp
-@@ -0,0 +1,633 @@
+@@ -0,0 +1,631 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -4404,8 +4394,6 @@
 +// TRUE iff A, B, C form a counterclockwise oriented triangle
 +int CDelaunay::ccw(SitePointer a, SitePointer b, SitePointer c)
 +{
-+  int result;
-+
 +  double ax = sa[a].X();
 +  double bx = sa[b].X();
 +  double cx = sa[c].X();
@@ -4882,10 +4870,10 @@
 +
 diff --git a/benchmark/feature_mos/src/mosaic/ImageUtils.cpp b/benchmark/feature_mos/src/mosaic/ImageUtils.cpp
 new file mode 100644
-index 00000000..daa86060
+index 00000000..28629d34
 --- /dev/null
 +++ b/benchmark/feature_mos/src/mosaic/ImageUtils.cpp
-@@ -0,0 +1,408 @@
+@@ -0,0 +1,406 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -5003,8 +4991,7 @@
 +
 +ImageType ImageUtils::rgb2gray(ImageType in, int width, int height)
 +{
-+  int r,g,b, nr, ng, nb, val;
-+  ImageType gray = NULL;
++  int r,g,b;
 +  ImageType image = in;
 +  ImageType out = ImageUtils::allocateImage(width, height, 1);
 +  ImageType outCopy = out;
@@ -5033,8 +5020,7 @@
 +
 +ImageType ImageUtils::rgb2gray(ImageType out, ImageType in, int width, int height)
 +{
-+  int r,g,b, nr, ng, nb, val;
-+  ImageType gray = out;
++  int r,g,b;
 +  ImageType image = in;
 +  ImageType outCopy = out;
 +
@@ -6727,10 +6713,10 @@
 +#endif
 diff --git a/benchmark/feature_mos/src/mosaic/trsMatrix.cpp b/benchmark/feature_mos/src/mosaic/trsMatrix.cpp
 new file mode 100644
-index 00000000..5fc6a86b
+index 00000000..4c04e6c3
 --- /dev/null
 +++ b/benchmark/feature_mos/src/mosaic/trsMatrix.cpp
-@@ -0,0 +1,94 @@
+@@ -0,0 +1,93 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -6773,7 +6759,6 @@
 +// return: result if successful
 +int normProjMat33d(double m[3][3])
 +{
-+    double m22;
 +
 +    if(m[2][2] == 0.0)
 +        {
@@ -7333,10 +7318,10 @@
 +
 diff --git a/benchmark/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp b/benchmark/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp
 new file mode 100755
-index 00000000..fa56402e
+index 00000000..36f133f8
 --- /dev/null
 +++ b/benchmark/feature_mos/src/mosaic_renderer/SurfaceTextureRenderer.cpp
-@@ -0,0 +1,188 @@
+@@ -0,0 +1,186 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -7370,8 +7355,6 @@
 +};
 +GLushort g_iIndices2[] = { 0, 1, 2, 3 };
 +
-+const int GL_TEXTURE_EXTERNAL_OES_ENUM = 0x8D65;
-+
 +const int VERTEX_STRIDE = 6 * sizeof(GLfloat);
 +
 +SurfaceTextureRenderer::SurfaceTextureRenderer() : Renderer() {
@@ -7773,10 +7756,10 @@
 +}
 diff --git a/benchmark/feature_mos/src/mosaic_renderer/WarpRenderer.h b/benchmark/feature_mos/src/mosaic_renderer/WarpRenderer.h
 new file mode 100755
-index 00000000..8e9a694e
+index 00000000..aa3f50c0
 --- /dev/null
 +++ b/benchmark/feature_mos/src/mosaic_renderer/WarpRenderer.h
-@@ -0,0 +1,48 @@
+@@ -0,0 +1,44 @@
 +#pragma once
 +
 +#include "FrameBuffer.h"
@@ -7807,10 +7790,6 @@
 +    const char* VertexShaderSource() const;
 +    const char* FragmentShaderSource() const;
 +
-+    GLuint mTexHandle;                  // Handle to s_texture.
-+    GLuint mTexCoordHandle;             // Handle to a_texCoord.
-+    GLuint mTriangleVerticesHandle;     // Handle to vPosition.
-+
 +    // Attribute locations
 +    GLint  mPositionLoc;
 +    GLint  mAffinetransLoc;
@@ -10744,10 +10723,10 @@
 +#endif /*DB_FEATURE_DETECTION_H*/
 diff --git a/benchmark/feature_stab/db_vlvm/db_feature_matching.cpp b/benchmark/feature_stab/db_vlvm/db_feature_matching.cpp
 new file mode 100644
-index 00000000..d278d0cf
+index 00000000..891cac33
 --- /dev/null
 +++ b/benchmark/feature_stab/db_vlvm/db_feature_matching.cpp
-@@ -0,0 +1,3410 @@
+@@ -0,0 +1,3409 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -11377,7 +11356,6 @@
 +{
 +    float den;
 +    int f2sum,fsum;
-+    int xm_f=x_f-10;
 +    short f;
 +
 +    int xwi;
@@ -22455,10 +22433,10 @@
 +DOT_CLEANUP            = YES
 diff --git a/benchmark/feature_stab/src/dbreg/dbreg.cpp b/benchmark/feature_stab/src/dbreg/dbreg.cpp
 new file mode 100644
-index 00000000..da06aa2a
+index 00000000..986e255e
 --- /dev/null
 +++ b/benchmark/feature_stab/src/dbreg/dbreg.cpp
-@@ -0,0 +1,794 @@
+@@ -0,0 +1,793 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -22991,7 +22969,6 @@
 +    }
 +
 +  m_num_inlier_indices = inliercount;
-+  double frac=inliercount/totnummatches;
 +}
 +
 +//void db_FrameToReferenceRegistration::Polish(std::vector<int> &inlier_indices)
@@ -23842,10 +23819,10 @@
 +#endif
 diff --git a/benchmark/feature_stab/src/dbreg/dbstabsmooth.cpp b/benchmark/feature_stab/src/dbreg/dbstabsmooth.cpp
 new file mode 100644
-index 00000000..2bb5d2e5
+index 00000000..03608c69
 --- /dev/null
 +++ b/benchmark/feature_stab/src/dbreg/dbstabsmooth.cpp
-@@ -0,0 +1,330 @@
+@@ -0,0 +1,301 @@
 +/*
 + * Copyright (C) 2011 The Android Open Source Project
 + *
@@ -23869,9 +23846,6 @@
 +#define vp_copy_motion_no_id vp_copy_motion
 +///////////////////////////////////////////////////////////////////////////////////////////////////
 +
-+static bool vpmotion_add(VP_MOTION *in1, VP_MOTION *in2, VP_MOTION *out);
-+static bool vpmotion_multiply(VP_MOTION *in1, double factor, VP_MOTION *out);
-+
 +db_StabilizationSmoother::db_StabilizationSmoother()
 +{
 +    Init();
@@ -24150,32 +24124,6 @@
 +    return(true);
 +}
 +
-+
-+
-+static bool vpmotion_add(VP_MOTION *in1, VP_MOTION *in2, VP_MOTION *out)
-+{
-+    int i;
-+    if(in1 == NULL || in2 == NULL || out == NULL)
-+        return false;
-+
-+    for(i = 0; i < VP_MAX_MOTION_PAR; i++)
-+        out->par[i] = in1->par[i] + in2->par[i];
-+
-+    return true;
-+}
-+
-+static bool vpmotion_multiply(VP_MOTION *in1, double factor, VP_MOTION *out)
-+{
-+    int i;
-+    if(in1 == NULL || out == NULL)
-+        return false;
-+
-+    for(i = 0; i < VP_MAX_MOTION_PAR; i++)
-+        out->par[i] = in1->par[i] * factor;
-+
-+    return true;
-+}
-+
 diff --git a/benchmark/feature_stab/src/dbreg/dbstabsmooth.h b/benchmark/feature_stab/src/dbreg/dbstabsmooth.h
 new file mode 100644
 index 00000000..f03546ef