From 049833364d7dfff0fdbb694ffda7c61a078f68fa Mon Sep 17 00:00:00 2001 From: Ivaylo Asenov Date: Thu, 13 Oct 2016 17:12:52 +0300 Subject: Improve benchmark framework to create charts with MPAndroidChart. Fix bugs related to run test in "auto mode" and via "shell script" when row/view from gridview is not visible/not created yet. Add logic in shell script for pull file from device to chosen directory on the local machine. Change app icon to LGM logo. Add simple progress status in shell script. Change information button icon. LMG-1494: Adding "MPAndroidChart" open source library for creating charts with points based on a test elapsed time. Put logic for preventing app crash if some of tests are broken. LMG-1495: Add additional benchmarks to benchmark app: -Integrate: https://android-git.linaro.org/gitweb/platform/packages/apps/0xbench.git/tree/HEAD:/src/org/zeroxlab/graphics. -Integrate: https://android-git.linaro.org/gitweb/platform/packages/apps/0xbench.git/tree/HEAD:/src/org/zeroxlab/kubench. -Integrate: https://android-git.linaro.org/gitweb/platform/packages/apps/0xbench.git/tree/HEAD:/src/com/nea/nehe/lesson08. -Integrate: https://android-git.linaro.org/gitweb/platform/packages/apps/0xbench.git/tree/HEAD:/src/com/nea/nehe/lesson16. -Integrate: https://android-git.linaro.org/gitweb/platform/packages/apps/0xbench.git/tree/HEAD:/src/org/itri/teapot. Change-Id: I34d65f1f01736c045c1b6eaf3b905e8cd96d7740 Signed-off-by: Ivaylo Asenov --- BenchmarkFramework/Readme.txt | 23 +- BenchmarkFramework/app/app.iml | 1 + BenchmarkFramework/app/build.gradle | 1 + .../app/libs/mpandroidchartlibrary-2-2-4.jar | Bin 0 -> 604486 bytes .../app/src/main/AndroidManifest.xml | 25 +- .../java/graphics_benchmarks/graphics/DrawArc.java | 68 + .../graphics_benchmarks/graphics/DrawArcView.java | 88 + .../graphics_benchmarks/graphics/DrawCircle.java | 137 ++ .../graphics_benchmarks/graphics/DrawCircle2.java | 65 + .../graphics/DrawCircle2View.java | 82 + .../graphics_benchmarks/graphics/DrawImage.java | 68 + .../graphics/DrawImageView.java | 106 ++ .../graphics_benchmarks/graphics/DrawRect.java | 65 + .../graphics_benchmarks/graphics/DrawRectView.java | 96 + .../graphics_benchmarks/graphics/DrawText.java | 66 + .../graphics_benchmarks/graphics/DrawTextView.java | 117 ++ .../java/graphics_benchmarks/graphics/Tester.java | 284 +++ .../java/graphics_benchmarks/kubench/Cube.java | 57 + .../java/graphics_benchmarks/kubench/GLColor.java | 48 + .../java/graphics_benchmarks/kubench/GLFace.java | 94 + .../java/graphics_benchmarks/kubench/GLShape.java | 102 ++ .../graphics_benchmarks/kubench/GLSurfaceView.java | 322 ++++ .../java/graphics_benchmarks/kubench/GLVertex.java | 88 + .../java/graphics_benchmarks/kubench/GLWorld.java | 98 + .../java/graphics_benchmarks/kubench/Kubench.java | 388 ++++ .../java/graphics_benchmarks/kubench/Layer.java | 101 + .../main/java/graphics_benchmarks/kubench/M4.java | 80 + .../java/graphics_benchmarks/lesson08/Cube.java | 339 ++++ .../graphics_benchmarks/lesson08/Lesson08.java | 339 ++++ .../graphics_benchmarks/lesson08/RunNehe08.java | 94 + .../java/graphics_benchmarks/lesson16/Cube.java | 345 ++++ .../graphics_benchmarks/lesson16/Lesson16.java | 366 ++++ .../graphics_benchmarks/lesson16/RunNehe16.java | 93 + .../teapot/MyGLSurfaceView.java | 43 + .../java/graphics_benchmarks/teapot/TeapotES.java | 80 + .../graphics_benchmarks/teapot/TeapotRenderer.java | 1921 ++++++++++++++++++++ .../iasenov/benchmarkframework/BaseBenchmark.java | 53 +- .../linaro/iasenov/benchmarkframework/Chart.java | 232 +++ .../iasenov/benchmarkframework/MainActivity.java | 299 ++- .../linaro/iasenov/benchmarkframework/Test1.java | 5 + .../linaro/iasenov/benchmarkframework/Test10.java | 5 + .../linaro/iasenov/benchmarkframework/Test11.java | 5 + .../linaro/iasenov/benchmarkframework/Test12.java | 8 + .../linaro/iasenov/benchmarkframework/Test13.java | 5 + .../linaro/iasenov/benchmarkframework/Test14.java | 5 + .../linaro/iasenov/benchmarkframework/Test15.java | 5 + .../linaro/iasenov/benchmarkframework/Test16.java | 72 + .../linaro/iasenov/benchmarkframework/Test17.java | 72 + .../linaro/iasenov/benchmarkframework/Test18.java | 72 + .../linaro/iasenov/benchmarkframework/Test19.java | 72 + .../linaro/iasenov/benchmarkframework/Test2.java | 5 + .../linaro/iasenov/benchmarkframework/Test20.java | 70 + .../linaro/iasenov/benchmarkframework/Test21.java | 72 + .../linaro/iasenov/benchmarkframework/Test22.java | 72 + .../linaro/iasenov/benchmarkframework/Test23.java | 72 + .../linaro/iasenov/benchmarkframework/Test24.java | 72 + .../linaro/iasenov/benchmarkframework/Test25.java | 72 + .../linaro/iasenov/benchmarkframework/Test3.java | 5 + .../linaro/iasenov/benchmarkframework/Test4.java | 5 + .../linaro/iasenov/benchmarkframework/Test5.java | 5 + .../linaro/iasenov/benchmarkframework/Test6.java | 5 + .../linaro/iasenov/benchmarkframework/Test7.java | 5 + .../linaro/iasenov/benchmarkframework/Test8.java | 5 + .../linaro/iasenov/benchmarkframework/Test9.java | 5 + .../src/main/res/drawable/buttonshape_chart.xml | 21 + .../app/src/main/res/drawable/crate.bmp | Bin 0 -> 66614 bytes .../app/src/main/res/drawable/glass.bmp | Bin 0 -> 49220 bytes .../app/src/main/res/drawable/icon.png | Bin 0 -> 14512 bytes .../app/src/main/res/drawable/information.png | Bin 2193 -> 12977 bytes .../app/src/main/res/drawable/lmg_logo.png | Bin 0 -> 2224 bytes .../app/src/main/res/drawable/lmg_logo_toolbar.png | Bin 0 -> 1214 bytes .../app/src/main/res/layout/activity_main.xml | 4 +- BenchmarkFramework/app/src/main/res/layout/arc.xml | 12 + .../app/src/main/res/layout/chart.xml | 40 + .../app/src/main/res/layout/circle2.xml | 12 + .../app/src/main/res/layout/image.xml | 12 + .../app/src/main/res/layout/listview.xml | 4 +- .../app/src/main/res/layout/rect.xml | 12 + .../app/src/main/res/layout/text.xml | 12 + .../app/src/main/res/mipmap-hdpi/lmg_logo.png | Bin 0 -> 2224 bytes .../app/src/main/res/mipmap-mdpi/lmg_logo.png | Bin 0 -> 2224 bytes .../app/src/main/res/mipmap-xhdpi/lmg_logo.png | Bin 0 -> 2224 bytes .../app/src/main/res/mipmap-xxhdpi/lmg_logo.png | Bin 0 -> 2224 bytes .../app/src/main/res/mipmap-xxxhdpi/lmg_logo.png | Bin 0 -> 2224 bytes .../app/src/main/res/values/styles.xml | 2 +- .../shellscript/runTestsFromShell.sh | 56 +- 86 files changed, 7744 insertions(+), 113 deletions(-) create mode 100644 BenchmarkFramework/app/libs/mpandroidchartlibrary-2-2-4.jar create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArc.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArcView.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2View.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImage.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImageView.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawRect.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawRectView.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawText.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawTextView.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/Tester.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Cube.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLColor.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLFace.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLShape.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLSurfaceView.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLVertex.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLWorld.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Kubench.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Layer.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/M4.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Cube.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Lesson08.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/RunNehe08.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Cube.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Lesson16.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/RunNehe16.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/MyGLSurfaceView.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotES.java create mode 100644 BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotRenderer.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Chart.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test16.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test17.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test18.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test19.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test20.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test21.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test22.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test23.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test24.java create mode 100644 BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test25.java create mode 100644 BenchmarkFramework/app/src/main/res/drawable/buttonshape_chart.xml create mode 100644 BenchmarkFramework/app/src/main/res/drawable/crate.bmp create mode 100644 BenchmarkFramework/app/src/main/res/drawable/glass.bmp create mode 100644 BenchmarkFramework/app/src/main/res/drawable/icon.png create mode 100644 BenchmarkFramework/app/src/main/res/drawable/lmg_logo.png create mode 100644 BenchmarkFramework/app/src/main/res/drawable/lmg_logo_toolbar.png create mode 100644 BenchmarkFramework/app/src/main/res/layout/arc.xml create mode 100644 BenchmarkFramework/app/src/main/res/layout/chart.xml create mode 100644 BenchmarkFramework/app/src/main/res/layout/circle2.xml create mode 100644 BenchmarkFramework/app/src/main/res/layout/image.xml create mode 100644 BenchmarkFramework/app/src/main/res/layout/rect.xml create mode 100644 BenchmarkFramework/app/src/main/res/layout/text.xml create mode 100644 BenchmarkFramework/app/src/main/res/mipmap-hdpi/lmg_logo.png create mode 100644 BenchmarkFramework/app/src/main/res/mipmap-mdpi/lmg_logo.png create mode 100644 BenchmarkFramework/app/src/main/res/mipmap-xhdpi/lmg_logo.png create mode 100644 BenchmarkFramework/app/src/main/res/mipmap-xxhdpi/lmg_logo.png create mode 100644 BenchmarkFramework/app/src/main/res/mipmap-xxxhdpi/lmg_logo.png diff --git a/BenchmarkFramework/Readme.txt b/BenchmarkFramework/Readme.txt index 216aabb..e95269d 100644 --- a/BenchmarkFramework/Readme.txt +++ b/BenchmarkFramework/Readme.txt @@ -5,7 +5,7 @@ This file includes a little info about "benchmarkframework" application. 1) The main target of the application is to run different benchmark tests integrated inside the app and written on (JAVA/C/C++) -2) There are 15 tests integrated for now: +2) There are 25 tests integrated for now: - "MemSpeed" // This benchmark is integrated as *so library and will be remove if not needed. Source code: http://www.roylongbottom.org.uk/android%20benchmarks.htm#anchor17 @@ -38,7 +38,20 @@ This file includes a little info about "benchmarkframework" application. - "Jit-out(ART)" - "Math(ART)" - "Micro(ART)" -- "Stanford(ART)" +- "Stanford(ART)" + +- "DrawArc(GPU)" //Source code: https://android-git.linaro.org/gitweb/platform/packages/apps/0xbench.git +- "DrawCircle2(GPU)" +- "DrawImage(GPU)" +- "DrawRect(GPU)" +- "DrawText(GPU)" +- "DrawCircle(GPU)" +- "Kubench(GPU)" +- "Nehe08(GPU)" +- "Nehe16(GPU)" +- "TeapotES(GPU)" + + 3)Functionality: @@ -46,15 +59,15 @@ This file includes a little info about "benchmarkframework" application. 3.1) Select one or more tests and run them by pressing [RUN TEST] button. After all selected tests are finished the results for them will be saved automaticaly 3.2) Pressing [RUN AUTO] button starts all tests one by one in row. After all tests are finished the results for them will be saved automaticaly 3.3) Pressing [i] button give some help about the usage - 3.4) [SAVE] button save result shown on UI (display) to text file (Not needed anymore and will be removed in future) - 3.5) Application "Settting" + 3.4) [CHART] button create chart for executed tests + 3.5) Application "Setting" 3.5.1) allow to select how many times tests will run (multiple times running) 3.5.2) allow to clear all data saved 3.5.3) allow to select file format for saving data ("txt" or "html") 3.5.4) show device and application information 3.6) Long press on results textview (area bellow buttons) shows listview with all saved files. Pressing on a file open file in HTMLViewer. Long press on a file allow file deletion 3.7) There is repeat test indicator in the main activity (red textview with digit inside) - 3.8) Posibitily of canceling running tests + 3.8) Possibility of canceling running tests 3.9) [HIDE/SHOW DISPLAY] button hide/show display with results diff --git a/BenchmarkFramework/app/app.iml b/BenchmarkFramework/app/app.iml index ef28018..c90b398 100644 --- a/BenchmarkFramework/app/app.iml +++ b/BenchmarkFramework/app/app.iml @@ -94,6 +94,7 @@ + diff --git a/BenchmarkFramework/app/build.gradle b/BenchmarkFramework/app/build.gradle index f6a03c0..f495af5 100644 --- a/BenchmarkFramework/app/build.gradle +++ b/BenchmarkFramework/app/build.gradle @@ -24,4 +24,5 @@ dependencies { //testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.android.support:design:23.1.0' + compile files('libs/mpandroidchartlibrary-2-2-4.jar') } diff --git a/BenchmarkFramework/app/libs/mpandroidchartlibrary-2-2-4.jar b/BenchmarkFramework/app/libs/mpandroidchartlibrary-2-2-4.jar new file mode 100644 index 0000000..e12a6cd Binary files /dev/null and b/BenchmarkFramework/app/libs/mpandroidchartlibrary-2-2-4.jar differ diff --git a/BenchmarkFramework/app/src/main/AndroidManifest.xml b/BenchmarkFramework/app/src/main/AndroidManifest.xml index ab057de..3944813 100644 --- a/BenchmarkFramework/app/src/main/AndroidManifest.xml +++ b/BenchmarkFramework/app/src/main/AndroidManifest.xml @@ -9,7 +9,7 @@ @@ -27,6 +27,29 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArc.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArc.java new file mode 100644 index 0000000..426a059 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArc.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + +import org.linaro.iasenov.benchmarkframework.R; + + +import android.app.Activity; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; + +import android.os.Bundle; +import android.os.SystemClock; +import android.view.View; + +import graphics_benchmarks.graphics.DrawArcView; + +public class DrawArc extends Tester { + /** Called when the activity is first created. */ + + private DrawArcView mView; + + public String getTag() { + return "DrawArc"; + } + + public int sleepBeforeStart() { + return 1000; + } + + public int sleepBetweenRound() { + return 0; + } + + public void oneRound() { + mView.doDraw(); + decreaseCounter(); + } + + + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.arc); + + mView = (DrawArcView) findViewById(R.id.arc); + + startTester(); + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArcView.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArcView.java new file mode 100644 index 0000000..b927b65 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawArcView.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.RectF; +import android.graphics.Color; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.util.AttributeSet; +import android.view.KeyEvent; +import android.view.SurfaceHolder; +import android.view.SurfaceView; +import android.view.View; +import android.widget.TextView; + +import android.util.Log; + +import java.util.ArrayList; +import java.util.Random; + + +class DrawArcView extends SurfaceView { + + private SurfaceHolder mSurfaceHolder; + private int angle = 0; + private int step = 5; + private boolean center = false; + + protected void doDraw() { + Canvas canvas = mSurfaceHolder.lockCanvas(); + drawArc(canvas); + mSurfaceHolder.unlockCanvasAndPost(canvas); + } + + private void drawArc(Canvas canvas) { + if (angle > 360) angle = 0; + + int color = (0x00252525 | new Random().nextInt() ) | Color.BLACK; + Paint p = new Paint(); + p.setAntiAlias(false); + p.setStyle(Paint.Style.FILL); + p.setColor(color); + + canvas.drawArc(new RectF(0,0, getWidth(), getHeight()), 0, angle, true, p); + + for(int j=0; j<3; j++) for(int x=0; x<4; x++) for(int y=0; y<4; y++) { + color = (0x88252525 | new Random().nextInt() ); + p = new Paint(); + p.setAntiAlias(false); + p.setStyle(Paint.Style.FILL); + p.setColor(color); + + if(x%2==0) + canvas.drawArc(new RectF( x*getWidth()/4, y*getHeight()/4, (1+x)*getWidth()/4, (1+y)*getHeight()/4), 0, angle, (x+y)%2 == 0, p); + else + canvas.drawArc(new RectF( x*getWidth()/4, y*getHeight()/4, (1+x)*getWidth()/4, (1+y)*getHeight()/4), 0, -angle, (x+y)%2 == 0, p); + } + angle += step; + } + + public DrawArcView(Context context, AttributeSet attrs) { + super(context, attrs); + mSurfaceHolder = getHolder(); + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle.java new file mode 100644 index 0000000..0c8a066 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle.java @@ -0,0 +1,137 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + + +import android.app.Activity; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; + +import android.os.Bundle; +import android.view.View; + +public class DrawCircle extends Tester { + /** Called when the activity is first created. */ + + SampleView mView; + + public String getTag() { + return "DrawCircle"; + } + + public int sleepBeforeStart() { + return 1000; + } + + public int sleepBetweenRound() { + return 0; + } + + public void oneRound() { + mView.postInvalidate(); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mView = new SampleView(this); + setContentView(mView); + } + + private class SampleView extends View { + private Paint[] mPaints; + private Paint mFramePaint; + + private float mSweep; + private int mBigIndex; + + private final float SWEEP_INC = 2; + private int counter = 0; + int i, row; + long current; + long last; + + public SampleView(Context context) { + super(context); + + mPaints = new Paint[4]; + + mPaints[0] = new Paint(); + mPaints[0].setAntiAlias(true); + mPaints[0].setStyle(Paint.Style.FILL); + mPaints[0].setColor(0x88FF0000); + + mPaints[1] = new Paint(mPaints[0]); + mPaints[1].setColor(0x8800FF00); + + mPaints[2] = new Paint(mPaints[0]); + mPaints[2].setStyle(Paint.Style.STROKE); + mPaints[2].setStrokeWidth(4); + mPaints[2].setColor(0x880000FF); + + mPaints[3] = new Paint(mPaints[2]); + mPaints[3].setColor(0x88888888); + + mFramePaint = new Paint(); + mFramePaint.setAntiAlias(true); + mFramePaint.setTextSize(40); + mFramePaint.setStyle(Paint.Style.STROKE); + mFramePaint.setStrokeWidth(0); + } + + @Override + protected void onWindowVisibilityChanged(int visibility) { + super.onWindowVisibilityChanged(visibility); + if (visibility != View.VISIBLE) { + return; + } + + startTester(); + } + + @Override + protected void onDraw(Canvas canvas) { + canvas.drawColor(Color.WHITE); + + canvas.drawCircle(160f, 150f, 120f, mPaints[mBigIndex]); + canvas.drawText(counter + "th time", 30, 160, mFramePaint); + canvas.drawText((current - last) + "ms", 30, 200, mFramePaint); + + for (row = 0; row < 8; row++) { + for (i = 0; i < 4; i++) { + canvas.drawCircle(40.0f + i * 80, 40.0f + row * 60, mSweep, + mPaints[i]); + } + } + + mSweep += SWEEP_INC; + if (mSweep > 80) { + mSweep -= 80; + mBigIndex = (mBigIndex + 1) % 4; + counter++; + last = current; + current = System.currentTimeMillis(); + + } + + invalidate(); + decreaseCounter(); + } + } +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2.java new file mode 100644 index 0000000..5e486fb --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + + + +import android.app.Activity; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; + +import android.os.Bundle; +import android.view.View; + +import org.linaro.iasenov.benchmarkframework.R; +import graphics_benchmarks.graphics.DrawCircle2View; + +public class DrawCircle2 extends Tester { + /** Called when the activity is first created. */ + + private DrawCircle2View mView; + + public String getTag() { + return "DrawCircle2"; + } + + public int sleepBeforeStart() { + return 1000; + } + + public int sleepBetweenRound() { + return 0; + } + + public void oneRound() { + mView.doDraw(); + decreaseCounter(); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.circle2); + + mView = (DrawCircle2View) findViewById(R.id.circle2); + + startTester(); + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2View.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2View.java new file mode 100644 index 0000000..a286536 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawCircle2View.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.RectF; +import android.graphics.Color; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.util.AttributeSet; +import android.view.KeyEvent; +import android.view.SurfaceHolder; +import android.view.SurfaceView; +import android.view.View; +import android.widget.TextView; + +import android.util.Log; + +import java.util.ArrayList; +import java.util.Random; + + +class DrawCircle2View extends SurfaceView { + + private SurfaceHolder mSurfaceHolder; + + protected void doDraw() { + Canvas canvas = mSurfaceHolder.lockCanvas(); + drawCircle(canvas); + mSurfaceHolder.unlockCanvasAndPost(canvas); + } + + private void drawCircle(Canvas canvas) { + + Random mRandom = new Random(); + + int height = getHeight(); + int width = getWidth(); + + int cx = (int)((mRandom.nextInt() % (width*0.8) ) + (width*0.1)); + int cy = (int)((mRandom.nextInt() % (height*0.8) ) + (height*0.1)); + int r = (int)((mRandom.nextInt() % (width*0.3) ) + (width*0.2)); + + int color; + Paint p; + for(int i=6; i>=0; i--) { + color = (0x33252525 | mRandom.nextInt()); + p = new Paint(); + p.setAntiAlias(true); + p.setStyle(Paint.Style.FILL); + p.setColor(color); + canvas.drawCircle(cx, cy, (int)(r*(1 + i/10.0)), p); + } + } + + public DrawCircle2View(Context context, AttributeSet attrs) { + super(context, attrs); + mSurfaceHolder = getHolder(); + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImage.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImage.java new file mode 100644 index 0000000..4059056 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImage.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + +import org.linaro.iasenov.benchmarkframework.R; + +import android.app.Activity; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; + +import android.os.Bundle; +import android.view.View; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; + + + +public class DrawImage extends Tester { + /** Called when the activity is first created. */ + + private DrawImageView mView; + + public String getTag() { + return "DrawImage"; + } + + public int sleepBeforeStart() { + return 1000; + } + + public int sleepBetweenRound() { + return 0; + } + + public void oneRound() { + mView.doDraw(); + decreaseCounter(); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.image); + + mView = (DrawImageView) findViewById(R.id.image); + Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.icon); + mView.setImage(bmp); + + startTester(); + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImageView.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImageView.java new file mode 100644 index 0000000..09c8a89 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawImageView.java @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + + + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.RectF; +import android.graphics.Color; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.util.AttributeSet; +import android.view.KeyEvent; +import android.view.SurfaceHolder; +import android.view.SurfaceView; +import android.view.View; +import android.widget.TextView; + +import android.util.Log; + +import java.util.ArrayList; +import java.util.Random; + + +class DrawImageView extends SurfaceView { + + private final int COL = 5; + private final int ROW = 9; + + private SurfaceHolder mSurfaceHolder; + private float position[] = new float[ROW]; + private boolean direction[] = new boolean[ROW]; + private Bitmap mBitmap; + private Paint bgPaint; + + + protected void setImage(Bitmap bmp) { + mBitmap = bmp; + } + + protected void doDraw() { + Canvas canvas = mSurfaceHolder.lockCanvas(); + drawImage(canvas); + mSurfaceHolder.unlockCanvasAndPost(canvas); + } + + private void drawImage(Canvas canvas) { + int w = getWidth(); + int h = getHeight(); + canvas.drawRect(0,0,w,h,bgPaint); + + for(int x=0; x= getHeight()) + direction[x] = !direction[x]; + } else { + position[x] -= speed; + if (position[x] <= 0) + direction[x] = !direction[x]; + } + + } + } + + public DrawImageView(Context context, AttributeSet attrs) { + super(context, attrs); + mSurfaceHolder = getHolder(); + bgPaint = new Paint(); + bgPaint.setColor(Color.BLACK); + bgPaint.setStyle(Paint.Style.FILL); + + for(int i=0; i rectengleList = new ArrayList(); + + protected void doDraw() { + Canvas canvas = mSurfaceHolder.lockCanvas(); + generateNewRect(); + drawAll(canvas); + mSurfaceHolder.unlockCanvasAndPost(canvas); + } + + private void drawAll(Canvas canvas) { + for(ColoredRect cr : rectengleList) { + Paint p = new Paint(); + p.setAntiAlias(false); + p.setStyle(Paint.Style.FILL); + p.setColor(cr.mColor); + + canvas.drawRect(cr.mRect, p); + } + } + + private void generateNewRect() { + Random mRandom = new Random(); + int height = getHeight(); + int width = getWidth(); + + int cx = (int)((mRandom.nextInt() % (width*0.8) ) + (width*0.1)); + int cy = (int)((mRandom.nextInt() % (height*0.8) ) + (height*0.1)); + int hw = (int)(mRandom.nextInt() % (width*0.4) + width*0.2)/2; + int hh = (int)(mRandom.nextInt() % (height*0.4) + height*0.2)/2; + + int color = (0x00252525 | mRandom.nextInt() ) & 0x00FFFFFF | 0x77000000; + + rectengleList.add(new ColoredRect(color, cx-hw, cy-hh, cx+hw, cy+hh)); + } + + public DrawRectView(Context context, AttributeSet attrs) { + super(context, attrs); + mSurfaceHolder = getHolder(); + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawText.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawText.java new file mode 100644 index 0000000..2910d8d --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawText.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + +import org.linaro.iasenov.benchmarkframework.R; + + + +import android.app.Activity; +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; + +import android.os.Bundle; +import android.view.View; + +import graphics_benchmarks.graphics.DrawTextView; + +public class DrawText extends Tester { + /** Called when the activity is first created. */ + + private DrawTextView mView; + + public String getTag() { + return "DrawText"; + } + + public int sleepBeforeStart() { + return 1000; + } + + public int sleepBetweenRound() { + return 0; + } + + public void oneRound() { + mView.doDraw(); + decreaseCounter(); + } + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.text); + + mView = (DrawTextView) findViewById(R.id.text); + + startTester(); + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawTextView.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawTextView.java new file mode 100644 index 0000000..5da5ecc --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/graphics/DrawTextView.java @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.graphics; + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.Rect; +import android.graphics.Color; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.util.AttributeSet; +import android.view.KeyEvent; +import android.view.SurfaceHolder; +import android.view.SurfaceView; +import android.view.View; +import android.widget.TextView; + +import android.util.Log; + +import java.util.ArrayList; +import java.util.Random; + + +class DrawTextView extends SurfaceView { + + public final String TEXT1 = "0xbench"; + public final String TEXT2 = "0xlab"; + public final int TIMES = 10; + + private Paint bgPaint; + + class PaintText { + public int x; + public int y; + public Paint paint; + public boolean text; + PaintText(Paint paint, int x, int y, boolean text) { + this.paint = paint; + this.x = x; + this.y = y; + this.text = text; + } + } + + private SurfaceHolder mSurfaceHolder; + private ArrayList rectengleList = new ArrayList(); + + protected void doDraw() { + Canvas canvas = mSurfaceHolder.lockCanvas(); + generateNewText(canvas); + mSurfaceHolder.unlockCanvasAndPost(canvas); + } + + private void generateNewText(Canvas canvas) { + Random mRandom = new Random(); + int height = getHeight(); + int width = getWidth(); + canvas.drawRect(0,0,width,height,bgPaint); + + int cx; + int cy; + int color; + for(int i=0; i mVertexList = new ArrayList(); + private GLColor mColor; +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLShape.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLShape.java new file mode 100644 index 0000000..e1e1dad --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLShape.java @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.kubench; + +import java.nio.ShortBuffer; +import java.util.ArrayList; +import java.util.Iterator; + +public class GLShape { + + public GLShape(GLWorld world) { + mWorld = world; + } + + public void addFace(GLFace face) { + mFaceList.add(face); + } + + public void setFaceColor(int face, GLColor color) { + mFaceList.get(face).setColor(color); + } + + public void putIndices(ShortBuffer buffer) { + Iterator iter = mFaceList.iterator(); + while (iter.hasNext()) { + GLFace face = iter.next(); + face.putIndices(buffer); + } + } + + public int getIndexCount() { + int count = 0; + Iterator iter = mFaceList.iterator(); + while (iter.hasNext()) { + GLFace face = iter.next(); + count += face.getIndexCount(); + } + return count; + } + + public GLVertex addVertex(float x, float y, float z) { + + // look for an existing GLVertex first + Iterator iter = mVertexList.iterator(); + while (iter.hasNext()) { + GLVertex vertex = iter.next(); + if (vertex.x == x && vertex.y == y && vertex.z == z) { + return vertex; + } + } + + // doesn't exist, so create new vertex + GLVertex vertex = mWorld.addVertex(x, y, z); + mVertexList.add(vertex); + return vertex; + } + + public void animateTransform(M4 transform) { + mAnimateTransform = transform; + + if (mTransform != null) + transform = mTransform.multiply(transform); + + Iterator iter = mVertexList.iterator(); + while (iter.hasNext()) { + GLVertex vertex = iter.next(); + mWorld.transformVertex(vertex, transform); + } + } + + public void startAnimation() { + } + + public void endAnimation() { + if (mTransform == null) { + mTransform = new M4(mAnimateTransform); + } else { + mTransform = mTransform.multiply(mAnimateTransform); + } + } + + public M4 mTransform; + public M4 mAnimateTransform; + protected ArrayList mFaceList = new ArrayList(); + protected ArrayList mVertexList = new ArrayList(); + protected ArrayList mIndexList = new ArrayList(); // make more efficient? + protected GLWorld mWorld; +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLSurfaceView.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLSurfaceView.java new file mode 100644 index 0000000..2096024 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLSurfaceView.java @@ -0,0 +1,322 @@ +/* + * Copyright (C) 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.kubench; + +import graphics_benchmarks.graphics.Tester; + +import android.app.Activity; +import android.content.Context; +import android.util.Log; +import android.view.SurfaceHolder; +import android.view.SurfaceView; + +import javax.microedition.khronos.egl.*; +import javax.microedition.khronos.opengles.*; + + +/** + * Example of how to use OpenGL|ES in a custom view + * + */ +public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback { + SurfaceHolder mHolder; + private GLThread mGLThread; + private GLWorld mWorld; + private float mAngle; + private GLSurfaceViewClient mClient; + private Tester mTester; + + /** + * The View constructor is a good place to allocate our OpenGL context + */ + public GLSurfaceView(Context context, GLWorld world, Tester tester) { + super(context); + mTester = tester; + mWorld = world; + mHolder = getHolder(); + mHolder.addCallback(this); + mHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU); + } + + public void surfaceCreated(SurfaceHolder holder) { + // The Surface has been created, start our main acquisition thread. + Log.d("GLSurfaceView", "surfaceCreated"); + mGLThread = new GLThread(); + mGLThread.start(); + } + + public void surfaceDestroyed(SurfaceHolder holder) { + // Surface will be destroyed when we return + Log.d("GLSurfaceView", "surfaceDestroyed"); + mGLThread.requestExitAndWait(); + mGLThread = null; + } + + public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { + // Surface size or format has changed. This should not happen in this + // example. + Log.d("GLSurfaceView", "surfaceChanged"); + mGLThread.onWindowResize(w, h); + } + + public float getAngle() { + return mAngle; + } + + public void setAngle(float angle) { + mAngle = angle; + } + + public void setClient(GLSurfaceViewClient client) { + mClient = client; + } + + // ---------------------------------------------------------------------- + + public interface GLSurfaceViewClient { + public void animate(); + } + + public float getFramerate() { + return mGLThread.getFramerate(); + } + + // ---------------------------------------------------------------------- + + class GLThread extends Thread { + private boolean mDone; + private int mWidth; + private int mHeight; + private float mFramerate; + + GLThread() { + super(); + mDone = false; + mWidth = 0; + mHeight = 0; + mFramerate = 0.0f; + } + + public float getFramerate() { + return mFramerate; + } + + @Override + public void run() { + /* + * Get an EGL instance + */ + EGL10 egl = (EGL10)EGLContext.getEGL(); + + /* + * Get to the default display. + */ + EGLDisplay dpy = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); + + /* + * We can now initialize EGL for that display + */ + int[] version = new int[2]; + egl.eglInitialize(dpy, version); + + /* + * Specify a configuration for our opengl session + * and grab the first configuration that matches is + */ + int[] configSpec = { + EGL10.EGL_DEPTH_SIZE, 16, + EGL10.EGL_NONE + }; + EGLConfig[] configs = new EGLConfig[1]; + int[] num_config = new int[1]; + egl.eglChooseConfig(dpy, configSpec, configs, 1, num_config); + EGLConfig config = configs[0]; + + /* + * Create an OpenGL ES context. This must be done only once, an + * OpenGL context is a somewhat heavy object. + */ + EGLContext context = egl.eglCreateContext(dpy, config, + EGL10.EGL_NO_CONTEXT, null); + + /* + * Create an EGL surface we can render into. + */ + EGLSurface surface = egl.eglCreateWindowSurface(dpy, config, mHolder, null); + + /* + * Before we can issue GL commands, we need to make sure + * the context is current and bound to a surface. + */ + egl.eglMakeCurrent(dpy, surface, surface, context); + + /* + * Get to the appropriate GL interface. + * This is simply done by casting the GL context to either + * GL10 or GL11. + */ + GL10 gl = (GL10)context.getGL(); + + + /* + * Some one-time OpenGL initialization can be made here + * probably based on features of this particular context + */ + gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST); + + + // This is our main acquisition thread's loop, we go until + // asked to quit. + long starttime=0, stoptime=0, drawcount=0; + long startTester = System.currentTimeMillis(); + while (!mDone) { + // Update the asynchronous state (window size, key events) + int w, h; + synchronized(this) { + w = mWidth; + h = mHeight; + } + if (starttime == 0) { + starttime = System.currentTimeMillis(); + } + + /* draw a frame here */ + drawFrame(gl, w, h); + + /* + * Once we're done with GL, we need to call post() + */ + egl.eglSwapBuffers(dpy, surface); + gl.glFinish(); + mTester.decreaseCounter(); + mDone = mTester.isTesterFinished(); + drawcount++; + stoptime = System.currentTimeMillis(); + if (stoptime - starttime >= 1) { + mFramerate = (float)(1000 * drawcount)/(float)(stoptime - starttime); + drawcount = 0; + } + + /* + * Always check for EGL_CONTEXT_LOST, which means the context + * and all associated data were lost (For instance because + * the device went to sleep). We need to quit immediately. + */ + if (egl.eglGetError() == EGL11.EGL_CONTEXT_LOST) { + // we lost the gpu, quit immediately + Context c = getContext(); + if (c instanceof Activity) { + ((Activity)c).finish(); + } + } + } + + long stopTester = System.currentTimeMillis(); + /* + * clean-up everything... + */ + egl.eglMakeCurrent(dpy, + EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); + egl.eglDestroyContext(dpy, context); + egl.eglDestroySurface(dpy, surface); + egl.eglTerminate(dpy); + mTester.finishTester(startTester, stopTester); + } + + private void drawFrame(GL10 gl, int w, int h) { + gl.glViewport(0, 0, w, h); + + /* + * Set our projection matrix. This doesn't have to be done + * each time we draw, but usually a new projection needs to be set + * when the viewport is resized. + */ + + float ratio = (float)w / h; + gl.glMatrixMode(GL10.GL_PROJECTION); + gl.glLoadIdentity(); + gl.glFrustumf(-ratio, ratio, -1, 1, 2, 12); + + /* + * By default, OpenGL enables features that improve quality + * but reduce performance. One might want to tweak that + * especially on software renderer. + */ + gl.glDisable(GL10.GL_DITHER); + gl.glActiveTexture(GL10.GL_TEXTURE0); + gl.glBindTexture(GL10.GL_TEXTURE_2D, 0); + gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); + gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); + gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST); + gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); + gl.glTexEnvx(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_REPLACE); + + /* + * Usually, the first thing one might want to do is to clear + * the screen. The most efficient way of doing this is to use + * glClear(). However we must make sure to set the scissor + * correctly first. The scissor is always specified in window + * coordinates: + */ + + gl.glClearColor(0.5f,0.5f,0.5f,1); + gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); + + /* + * Now we're ready to draw some 3D object + */ + + gl.glMatrixMode(GL10.GL_MODELVIEW); + gl.glLoadIdentity(); + gl.glTranslatef(0, 0, -3.0f); + gl.glScalef(0.5f, 0.5f, 0.5f); + gl.glRotatef(mAngle, 0, 1, 0); + gl.glRotatef(mAngle*0.25f, 1, 0, 0); + + gl.glColor4f(0.7f, 0.7f, 0.7f, 1.0f); + gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); + gl.glEnableClientState(GL10.GL_COLOR_ARRAY); + gl.glEnable(GL10.GL_CULL_FACE); + gl.glShadeModel(GL10.GL_SMOOTH); + gl.glEnable(GL10.GL_DEPTH_TEST); + + mWorld.draw(gl); + + if (mClient != null) { + mClient.animate(); + } + } + + public void onWindowResize(int w, int h) { + synchronized(this) { + mWidth = w; + mHeight = h; + } + } + + public void requestExitAndWait() { + // don't call this from GLThread thread or it a guaranteed + // deadlock! + mDone = true; + try { + join(); + } catch (InterruptedException ex) { } + } + } +} + + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLVertex.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLVertex.java new file mode 100644 index 0000000..80dd692 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLVertex.java @@ -0,0 +1,88 @@ +/* + * Copyright (C) 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.kubench; + +import java.nio.IntBuffer; + +public class GLVertex { + + public float x; + public float y; + public float z; + final short index; // index in vertex table + GLColor color; + + GLVertex() { + this.x = 0; + this.y = 0; + this.z = 0; + this.index = -1; + } + + GLVertex(float x, float y, float z, int index) { + this.x = x; + this.y = y; + this.z = z; + this.index = (short)index; + } + + public boolean equals(Object other) { + if (other instanceof GLVertex) { + GLVertex v = (GLVertex)other; + return (x == v.x && y == v.y && z == v.z); + } + return false; + } + + static public int toFixed(float x) { + return (int)(x*65536.0f); + } + + public void put(IntBuffer vertexBuffer, IntBuffer colorBuffer) { + vertexBuffer.put(toFixed(x)); + vertexBuffer.put(toFixed(y)); + vertexBuffer.put(toFixed(z)); + if (color == null) { + colorBuffer.put(0); + colorBuffer.put(0); + colorBuffer.put(0); + colorBuffer.put(0); + } else { + colorBuffer.put(color.red); + colorBuffer.put(color.green); + colorBuffer.put(color.blue); + colorBuffer.put(color.alpha); + } + } + + public void update(IntBuffer vertexBuffer, M4 transform) { + // skip to location of vertex in mVertex buffer + vertexBuffer.position(index * 3); + + if (transform == null) { + vertexBuffer.put(toFixed(x)); + vertexBuffer.put(toFixed(y)); + vertexBuffer.put(toFixed(z)); + } else { + GLVertex temp = new GLVertex(); + transform.multiply(this, temp); + vertexBuffer.put(toFixed(temp.x)); + vertexBuffer.put(toFixed(temp.y)); + vertexBuffer.put(toFixed(temp.z)); + } + } +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLWorld.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLWorld.java new file mode 100644 index 0000000..714279e --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/GLWorld.java @@ -0,0 +1,98 @@ +/* + * Copyright (C) 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.kubench; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.IntBuffer; +import java.nio.ShortBuffer; +import java.util.Iterator; +import java.util.ArrayList; + +import javax.microedition.khronos.opengles.GL10; + +public class GLWorld { + + public void addShape(GLShape shape) { + mShapeList.add(shape); + mIndexCount += shape.getIndexCount(); + } + + public void generate() { + ByteBuffer bb = ByteBuffer.allocateDirect(mVertexList.size()*4*4); + bb.order(ByteOrder.nativeOrder()); + mColorBuffer = bb.asIntBuffer(); + + bb = ByteBuffer.allocateDirect(mVertexList.size()*4*3); + bb.order(ByteOrder.nativeOrder()); + mVertexBuffer = bb.asIntBuffer(); + + bb = ByteBuffer.allocateDirect(mIndexCount*2); + bb.order(ByteOrder.nativeOrder()); + mIndexBuffer = bb.asShortBuffer(); + + Iterator iter2 = mVertexList.iterator(); + while (iter2.hasNext()) { + GLVertex vertex = iter2.next(); + vertex.put(mVertexBuffer, mColorBuffer); + } + + Iterator iter3 = mShapeList.iterator(); + while (iter3.hasNext()) { + GLShape shape = iter3.next(); + shape.putIndices(mIndexBuffer); + } + } + + public GLVertex addVertex(float x, float y, float z) { + GLVertex vertex = new GLVertex(x, y, z, mVertexList.size()); + mVertexList.add(vertex); + return vertex; + } + + public void transformVertex(GLVertex vertex, M4 transform) { + vertex.update(mVertexBuffer, transform); + } + + int count = 0; + public void draw(GL10 gl) + { + mColorBuffer.position(0); + mVertexBuffer.position(0); + mIndexBuffer.position(0); + + gl.glFrontFace(GL10.GL_CW); + gl.glShadeModel(GL10.GL_FLAT); + gl.glVertexPointer(3, GL10.GL_FIXED, 0, mVertexBuffer); + gl.glColorPointer(4, GL10.GL_FIXED, 0, mColorBuffer); + gl.glDrawElements(GL10.GL_TRIANGLES, mIndexCount, GL10.GL_UNSIGNED_SHORT, mIndexBuffer); + count++; + } + + static public float toFloat(int x) { + return x/65536.0f; + } + + private ArrayList mShapeList = new ArrayList(); + private ArrayList mVertexList = new ArrayList(); + + private int mIndexCount = 0; + + private IntBuffer mVertexBuffer; + private IntBuffer mColorBuffer; + private ShortBuffer mIndexBuffer; +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Kubench.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Kubench.java new file mode 100644 index 0000000..4304577 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Kubench.java @@ -0,0 +1,388 @@ +/* + * Copyright (C) 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.kubench; + +import graphics_benchmarks.graphics.Tester; + +import android.app.Activity; +import android.graphics.PixelFormat; +import android.os.Bundle; +import android.util.Log; +import android.view.KeyEvent; + +import java.util.Random; + +public class Kubench extends Tester implements GLSurfaceView.GLSurfaceViewClient { + + public final String TAG = "Kubench"; + public final static String PACKAGE = "org.zeroxlab.kubench"; + + public String getTag() { + return TAG; + } + + public static String getFullClassName() { + return PACKAGE + ".Kubench"; + } + + public int sleepBeforeStart() { + return 1000; //1 second + } + + public int sleepBetweenRound() { + return 0; + } + + public void oneRound() { + // do nothing; + } + + private GLWorld makeGLWorld() + { + GLWorld world = new GLWorld(); + + int one = 0x10000; + int half = 0x08000; + GLColor red = new GLColor(one, 0, 0); + GLColor green = new GLColor(0, one, 0); + GLColor blue = new GLColor(0, 0, one); + GLColor yellow = new GLColor(one, one, 0); + GLColor orange = new GLColor(one, half, 0); + GLColor white = new GLColor(one, one, one); + GLColor black = new GLColor(0, 0, 0); + + // coordinates for our cubes + float c0 = -1.0f; + float c1 = -0.38f; + float c2 = -0.32f; + float c3 = 0.32f; + float c4 = 0.38f; + float c5 = 1.0f; + + // top back, left to right + mCubes[0] = new Cube(world, c0, c4, c0, c1, c5, c1); + mCubes[1] = new Cube(world, c2, c4, c0, c3, c5, c1); + mCubes[2] = new Cube(world, c4, c4, c0, c5, c5, c1); + // top middle, left to right + mCubes[3] = new Cube(world, c0, c4, c2, c1, c5, c3); + mCubes[4] = new Cube(world, c2, c4, c2, c3, c5, c3); + mCubes[5] = new Cube(world, c4, c4, c2, c5, c5, c3); + // top front, left to right + mCubes[6] = new Cube(world, c0, c4, c4, c1, c5, c5); + mCubes[7] = new Cube(world, c2, c4, c4, c3, c5, c5); + mCubes[8] = new Cube(world, c4, c4, c4, c5, c5, c5); + // middle back, left to right + mCubes[9] = new Cube(world, c0, c2, c0, c1, c3, c1); + mCubes[10] = new Cube(world, c2, c2, c0, c3, c3, c1); + mCubes[11] = new Cube(world, c4, c2, c0, c5, c3, c1); + // middle middle, left to right + mCubes[12] = new Cube(world, c0, c2, c2, c1, c3, c3); + mCubes[13] = null; + mCubes[14] = new Cube(world, c4, c2, c2, c5, c3, c3); + // middle front, left to right + mCubes[15] = new Cube(world, c0, c2, c4, c1, c3, c5); + mCubes[16] = new Cube(world, c2, c2, c4, c3, c3, c5); + mCubes[17] = new Cube(world, c4, c2, c4, c5, c3, c5); + // bottom back, left to right + mCubes[18] = new Cube(world, c0, c0, c0, c1, c1, c1); + mCubes[19] = new Cube(world, c2, c0, c0, c3, c1, c1); + mCubes[20] = new Cube(world, c4, c0, c0, c5, c1, c1); + // bottom middle, left to right + mCubes[21] = new Cube(world, c0, c0, c2, c1, c1, c3); + mCubes[22] = new Cube(world, c2, c0, c2, c3, c1, c3); + mCubes[23] = new Cube(world, c4, c0, c2, c5, c1, c3); + // bottom front, left to right + mCubes[24] = new Cube(world, c0, c0, c4, c1, c1, c5); + mCubes[25] = new Cube(world, c2, c0, c4, c3, c1, c5); + mCubes[26] = new Cube(world, c4, c0, c4, c5, c1, c5); + + // paint the sides + int i, j; + // set all faces black by default + for (i = 0; i < 27; i++) { + Cube cube = mCubes[i]; + if (cube != null) { + for (j = 0; j < 6; j++) + cube.setFaceColor(j, black); + } + } + + // paint top + for (i = 0; i < 9; i++) + mCubes[i].setFaceColor(Cube.kTop, orange); + // paint bottom + for (i = 18; i < 27; i++) + mCubes[i].setFaceColor(Cube.kBottom, red); + // paint left + for (i = 0; i < 27; i += 3) + mCubes[i].setFaceColor(Cube.kLeft, yellow); + // paint right + for (i = 2; i < 27; i += 3) + mCubes[i].setFaceColor(Cube.kRight, white); + // paint back + for (i = 0; i < 27; i += 9) + for (j = 0; j < 3; j++) + mCubes[i + j].setFaceColor(Cube.kBack, blue); + // paint front + for (i = 6; i < 27; i += 9) + for (j = 0; j < 3; j++) + mCubes[i + j].setFaceColor(Cube.kFront, green); + + for (i = 0; i < 27; i++) + if (mCubes[i] != null) + world.addShape(mCubes[i]); + + // initialize our permutation to solved position + mPermutation = new int[27]; + for (i = 0; i < mPermutation.length; i++) + mPermutation[i] = i; + + createLayers(); + updateLayers(); + + world.generate(); + + return world; + } + + private void createLayers() { + mLayers[kUp] = new Layer(Layer.kAxisY); + mLayers[kDown] = new Layer(Layer.kAxisY); + mLayers[kLeft] = new Layer(Layer.kAxisX); + mLayers[kRight] = new Layer(Layer.kAxisX); + mLayers[kFront] = new Layer(Layer.kAxisZ); + mLayers[kBack] = new Layer(Layer.kAxisZ); + mLayers[kMiddle] = new Layer(Layer.kAxisX); + mLayers[kEquator] = new Layer(Layer.kAxisY); + mLayers[kSide] = new Layer(Layer.kAxisZ); + } + + private void updateLayers() { + Layer layer; + GLShape[] shapes; + int i, j, k; + + // up layer + layer = mLayers[kUp]; + shapes = layer.mShapes; + for (i = 0; i < 9; i++) + shapes[i] = mCubes[mPermutation[i]]; + + // down layer + layer = mLayers[kDown]; + shapes = layer.mShapes; + for (i = 18, k = 0; i < 27; i++) + shapes[k++] = mCubes[mPermutation[i]]; + + // left layer + layer = mLayers[kLeft]; + shapes = layer.mShapes; + for (i = 0, k = 0; i < 27; i += 9) + for (j = 0; j < 9; j += 3) + shapes[k++] = mCubes[mPermutation[i + j]]; + + // right layer + layer = mLayers[kRight]; + shapes = layer.mShapes; + for (i = 2, k = 0; i < 27; i += 9) + for (j = 0; j < 9; j += 3) + shapes[k++] = mCubes[mPermutation[i + j]]; + + // front layer + layer = mLayers[kFront]; + shapes = layer.mShapes; + for (i = 6, k = 0; i < 27; i += 9) + for (j = 0; j < 3; j++) + shapes[k++] = mCubes[mPermutation[i + j]]; + + // back layer + layer = mLayers[kBack]; + shapes = layer.mShapes; + for (i = 0, k = 0; i < 27; i += 9) + for (j = 0; j < 3; j++) + shapes[k++] = mCubes[mPermutation[i + j]]; + + // middle layer + layer = mLayers[kMiddle]; + shapes = layer.mShapes; + for (i = 1, k = 0; i < 27; i += 9) + for (j = 0; j < 9; j += 3) + shapes[k++] = mCubes[mPermutation[i + j]]; + + // equator layer + layer = mLayers[kEquator]; + shapes = layer.mShapes; + for (i = 9, k = 0; i < 18; i++) + shapes[k++] = mCubes[mPermutation[i]]; + + // side layer + layer = mLayers[kSide]; + shapes = layer.mShapes; + for (i = 3, k = 0; i < 27; i += 9) + for (j = 0; j < 3; j++) + shapes[k++] = mCubes[mPermutation[i + j]]; + } + + @Override + public void onCreate(Bundle icicle) + { + super.onCreate(icicle); + + // Make sure to create a TRANSLUCENT window. This is required + // for SurfaceView to work. Eventually this'll be done by + // the system automatically. + getWindow().setFormat(PixelFormat.TRANSLUCENT); + + // We don't need a title either. + // requestWindowFeature(Window.FEATURE_NO_TITLE); + + setTitle(TAG); + + mView = new GLSurfaceView(getApplication(), makeGLWorld(), this); + setContentView(mView); + mView.setClient(this); + mPrevFramerate = 0.0f; + } + + @Override + protected void onResume() + { + super.onResume(); + } + + @Override + protected void onStop() + { + super.onStop(); + } + + public boolean onKeyDown(int keyCode, KeyEvent event) { + switch(keyCode) { + case KeyEvent.KEYCODE_BACK: + return super.onKeyDown(keyCode, event); + } + setTitle("Kubench: " + mView.getFramerate() + " fps"); + return true; + } + + public void animate() { + // change our angle of view + mView.setAngle(mView.getAngle() + 1.2f); + + if (mCurrentLayer == null) { + int layerID = mRandom.nextInt(9); + mCurrentLayer = mLayers[layerID]; + mCurrentLayerPermutation = mLayerPermutations[layerID]; + mCurrentLayer.startAnimation(); + boolean direction = mRandom.nextBoolean(); + int count = mRandom.nextInt(3) + 1; + + count = 1; + direction = false; + mCurrentAngle = 0; + if (direction) { + mAngleIncrement = (float)Math.PI / 50; + mEndAngle = mCurrentAngle + ((float)Math.PI * count) / 2f; + } else { + mAngleIncrement = -(float)Math.PI / 50; + mEndAngle = mCurrentAngle - ((float)Math.PI * count) / 2f; + } + } + + mCurrentAngle += mAngleIncrement; + + if ((mAngleIncrement > 0f && mCurrentAngle >= mEndAngle) || + (mAngleIncrement < 0f && mCurrentAngle <= mEndAngle)) { + mCurrentLayer.setAngle(mEndAngle); + mCurrentLayer.endAnimation(); + mCurrentLayer = null; + + // adjust mPermutation based on the completed layer rotation + int[] newPermutation = new int[27]; + for (int i = 0; i < 27; i++) { + newPermutation[i] = mPermutation[mCurrentLayerPermutation[i]]; + // newPermutation[i] = mCurrentLayerPermutation[mPermutation[i]]; + } + mPermutation = newPermutation; + updateLayers(); + + } else { + mCurrentLayer.setAngle(mCurrentAngle); + } + + if (mPrevFramerate != mView.getFramerate()) { + mPrevFramerate = mView.getFramerate(); + // setTitle(mPrevFramerate + "fps"); + //Log.v("Kubench", mPrevFramerate + "fps"); + } + } + + GLSurfaceView mView; + Cube[] mCubes = new Cube[27]; + // a Layer for each possible move + Layer[] mLayers = new Layer[9]; + // permutations corresponding to a pi/2 rotation of each layer about its axis + static int[][] mLayerPermutations = { + // permutation for UP layer + { 2, 5, 8, 1, 4, 7, 0, 3, 6, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, + // permutation for DOWN layer + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20, 23, 26, 19, 22, 25, 18, 21, 24 }, + // permutation for LEFT layer + { 6, 1, 2, 15, 4, 5, 24, 7, 8, 3, 10, 11, 12, 13, 14, 21, 16, 17, 0, 19, 20, 9, 22, 23, 18, 25, 26 }, + // permutation for RIGHT layer + { 0, 1, 8, 3, 4, 17, 6, 7, 26, 9, 10, 5, 12, 13, 14, 15, 16, 23, 18, 19, 2, 21, 22, 11, 24, 25, 20 }, + // permutation for FRONT layer + { 0, 1, 2, 3, 4, 5, 24, 15, 6, 9, 10, 11, 12, 13, 14, 25, 16, 7, 18, 19, 20, 21, 22, 23, 26, 17, 8 }, + // permutation for BACK layer + { 18, 9, 0, 3, 4, 5, 6, 7, 8, 19, 10, 1, 12, 13, 14, 15, 16, 17, 20, 11, 2, 21, 22, 23, 24, 25, 26 }, + // permutation for MIDDLE layer + { 0, 7, 2, 3, 16, 5, 6, 25, 8, 9, 4, 11, 12, 13, 14, 15, 22, 17, 18, 1, 20, 21, 10, 23, 24, 19, 26 }, + // permutation for EQUATOR layer + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 11, 14, 17, 10, 13, 16, 9, 12, 15, 18, 19, 20, 21, 22, 23, 24, 25, 26 }, + // permutation for SIDE layer + { 0, 1, 2, 21, 12, 3, 6, 7, 8, 9, 10, 11, 22, 13, 4, 15, 16, 17, 18, 19, 20, 23, 14, 5, 24, 25, 26 } + }; + + + + // current permutation of starting position + int[] mPermutation; + + // for random cube movements + Random mRandom = new Random(System.currentTimeMillis()); + // currently turning layer + Layer mCurrentLayer = null; + // current and final angle for current Layer animation + float mCurrentAngle, mEndAngle; + // amount to increment angle + float mAngleIncrement; + int[] mCurrentLayerPermutation; + + float mPrevFramerate; + + // names for our 9 layers (based on notation from http://www.cubefreak.net/notation.html) + static final int kUp = 0; + static final int kDown = 1; + static final int kLeft = 2; + static final int kRight = 3; + static final int kFront = 4; + static final int kBack = 5; + static final int kMiddle = 6; + static final int kEquator = 7; + static final int kSide = 8; + +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Layer.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Layer.java new file mode 100644 index 0000000..2d59a85 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/Layer.java @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.kubench; + +public class Layer { + + public Layer(int axis) { + // start with identity matrix for transformation + mAxis = axis; + mTransform.setIdentity(); + } + + public void startAnimation() { + for (int i = 0; i < mShapes.length; i++) { + GLShape shape = mShapes[i]; + if (shape != null) { + shape.startAnimation(); + } + } + } + + public void endAnimation() { + for (int i = 0; i < mShapes.length; i++) { + GLShape shape = mShapes[i]; + if (shape != null) { + shape.endAnimation(); + } + } + } + + public void setAngle(float angle) { + // normalize the angle + float twopi = (float)Math.PI *2f; + while (angle >= twopi) angle -= twopi; + while (angle < 0f) angle += twopi; +// mAngle = angle; + + float sin = (float)Math.sin(angle); + float cos = (float)Math.cos(angle); + + float[][] m = mTransform.m; + switch (mAxis) { + case kAxisX: + m[1][1] = cos; + m[1][2] = sin; + m[2][1] = -sin; + m[2][2] = cos; + m[0][0] = 1f; + m[0][1] = m[0][2] = m[1][0] = m[2][0] = 0f; + break; + case kAxisY: + m[0][0] = cos; + m[0][2] = sin; + m[2][0] = -sin; + m[2][2] = cos; + m[1][1] = 1f; + m[0][1] = m[1][0] = m[1][2] = m[2][1] = 0f; + break; + case kAxisZ: + m[0][0] = cos; + m[0][1] = sin; + m[1][0] = -sin; + m[1][1] = cos; + m[2][2] = 1f; + m[2][0] = m[2][1] = m[0][2] = m[1][2] = 0f; + break; + } + + for (int i = 0; i < mShapes.length; i++) { + GLShape shape = mShapes[i]; + if (shape != null) { + shape.animateTransform(mTransform); + } + } + } + + public GLShape[] mShapes = new GLShape[9]; + M4 mTransform = new M4(); +// float mAngle; + + // which axis do we rotate around? + // 0 for X, 1 for Y, 2 for Z + int mAxis; + static public final int kAxisX = 0; + static public final int kAxisY = 1; + static public final int kAxisZ = 2; +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/M4.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/M4.java new file mode 100644 index 0000000..efda41d --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/kubench/M4.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2008 Google Inc. + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package graphics_benchmarks.kubench; + +/** + * + * A 4x4 float matrix + * + */ +public class M4 { + public float[][] m = new float[4][4]; + + public M4() { + } + + public M4(M4 other) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + m[i][j] = other.m[i][j]; + } + } + } + + public void multiply(GLVertex src, GLVertex dest) { + dest.x = src.x * m[0][0] + src.y * m[1][0] + src.z * m[2][0] + m[3][0]; + dest.y = src.x * m[0][1] + src.y * m[1][1] + src.z * m[2][1] + m[3][1]; + dest.z = src.x * m[0][2] + src.y * m[1][2] + src.z * m[2][2] + m[3][2]; + } + + public M4 multiply(M4 other) { + M4 result = new M4(); + float[][] m1 = m; + float[][] m2 = other.m; + + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + result.m[i][j] = m1[i][0]*m2[0][j] + m1[i][1]*m2[1][j] + m1[i][2]*m2[2][j] + m1[i][3]*m2[3][j]; + } + } + + return result; + } + + public void setIdentity() { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + m[i][j] = (i == j ? 1f : 0f); + } + } + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder("[ "); + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + builder.append(m[i][j]); + builder.append(" "); + } + if (i < 2) + builder.append("\n "); + } + builder.append(" ]"); + return builder.toString(); + } +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Cube.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Cube.java new file mode 100644 index 0000000..643fb4a --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Cube.java @@ -0,0 +1,339 @@ +/* + * Authors Name: Jeff Molofee (NeHe) + * + * Disclaimer: + * This program may crash your system or run poorly depending on your + * hardware. The program and code contained in this archive was scanned + * for virii and has passed all test before it was put online. If you + * use this code in project of your own, send a shout out to the author! + * + * Ported to Android by INsanityDesign: + * http://insanitydesign.com/wp/projects/nehe-android-ports/ + */ + +package graphics_benchmarks.lesson08; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +import javax.microedition.khronos.opengles.GL10; +import javax.microedition.khronos.opengles.GL11; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.opengl.GLUtils; + +import org.linaro.iasenov.benchmarkframework.R; + +/** + * This class is an object representation of + * a Cube containing the vertex information, + * texture coordinates, the vertex indices + * and drawing functionality, which is called + * by the renderer. + * + * @author Savas Ziplies (nea/INsanityDesign) + */ +public class Cube { + + /** The buffer holding the vertices */ + private FloatBuffer vertexBuffer; + /** The buffer holding the texture coordinates */ + private FloatBuffer textureBuffer; + /** The buffer holding the indices */ + private ByteBuffer indexBuffer; + /** The buffer holding the normals */ + private FloatBuffer normalBuffer; + + /** Our texture pointer */ + private int[] textures = new int[3]; + + /** The initial vertex definition */ + private float vertices[] = { + // Vertices according to faces + -1.0f, -1.0f, 1.0f, //v0 + 1.0f, -1.0f, 1.0f, //v1 + -1.0f, 1.0f, 1.0f, //v2 + 1.0f, 1.0f, 1.0f, //v3 + + 1.0f, -1.0f, 1.0f, //... + 1.0f, -1.0f, -1.0f, + 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, -1.0f, + + 1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, -1.0f, + 1.0f, 1.0f, -1.0f, + -1.0f, 1.0f, -1.0f, + + -1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, 1.0f, + -1.0f, 1.0f, -1.0f, + -1.0f, 1.0f, 1.0f, + + -1.0f, -1.0f, -1.0f, + 1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, 1.0f, + 1.0f, -1.0f, 1.0f, + + -1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, + -1.0f, 1.0f, -1.0f, + 1.0f, 1.0f, -1.0f, + }; + + /** The initial normals for the lighting calculations */ + private float normals[] = { + //Normals + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + }; + + /** The initial texture coordinates (u, v) */ + private float texture[] = { + //Mapping coordinates for the vertices + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + }; + + /** The initial indices definition */ + private byte indices[] = { + // Faces definition + 0, 1, 3, 0, 3, 2, // Face front + 4, 5, 7, 4, 7, 6, // Face right + 8, 9, 11, 8, 11, 10, // ... + 12, 13, 15, 12, 15, 14, + 16, 17, 19, 16, 19, 18, + 20, 21, 23, 20, 23, 22, + }; + + /** + * The Cube constructor. + * + * Initiate the buffers. + */ + public Cube() { + // + ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + vertexBuffer = byteBuf.asFloatBuffer(); + vertexBuffer.put(vertices); + vertexBuffer.position(0); + + // + byteBuf = ByteBuffer.allocateDirect(texture.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + textureBuffer = byteBuf.asFloatBuffer(); + textureBuffer.put(texture); + textureBuffer.position(0); + + // + byteBuf = ByteBuffer.allocateDirect(normals.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + normalBuffer = byteBuf.asFloatBuffer(); + normalBuffer.put(normals); + normalBuffer.position(0); + + // + indexBuffer = ByteBuffer.allocateDirect(indices.length); + indexBuffer.put(indices); + indexBuffer.position(0); + } + + /** + * The object own drawing function. + * Called from the renderer to redraw this instance + * with possible changes in values. + * + * @param gl - The GL Context + * @param filter - Which texture filter to be used + */ + public void draw(GL10 gl, int filter) { + //Bind the texture according to the set texture filter + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[filter]); + + //Enable the vertex, texture and normal state + gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); + gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); + gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); + + //Set the face rotation + gl.glFrontFace(GL10.GL_CCW); + + //Point to our buffers + gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); + gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer); + gl.glNormalPointer(GL10.GL_FLOAT, 0, normalBuffer); + + //Draw the vertices as triangles, based on the Index Buffer information + gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer); + + //Disable the client state before leaving + gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); + gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); + gl.glDisableClientState(GL10.GL_NORMAL_ARRAY); + } + + /** + * Load the textures + * + * @param gl - The GL Context + * @param context - The Activity context + */ + + public void loadGLTexture(GL10 gl, Context context) { + //Get the texture from the Android resource directory + InputStream is = context.getResources().openRawResource(+ R.drawable.glass); + Bitmap bitmap = null; + try { + //BitmapFactory is an Android graphics utility for images + bitmap = BitmapFactory.decodeStream(is); + + } finally { + //Always clear and close + try { + is.close(); + is = null; + } catch (IOException e) { + } + } + + //Generate there texture pointer + gl.glGenTextures(3, textures, 0); + + //Create Nearest Filtered Texture and bind it to texture 0 + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); + + //Create Linear Filtered Texture and bind it to texture 1 + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR); + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); + + //Create mipmapped textures and bind it to texture 2 + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[2]); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST); + /* + * This is a change to the original tutorial, as buildMipMap does not exist anymore + * in the Android SDK. + * + * We check if the GL context is version 1.1 and generate MipMaps by flag. + * Otherwise we call our own buildMipMap implementation + */ + if(gl instanceof GL11) { + gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_GENERATE_MIPMAP, GL11.GL_TRUE); + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); + + // + } else { + buildMipmap(gl, bitmap); + } + + //Clean up + bitmap.recycle(); + } + + /** + * Our own MipMap generation implementation. + * Scale the original bitmap down, always by factor two, + * and set it as new mipmap level. + * + * Thanks to Mike Miller (with minor changes)! + * + * @param gl - The GL Context + * @param bitmap - The bitmap to mipmap + */ + private void buildMipmap(GL10 gl, Bitmap bitmap) { + // + int level = 0; + // + int height = bitmap.getHeight(); + int width = bitmap.getWidth(); + + // + while(height >= 1 || width >= 1) { + //First of all, generate the texture from our bitmap and set it to the according level + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bitmap, 0); + + // + if(height == 1 || width == 1) { + break; + } + + //Increase the mipmap level + level++; + + // + height /= 2; + width /= 2; + Bitmap bitmap2 = Bitmap.createScaledBitmap(bitmap, width, height, true); + + //Clean up + bitmap.recycle(); + bitmap = bitmap2; + } + } +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Lesson08.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Lesson08.java new file mode 100644 index 0000000..ab87916 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/Lesson08.java @@ -0,0 +1,339 @@ +/* + * Authors Name: Jeff Molofee (NeHe) + * + * Disclaimer: + * This program may crash your system or run poorly depending on your + * hardware. The program and code contained in this archive was scanned + * for virii and has passed all test before it was put online. If you + * use this code in project of your own, send a shout out to the author! + * + * Ported to Android by INsanityDesign: + * http://insanitydesign.com/wp/projects/nehe-android-ports/ + * + * Adapted by 0xlab developers. + */ + +package graphics_benchmarks.lesson08; + +import graphics_benchmarks.graphics.Tester; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import android.content.Context; +import android.opengl.GLSurfaceView; +import android.opengl.GLU; +import android.opengl.GLSurfaceView.Renderer; +import android.view.KeyEvent; +import android.view.MotionEvent; + +/** + * This is a port of the {@link http://nehe.gamedev.net} OpenGL + * tutorials to the Android 1.5 OpenGL ES platform. Thanks to + * NeHe and all contributors for their great tutorials and great + * documentation. This source should be used together with the + * textual explanations made at {@link http://nehe.gamedev.net}. + * The code is based on the original Visual C++ code with all + * comments made. It has been altered and extended to meet the + * Android requirements. The Java code has according comments. + * + * If you use this code or find it helpful, please visit and send + * a shout to the author under {@link http://www.insanitydesign.com/} + * + * @DISCLAIMER + * This source and the whole package comes without warranty. It may or may + * not harm your computer or cell phone. Please use with care. Any damage + * cannot be related back to the author. The source has been tested on a + * virtual environment and scanned for viruses and has passed all tests. + * + * + * This is an interpretation of "Lesson 08: Blending" + * for the Google Android platform. + * + * @author Savas Ziplies (nea/INsanityDesign) + */ +public class Lesson08 extends GLSurfaceView implements Renderer { + + private Tester mTester; + + /** Cube instance */ + private Cube cube; + + /* Rotation values */ + private float xrot; //X Rotation + private float yrot; //Y Rotation + + /* Rotation speed values */ + private float xspeed; //X Rotation Speed + private float yspeed; //Y Rotation Speed + + private float z = -5.0f; //Depth Into The Screen + + private int filter = 0; //Which texture filter? + + /** Is light enabled */ + private boolean light = true; + /** Is blending enabled ( NEW ) */ + private boolean blend = true; + + /* The initial light values */ + private float[] lightAmbient = {0.5f, 0.5f, 0.5f, 1.0f}; + private float[] lightDiffuse = {1.0f, 1.0f, 1.0f, 1.0f}; + private float[] lightPosition = {0.0f, 0.0f, 2.0f, 1.0f}; + + /* The buffers for our light values */ + private FloatBuffer lightAmbientBuffer; + private FloatBuffer lightDiffuseBuffer; + private FloatBuffer lightPositionBuffer; + + /* Variables and factor for the input handler */ + private float oldX; + private float oldY; + private final float TOUCH_SCALE = 0.2f; //Proved to be good for normal rotation + + /** The Activity Context */ + private Context context; + + /** + * Instance the Cube object and set the Activity Context + * handed over. Initiate the light buffers and set this + * class as renderer for this now GLSurfaceView. + * Request Focus and set if focusable in touch mode to + * receive the Input from Screen and Buttons + * + * @param context - The Activity Context + */ + public Lesson08(Context context) { + super(context); + + //Set this as Renderer + this.setRenderer(this); + //Request focus, otherwise buttons won't react + this.requestFocus(); + this.setFocusableInTouchMode(true); + + // + this.context = context; + + // + ByteBuffer byteBuf = ByteBuffer.allocateDirect(lightAmbient.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + lightAmbientBuffer = byteBuf.asFloatBuffer(); + lightAmbientBuffer.put(lightAmbient); + lightAmbientBuffer.position(0); + + byteBuf = ByteBuffer.allocateDirect(lightDiffuse.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + lightDiffuseBuffer = byteBuf.asFloatBuffer(); + lightDiffuseBuffer.put(lightDiffuse); + lightDiffuseBuffer.position(0); + + byteBuf = ByteBuffer.allocateDirect(lightPosition.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + lightPositionBuffer = byteBuf.asFloatBuffer(); + lightPositionBuffer.put(lightPosition); + lightPositionBuffer.position(0); + + // + cube = new Cube(); + } + + public void setSpeedAndTester(int speedX, int speedY, Tester tester) { + xspeed = speedX; + yspeed = speedY; + mTester = tester; + } + + /** + * The Surface is created/init() + */ + public void onSurfaceCreated(GL10 gl, EGLConfig config) { + //And there'll be light! + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbientBuffer); //Setup The Ambient Light + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuseBuffer); //Setup The Diffuse Light + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPositionBuffer); //Position The Light + gl.glEnable(GL10.GL_LIGHT0); //Enable Light 0 + + //Blending + gl.glColor4f(1.0f, 1.0f, 1.0f, 0.5f); //Full Brightness. 50% Alpha ( NEW ) + gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); //Set The Blending Function For Translucency ( NEW ) + + //Settings + gl.glDisable(GL10.GL_DITHER); //Disable dithering + gl.glEnable(GL10.GL_TEXTURE_2D); //Enable Texture Mapping + gl.glShadeModel(GL10.GL_SMOOTH); //Enable Smooth Shading + gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); //Black Background + gl.glClearDepthf(1.0f); //Depth Buffer Setup + gl.glEnable(GL10.GL_DEPTH_TEST); //Enables Depth Testing + gl.glDepthFunc(GL10.GL_LEQUAL); //The Type Of Depth Testing To Do + + //Really Nice Perspective Calculations + gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); + + //Load the texture for the cube once during Surface creation + cube.loadGLTexture(gl, this.context); + } + + /** + * Here we do our drawing + */ + public void onDrawFrame(GL10 gl) { + //Clear Screen And Depth Buffer + gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); + gl.glLoadIdentity(); //Reset The Current Modelview Matrix + + //Check if the light flag has been set to enable/disable lighting + if(light) { + gl.glEnable(GL10.GL_LIGHTING); + } else { + gl.glDisable(GL10.GL_LIGHTING); + } + + //Check if the blend flag has been set to enable/disable blending + if(blend) { + gl.glEnable(GL10.GL_BLEND); //Turn Blending On ( NEW ) + gl.glDisable(GL10.GL_DEPTH_TEST); //Turn Depth Testing Off ( NEW ) + + } else { + gl.glDisable(GL10.GL_BLEND); //Turn Blending On ( NEW ) + gl.glEnable(GL10.GL_DEPTH_TEST); //Turn Depth Testing Off ( NEW ) + } + + //Drawing + gl.glTranslatef(0.0f, 0.0f, z); //Move z units into the screen + gl.glScalef(0.8f, 0.8f, 0.8f); //Scale the Cube to 80 percent, otherwise it would be too large for the screen + + //Rotate around the axis based on the rotation matrix (rotation, x, y, z) + gl.glRotatef(xrot, 1.0f, 0.0f, 0.0f); //X + gl.glRotatef(yrot, 0.0f, 1.0f, 0.0f); //Y + + cube.draw(gl, filter); //Draw the Cube + gl.glFinish(); + mTester.decreaseCounter(); + //Change rotation factors + xrot += xspeed; + yrot += yspeed; + } + + + /** + * If the surface changes, reset the view + */ + public void onSurfaceChanged(GL10 gl, int width, int height) { + if(height == 0) { //Prevent A Divide By Zero By + height = 1; //Making Height Equal One + } + + gl.glViewport(0, 0, width, height); //Reset The Current Viewport + gl.glMatrixMode(GL10.GL_PROJECTION); //Select The Projection Matrix + gl.glLoadIdentity(); //Reset The Projection Matrix + + //Calculate The Aspect Ratio Of The Window + GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 100.0f); + + gl.glMatrixMode(GL10.GL_MODELVIEW); //Select The Modelview Matrix + gl.glLoadIdentity(); //Reset The Modelview Matrix + } + +/* ***** Listener Events ***** */ + /** + * Override the key listener to receive keyUp events. + * + * Check for the DPad presses left, right, up, down and middle. + * Change the rotation speed according to the presses + * or change the texture filter used through the middle press. + */ + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + // + if(keyCode == KeyEvent.KEYCODE_DPAD_LEFT) { + yspeed -= 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) { + yspeed += 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_UP) { + xspeed -= 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_DOWN) { + xspeed += 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { + filter += 1; + if(filter > 2) { + filter = 0; + } + } + + //We handled the event + return true; + } + + /** + * Override the touch screen listener. + * + * React to moves and presses on the touchscreen. + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + // + float x = event.getX(); + float y = event.getY(); + + //If a touch is moved on the screen + if(event.getAction() == MotionEvent.ACTION_MOVE) { + //Calculate the change + float dx = x - oldX; + float dy = y - oldY; + //Define an upper area of 10% on the screen + int upperArea = this.getHeight() / 10; + + //Zoom in/out if the touch move has been made in the upper + if(y < upperArea) { + z -= dx * TOUCH_SCALE / 2; + + //Rotate around the axis otherwise + } else { + xrot += dy * TOUCH_SCALE; + yrot += dx * TOUCH_SCALE; + } + + //A press on the screen + } else if(event.getAction() == MotionEvent.ACTION_UP) { + //Define an upper area of 10% to define a lower area + int upperArea = this.getHeight() / 10; + int lowerArea = this.getHeight() - upperArea; + + // + if(y > lowerArea) { + //Change the blend setting if the lower area left has been pressed ( NEW ) + if(x < (this.getWidth() / 2)) { + if(blend) { + blend = false; + } else { + blend = true; + } + + //Change the light setting if the lower area right has been pressed + } else { + if(light) { + light = false; + } else { + light = true; + } + } + } + } + + //Remember the values + oldX = x; + oldY = y; + + //We handled the event + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/RunNehe08.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/RunNehe08.java new file mode 100644 index 0000000..ec01b9d --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson08/RunNehe08.java @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authored by Julian Chu + */ + +package graphics_benchmarks.lesson08; + +import graphics_benchmarks.graphics.Tester; + +import android.app.Activity; +import android.os.Bundle; + +/** + * The initial Android Activity, setting and initiating + * the OpenGL ES Renderer Class @see Lesson08.java + * + * @author Savas Ziplies (nea/INsanityDesign) + */ +public class RunNehe08 extends Tester { + + public final static String FullName = "com.nea.nehe.lesson08.RunNehe08"; + + /** Our own OpenGL View overridden */ + private Lesson08 lesson08; + + @Override + public String getTag() { + return "Nehe08"; + } + + @Override + public int sleepBeforeStart() { + return 1200; // 1.2 second + } + + @Override + public int sleepBetweenRound() { + return 0; + } + + @Override + protected void oneRound() { +// lesson08.requestRender(); + } + + /** + * Initiate our @see Lesson08.java, + * which is GLSurfaceView and Renderer + */ + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + //Initiate our Lesson with this Activity Context handed over + lesson08 = new Lesson08(this); + lesson08.setSpeedAndTester(1, 1, this); + //Set the lesson as View to the Activity + setContentView(lesson08); + startTester(); + } + + /** + * Remember to resume our Lesson + */ + @Override + protected void onResume() { + super.onResume(); + lesson08.onResume(); + } + + /** + * Also pause our Lesson + */ + @Override + protected void onPause() { + super.onPause(); + lesson08.onPause(); + } + +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Cube.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Cube.java new file mode 100644 index 0000000..e4561b9 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Cube.java @@ -0,0 +1,345 @@ +/* + * Authors Name: Jeff Molofee (NeHe) + * + * Disclaimer: + * This program may crash your system or run poorly depending on your + * hardware. The program and code contained in this archive was scanned + * for virii and has passed all test before it was put online. If you + * use this code in project of your own, send a shout out to the author! + * + * Ported to Android by INsanityDesign: + * http://insanitydesign.com/wp/projects/nehe-android-ports/ + */ + +package graphics_benchmarks.lesson16; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +import javax.microedition.khronos.opengles.GL10; +import javax.microedition.khronos.opengles.GL11; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.opengl.GLUtils; + +import org.linaro.iasenov.benchmarkframework.R; + +/** + * This class is an object representation of + * a Cube containing the vertex information, + * texture coordinates, the vertex indices + * and drawing functionality, which is called + * by the renderer. + * + * @author Savas Ziplies (nea/INsanityDesign) + */ +public class Cube { + + /** The buffer holding the vertices */ + private FloatBuffer vertexBuffer; + /** The buffer holding the texture coordinates */ + private FloatBuffer textureBuffer; + /** The buffer holding the indices */ + private ByteBuffer indexBuffer; + /** The buffer holding the normals */ + private FloatBuffer normalBuffer; + + /** Our texture pointer */ + private int[] textures = new int[3]; + + /** The initial vertex definition */ + private float vertices[] = { + //Vertices according to faces + -1.0f, -1.0f, 1.0f, //v0 + 1.0f, -1.0f, 1.0f, //v1 + -1.0f, 1.0f, 1.0f, //v2 + 1.0f, 1.0f, 1.0f, //v3 + + 1.0f, -1.0f, 1.0f, // ... + 1.0f, -1.0f, -1.0f, + 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, -1.0f, + + 1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, -1.0f, + 1.0f, 1.0f, -1.0f, + -1.0f, 1.0f, -1.0f, + + -1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, 1.0f, + -1.0f, 1.0f, -1.0f, + -1.0f, 1.0f, 1.0f, + + -1.0f, -1.0f, -1.0f, + 1.0f, -1.0f, -1.0f, + -1.0f, -1.0f, 1.0f, + 1.0f, -1.0f, 1.0f, + + -1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, + -1.0f, 1.0f, -1.0f, + 1.0f, 1.0f, -1.0f, + }; + + /** + * The initial normals for the lighting calculations + * + * The normals are not necessarily correct from a + * real world perspective, as I am too lazy to write + * these all on my own. But you get the idea and see + * what I mean if you run the demo. + */ + private float normals[] = { + // Normals + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + + 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, -1.0f, + 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.0f, + }; + + /** The initial texture coordinates (u, v) */ + private float texture[] = { + //Mapping coordinates for the vertices + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 0.0f, + 1.0f, 1.0f, + }; + + /** The initial indices definition */ + private byte indices[] = { + // Faces definition + 0, 1, 3, 0, 3, 2, // Face front + 4, 5, 7, 4, 7, 6, // Face right + 8, 9, 11, 8, 11, 10, // ... + 12, 13, 15, 12, 15, 14, + 16, 17, 19, 16, 19, 18, + 20, 21, 23, 20, 23, 22, + }; + + /** + * The Cube constructor. + * + * Initiate the buffers. + */ + public Cube() { + // + ByteBuffer byteBuf = ByteBuffer.allocateDirect(vertices.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + vertexBuffer = byteBuf.asFloatBuffer(); + vertexBuffer.put(vertices); + vertexBuffer.position(0); + + // + byteBuf = ByteBuffer.allocateDirect(texture.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + textureBuffer = byteBuf.asFloatBuffer(); + textureBuffer.put(texture); + textureBuffer.position(0); + + // + byteBuf = ByteBuffer.allocateDirect(normals.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + normalBuffer = byteBuf.asFloatBuffer(); + normalBuffer.put(normals); + normalBuffer.position(0); + + // + indexBuffer = ByteBuffer.allocateDirect(indices.length); + indexBuffer.put(indices); + indexBuffer.position(0); + } + + /** + * The object own drawing function. + * Called from the renderer to redraw this instance + * with possible changes in values. + * + * @param gl - The GL Context + * @param filter - Which texture filter to be used + */ + public void draw(GL10 gl, int filter) { + //Bind the texture according to the set texture filter + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[filter]); + + //Enable the vertex, texture and normal state + gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); + gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); + gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); + + //Set the face rotation + gl.glFrontFace(GL10.GL_CCW); + + //Point to our buffers + gl.glVertexPointer(3, GL10.GL_FLOAT, 0, vertexBuffer); + gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer); + gl.glNormalPointer(GL10.GL_FLOAT, 0, normalBuffer); + + //Draw the vertices as triangles, based on the Index Buffer information + gl.glDrawElements(GL10.GL_TRIANGLES, indices.length, GL10.GL_UNSIGNED_BYTE, indexBuffer); + + //Disable the client state before leaving + gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); + gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); + gl.glDisableClientState(GL10.GL_NORMAL_ARRAY); + } + + /** + * Load the textures + * + * @param gl - The GL Context + * @param context - The Activity context + */ + public void loadGLTexture(GL10 gl, Context context) { + //Get the texture from the Android resource directory + InputStream is = context.getResources().openRawResource(+ R.drawable.crate); + Bitmap bitmap = null; + try { + //BitmapFactory is an Android graphics utility for images + bitmap = BitmapFactory.decodeStream(is); + + } finally { + //Always clear and close + try { + is.close(); + is = null; + } catch (IOException e) { + } + } + + //Generate there texture pointer + gl.glGenTextures(3, textures, 0); + + //Create Nearest Filtered Texture and bind it to texture 0 + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST); + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); + + //Create Linear Filtered Texture and bind it to texture 1 + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[1]); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR); + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); + + //Create mipmapped textures and bind it to texture 2 + gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[2]); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); + gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR_MIPMAP_NEAREST); + /* + * This is a change to the original tutorial, as buildMipMap does not exist anymore + * in the Android SDK. + * + * We check if the GL context is version 1.1 and generate MipMaps by flag. + * Otherwise we call our own buildMipMap implementation + */ + if(gl instanceof GL11) { + gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_GENERATE_MIPMAP, GL11.GL_TRUE); + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0); + + // + } else { + buildMipmap(gl, bitmap); + } + + //Clean up + bitmap.recycle(); + } + + /** + * Our own MipMap generation implementation. + * Scale the original bitmap down, always by factor two, + * and set it as new mipmap level. + * + * Thanks to Mike Miller (with minor changes)! + * + * @param gl - The GL Context + * @param bitmap - The bitmap to mipmap + */ + private void buildMipmap(GL10 gl, Bitmap bitmap) { + // + int level = 0; + // + int height = bitmap.getHeight(); + int width = bitmap.getWidth(); + + // + while(height >= 1 || width >= 1) { + //First of all, generate the texture from our bitmap and set it to the according level + GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bitmap, 0); + + // + if(height == 1 || width == 1) { + break; + } + + //Increase the mipmap level + level++; + + // + height /= 2; + width /= 2; + Bitmap bitmap2 = Bitmap.createScaledBitmap(bitmap, width, height, true); + + //Clean up + bitmap.recycle(); + bitmap = bitmap2; + } + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Lesson16.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Lesson16.java new file mode 100644 index 0000000..22f7bcb --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/Lesson16.java @@ -0,0 +1,366 @@ +/* + * Authors Name: Jeff Molofee (NeHe) + * + * Disclaimer: + * This program may crash your system or run poorly depending on your + * hardware. The program and code contained in this archive was scanned + * for virii and has passed all test before it was put online. If you + * use this code in project of your own, send a shout out to the author! + * + * Ported to Android by INsanityDesign: + * http://insanitydesign.com/wp/projects/nehe-android-ports/ + * + * Adapted by 0xlab developers. + */ + +package graphics_benchmarks.lesson16; + +import graphics_benchmarks.graphics.Tester; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; + +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import android.content.Context; +import android.opengl.GLSurfaceView; +import android.opengl.GLU; +import android.opengl.GLSurfaceView.Renderer; +import android.view.KeyEvent; +import android.view.MotionEvent; + +/** + * This is a port of the {@link http://nehe.gamedev.net} OpenGL + * tutorials to the Android 1.5 OpenGL ES platform. Thanks to + * NeHe and all contributors for their great tutorials and great + * documentation. This source should be used together with the + * textual explanations made at {@link http://nehe.gamedev.net}. + * The code is based on the original Visual C++ code with all + * comments made. It has been altered and extended to meet the + * Android requirements. The Java code has according comments. + * + * If you use this code or find it helpful, please visit and send + * a shout to the author under {@link http://www.insanitydesign.com/} + * + * @DISCLAIMER + * This source and the whole package comes without warranty. It may or may + * not harm your computer or cell phone. Please use with care. Any damage + * cannot be related back to the author. The source has been tested on a + * virtual environment and scanned for viruses and has passed all tests. + * + * + * This is an interpretation of "Lesson 16: Cool Looking Fog" + * for the Google Android platform. + * + * @author Savas Ziplies (nea/INsanityDesign) + */ +public class Lesson16 extends GLSurfaceView implements Renderer { + + private Tester mTester; + + /** Cube instance */ + private Cube cube; + + /* Rotation values */ + private float xrot; //X Rotation + private float yrot; //Y Rotation + + /* Rotation speed values */ + private float xspeed; //X Rotation Speed + private float yspeed; //Y Rotation Speed + + private float z = -5.0f; //Depth Into The Screen + + private int filter = 0; //Which texture filter? + + /** Is light enabled */ + private boolean light = false; + + private int fogFilter = 0; //Which Fog To Use ( NEW ) + /* + * Init the three fog filters we will use + * and the fog color ( NEW ) + */ + private int fogMode[]= { + GL10.GL_EXP, + GL10.GL_EXP2, + GL10.GL_LINEAR + }; + private float[] fogColor = {0.5f, 0.5f, 0.5f, 1.0f}; + private FloatBuffer fogColorBuffer; //The Fog Color Buffer ( NEW ) + + /* + * The initial light values for ambient and diffuse + * as well as the light position + */ + private float[] lightAmbient = {0.5f, 0.5f, 0.5f, 1.0f}; + private float[] lightDiffuse = {1.0f, 1.0f, 1.0f, 1.0f}; + private float[] lightPosition = {0.0f, 0.0f, 2.0f, 1.0f}; + + /* The buffers for our light values */ + private FloatBuffer lightAmbientBuffer; + private FloatBuffer lightDiffuseBuffer; + private FloatBuffer lightPositionBuffer; + + /* + * These variables store the previous X and Y + * values as well as a fix touch scale factor. + * These are necessary for the rotation transformation + * added to this lesson, based on the screen touches. + */ + private float oldX; + private float oldY; + private final float TOUCH_SCALE = 0.2f; //Proved to be good for normal rotation + + /** The Activity Context */ + private Context context; + + /** + * Instance the Cube object and set the Activity Context + * handed over. Initiate the light and fog buffers and set + * this class as renderer for this now GLSurfaceView. + * Request Focus and set if focusable in touch mode to + * receive the Input from Screen and Buttons + * + * @param context - The Activity Context + */ + public Lesson16(Context context) { + super(context); + + //Set this as Renderer + this.setRenderer(this); + //Request focus, otherwise buttons won't react + this.requestFocus(); + this.setFocusableInTouchMode(true); + + // + this.context = context; + + // + ByteBuffer byteBuf = ByteBuffer.allocateDirect(lightAmbient.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + lightAmbientBuffer = byteBuf.asFloatBuffer(); + lightAmbientBuffer.put(lightAmbient); + lightAmbientBuffer.position(0); + + byteBuf = ByteBuffer.allocateDirect(lightDiffuse.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + lightDiffuseBuffer = byteBuf.asFloatBuffer(); + lightDiffuseBuffer.put(lightDiffuse); + lightDiffuseBuffer.position(0); + + byteBuf = ByteBuffer.allocateDirect(lightPosition.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + lightPositionBuffer = byteBuf.asFloatBuffer(); + lightPositionBuffer.put(lightPosition); + lightPositionBuffer.position(0); + + //Build the new Buffer ( NEW ) + byteBuf = ByteBuffer.allocateDirect(fogColor.length * 4); + byteBuf.order(ByteOrder.nativeOrder()); + fogColorBuffer = byteBuf.asFloatBuffer(); + fogColorBuffer.put(fogColor); + fogColorBuffer.position(0); + + // + cube = new Cube(); + } + + public void setSpeedAndTester(int speedX, int speedY, Tester tester) { + xspeed = speedX; + yspeed = speedY; + mTester = tester; + } + + /** + * The Surface is created/init() + */ + public void onSurfaceCreated(GL10 gl, EGLConfig config) { + //And there'll be light! + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbientBuffer); //Setup The Ambient Light + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuseBuffer); //Setup The Diffuse Light + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPositionBuffer); //Position The Light + gl.glEnable(GL10.GL_LIGHT0); //Enable Light 0 + + //Settings + gl.glDisable(GL10.GL_DITHER); //Disable dithering + gl.glEnable(GL10.GL_TEXTURE_2D); //Enable Texture Mapping + gl.glShadeModel(GL10.GL_SMOOTH); //Enable Smooth Shading + gl.glClearColor(0.5f, 0.5f, 0.5f, 1.0f); //We'll Clear To The Color Of The Fog ( Modified ) + gl.glClearDepthf(1.0f); //Depth Buffer Setup + gl.glEnable(GL10.GL_DEPTH_TEST); //Enables Depth Testing + gl.glDepthFunc(GL10.GL_LEQUAL); //The Type Of Depth Testing To Do + + //The Fog/The Mist + gl.glFogf(GL10.GL_FOG_MODE, fogMode[fogFilter]); //Fog Mode ( NEW ) + gl.glFogfv(GL10.GL_FOG_COLOR, fogColorBuffer); //Set Fog Color ( NEW ) + gl.glFogf(GL10.GL_FOG_DENSITY, 0.35f); //How Dense Will The Fog Be ( NEW ) + gl.glHint(GL10.GL_FOG_HINT, GL10.GL_DONT_CARE); //Fog Hint Value ( NEW ) + gl.glFogf(GL10.GL_FOG_START, 1.0f); //Fog Start Depth ( NEW ) + gl.glFogf(GL10.GL_FOG_END, 5.0f); //Fog End Depth ( NEW ) + gl.glEnable(GL10.GL_FOG); //Enables GL_FOG ( NEW ) + + //Really Nice Perspective Calculations + gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); + + //Load the texture for the cube once during Surface creation + cube.loadGLTexture(gl, this.context); + } + + /** + * Here we do our drawing + */ + public void onDrawFrame(GL10 gl) { + //Clear Screen And Depth Buffer + gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); + gl.glLoadIdentity(); //Reset The Current Modelview Matrix + + //Check if the light flag has been set to enable/disable lighting + if(light) { + gl.glEnable(GL10.GL_LIGHTING); + } else { + gl.glDisable(GL10.GL_LIGHTING); + } + + //Set Fog Mode ( NEW ) + gl.glFogf(GL10.GL_FOG_MODE, fogMode[fogFilter]); + + //Drawing + gl.glTranslatef(0.0f, 0.0f, z); //Move z units into the screen + gl.glScalef(0.8f, 0.8f, 0.8f); //Scale the Cube to 80 percent, otherwise it would be too large for the screen + + //Rotate around the axis based on the rotation matrix (rotation, x, y, z) + gl.glRotatef(xrot, 1.0f, 0.0f, 0.0f); //X + gl.glRotatef(yrot, 0.0f, 1.0f, 0.0f); //Y + + cube.draw(gl, filter); //Draw the Cube + + gl.glFinish(); // ensuer the previous gl commands complete + mTester.decreaseCounter(); + + //Change rotation factors + xrot += xspeed; + yrot += yspeed; + } + + /** + * If the surface changes, reset the view + */ + public void onSurfaceChanged(GL10 gl, int width, int height) { + if(height == 0) { //Prevent A Divide By Zero By + height = 1; //Making Height Equal One + } + + gl.glViewport(0, 0, width, height); //Reset The Current Viewport + gl.glMatrixMode(GL10.GL_PROJECTION); //Select The Projection Matrix + gl.glLoadIdentity(); //Reset The Projection Matrix + + //Calculate The Aspect Ratio Of The Window + GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 100.0f); + + gl.glMatrixMode(GL10.GL_MODELVIEW); //Select The Modelview Matrix + gl.glLoadIdentity(); //Reset The Modelview Matrix + } + +/* ***** Listener Events ***** */ + /** + * Override the key listener to receive keyUp events. + * + * Check for the DPad presses left, right, up, down and middle. + * Change the rotation speed according to the presses + * or change the texture filter used through the middle press. + */ + @Override + public boolean onKeyUp(int keyCode, KeyEvent event) { + // + if(keyCode == KeyEvent.KEYCODE_DPAD_LEFT) { + yspeed -= 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) { + yspeed += 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_UP) { + xspeed -= 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_DOWN) { + xspeed += 0.1f; + + } else if(keyCode == KeyEvent.KEYCODE_DPAD_CENTER) { + filter += 1; + if(filter > 2) { + filter = 0; + } + } + + //We handled the event + return true; + } + + /** + * Override the touch screen listener. + * + * React to moves and presses on the touchscreen. + */ + @Override + public boolean onTouchEvent(MotionEvent event) { + // + float x = event.getX(); + float y = event.getY(); + + //If a touch is moved on the screen + if(event.getAction() == MotionEvent.ACTION_MOVE) { + //Calculate the change + float dx = x - oldX; + float dy = y - oldY; + //Define an upper area of 10% on the screen + int upperArea = this.getHeight() / 10; + + //Zoom in/out if the touch move has been made in the upper + if(y < upperArea) { + z -= dx * TOUCH_SCALE / (this.getWidth() /16); + + //Rotate around the axis otherwise + } else { + xrot += dy * TOUCH_SCALE; + yrot += dx * TOUCH_SCALE; + } + + //A press on the screen + } else if(event.getAction() == MotionEvent.ACTION_UP) { + //Define an upper area of 10% to define a lower area + int upperArea = this.getHeight() / 10; + int lowerArea = this.getHeight() - upperArea; + + // + if(y > lowerArea) { + //Change the blend setting if the lower area left has been pressed + if(x < (this.getWidth() / 2)) { + fogFilter += 1; //Increase fogFilter By One ( NEW ) + + //Is fogFilter Greater Than 2? ( NEW ) + if(fogFilter > 2) { + fogFilter = 0; //If So, Set fogFilter To Zero back again ( NEW ) + } + + //Change the light setting if the lower area right has been pressed + } else { + if(light) { + light = false; + } else { + light = true; + } + } + } + } + + //Remember the values + oldX = x; + oldY = y; + + //We handled the event + return true; + } +} + diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/RunNehe16.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/RunNehe16.java new file mode 100644 index 0000000..9220d24 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/lesson16/RunNehe16.java @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2010 0xlab - http://0xlab.org/ + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Authored by Julian Chu + */ + +package graphics_benchmarks.lesson16; + +import graphics_benchmarks.graphics.Tester; + +import android.app.Activity; +import android.os.Bundle; + +/** + * The initial Android Activity, setting and initiating + * the OpenGL ES Renderer Class @see Lesson16.java + * + * @author Savas Ziplies (nea/INsanityDesign) + */ +public class RunNehe16 extends Tester { + + public final static String FullName = "com.nea.nehe.lesson16.RunNehe16"; + + /** Our own OpenGL View overridden */ + private Lesson16 lesson16; + + @Override + public String getTag() { + return "Nehe16"; + } + + @Override + public int sleepBeforeStart() { + return 1200; //1.2 second + } + + @Override + public int sleepBetweenRound() { + return 0; + } + + @Override + protected void oneRound() { +// lesson16.requestRender(); + } + + /** + * Initiate our @see Lesson16.java, + * which is GLSurfaceView and Renderer + */ + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + //Initiate our Lesson with this Activity Context handed over + lesson16 = new Lesson16(this); + lesson16.setSpeedAndTester(1, 1, this); + //Set the lesson as View to the Activity + setContentView(lesson16); + startTester(); + } + + /** + * Remember to resume our Lesson + */ + @Override + protected void onResume() { + super.onResume(); + lesson16.onResume(); + } + + /** + * Also pause our Lesson + */ + @Override + protected void onPause() { + super.onPause(); + lesson16.onPause(); + } + +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/MyGLSurfaceView.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/MyGLSurfaceView.java new file mode 100644 index 0000000..96d7561 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/MyGLSurfaceView.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2008-2009 Koansin Tan + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Origin: http://code.google.com/p/android-utah-teapot/ + */ + +package graphics_benchmarks.teapot; + +import graphics_benchmarks.graphics.Tester; + +import android.content.Context; +import android.opengl.GLSurfaceView; +import android.util.Log; + +class MyGLSurfaceView extends GLSurfaceView { + private TeapotRenderer mMyRenderer; + private Tester mTester; + private float xspeed; + private float yspeed; + private float zspeed; + + public MyGLSurfaceView(Context context) { + super(context); + } + + @Override + public void setRenderer(GLSurfaceView.Renderer renderer) { + mMyRenderer = (TeapotRenderer) renderer; + super.setRenderer(renderer); + } +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotES.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotES.java new file mode 100644 index 0000000..ccf391f --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotES.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2008-2009 Koansin Tan + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Origin: http://code.google.com/p/android-utah-teapot/ + */ + +package graphics_benchmarks.teapot; + +import graphics_benchmarks.graphics.Tester; + +import android.app.Activity; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; + +//public class TeapotES extends Tester implements SensorEventListener { +public class TeapotES extends Tester { + + public final static String FullName = "org.itri.teapot.TeapotES"; + + /** Our own OpenGL View overridden */ + private MyGLSurfaceView mGLSurfaceView; + + @Override + public String getTag() { + return "Teapot"; + } + + @Override + public int sleepBeforeStart() { + return 1200; // 1.2 second + } + + @Override + public int sleepBetweenRound() { + return 1500; // 15 ms + } + + @Override + protected void oneRound() { +// mGLSurfaceView.requestRender(); + } + + public static final int ACCEL_ID = Menu.FIRST; + public static final int COMPASS_ID = Menu.FIRST + 1; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + mGLSurfaceView = new MyGLSurfaceView(this); + mGLSurfaceView.setRenderer(new TeapotRenderer(5,1,1,this)); + setContentView(mGLSurfaceView); + startTester(); + } + + @Override + protected void onResume() { + super.onResume(); + mGLSurfaceView.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + mGLSurfaceView.onPause(); + } + +} diff --git a/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotRenderer.java b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotRenderer.java new file mode 100644 index 0000000..af17cf4 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/graphics_benchmarks/teapot/TeapotRenderer.java @@ -0,0 +1,1921 @@ +/* + * Copyright (C) 2008-2009 Koansin Tan + * + * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Origin: http://code.google.com/p/android-utah-teapot/ + */ + +package graphics_benchmarks.teapot; + +import graphics_benchmarks.graphics.Tester; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.ShortBuffer; + +import javax.microedition.khronos.egl.EGL10; +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +import android.util.Log; +import android.opengl.GLSurfaceView; + + +public class TeapotRenderer implements GLSurfaceView.Renderer { + static float teapot_vertices[] = { 0.0663056f, 0.117825f, 2.10688e-008f, + 0.0672f, 0.1152f, 2.05994e-008f, 0.0639726f, 0.117825f, 0.0178043f, + 0.0648356f, 0.1152f, 0.0180445f, 0.0573666f, 0.117825f, 0.0336931f, + 0.0581404f, 0.1152f, 0.0341476f, 0.0470769f, 0.117825f, 0.0470769f, + 0.047712f, 0.1152f, 0.047712f, 0.033693f, 0.117825f, 0.0573666f, + 0.0341476f, 0.1152f, 0.0581404f, 0.0178043f, 0.117825f, 0.0639726f, + 0.0180444f, 0.1152f, 0.0648356f, 0f, 0.117825f, 0.0663056f, 0f, + 0.1152f, 0.0672f, 0.0664444f, 0.1194f, 2.13504e-008f, 0.0641066f, + 0.1194f, 0.0178416f, 0.0574868f, 0.1194f, 0.0337636f, 0.0471755f, + 0.1194f, 0.0471756f, 0.0337636f, 0.1194f, 0.0574868f, 0.0178416f, + 0.1194f, 0.0641066f, 0f, 0.1194f, 0.0664444f, 0.06735f, 0.119925f, + 2.14443e-008f, 0.0649803f, 0.119925f, 0.0180847f, 0.0582702f, + 0.119925f, 0.0342238f, 0.0478185f, 0.119925f, 0.0478185f, + 0.0342238f, 0.119925f, 0.0582702f, 0.0180847f, 0.119925f, + 0.0649803f, 0f, 0.119925f, 0.06735f, 0.0687556f, 0.1194f, + 2.13504e-008f, 0.0663364f, 0.1194f, 0.0184622f, 0.0594863f, + 0.1194f, 0.034938f, 0.0488164f, 0.1194f, 0.0488164f, 0.034938f, + 0.1194f, 0.0594863f, 0.0184621f, 0.1194f, 0.0663364f, 0f, 0.1194f, + 0.0687556f, 0.0703944f, 0.117825f, 2.10688e-008f, 0.0679176f, + 0.117825f, 0.0189022f, 0.0609042f, 0.117825f, 0.0357708f, + 0.0499801f, 0.117825f, 0.0499801f, 0.0357708f, 0.117825f, + 0.0609042f, 0.0189022f, 0.117825f, 0.0679176f, 0f, 0.117825f, + 0.0703944f, 0.072f, 0.1152f, 2.05994e-008f, 0.0694667f, 0.1152f, + 0.0193333f, 0.0622933f, 0.1152f, 0.0365867f, 0.05112f, 0.1152f, + 0.05112f, 0.0365867f, 0.1152f, 0.0622933f, 0.0193333f, 0.1152f, + 0.0694667f, 0f, 0.1152f, 0.072f, -0.0178043f, 0.117825f, + 0.0639726f, -0.0180444f, 0.1152f, 0.0648356f, -0.033693f, + 0.117825f, 0.0573666f, -0.0341476f, 0.1152f, 0.0581404f, + -0.0470769f, 0.117825f, 0.0470769f, -0.047712f, 0.1152f, 0.047712f, + -0.0573666f, 0.117825f, 0.033693f, -0.0581404f, 0.1152f, + 0.0341476f, -0.0639726f, 0.117825f, 0.0178043f, -0.0648356f, + 0.1152f, 0.0180445f, -0.0663056f, 0.117825f, 2.10688e-008f, + -0.0672f, 0.1152f, 2.05994e-008f, -0.0178416f, 0.1194f, 0.0641066f, + -0.0337636f, 0.1194f, 0.0574867f, -0.0471756f, 0.1194f, 0.0471756f, + -0.0574867f, 0.1194f, 0.0337636f, -0.0641066f, 0.1194f, 0.0178416f, + -0.0664444f, 0.1194f, 2.13504e-008f, -0.0180847f, 0.119925f, + 0.0649803f, -0.0342238f, 0.119925f, 0.0582702f, -0.0478185f, + 0.119925f, 0.0478185f, -0.0582702f, 0.119925f, 0.0342238f, + -0.0649803f, 0.119925f, 0.0180847f, -0.06735f, 0.119925f, + 2.14443e-008f, 0f, 0.1194f, 0.0687556f, -0.0184621f, 0.1194f, + 0.0663364f, -0.034938f, 0.1194f, 0.0594863f, -0.0488164f, 0.1194f, + 0.0488164f, -0.0594863f, 0.1194f, 0.034938f, -0.0663364f, 0.1194f, + 0.0184621f, -0.0687556f, 0.1194f, 2.13504e-008f, 0f, 0.117825f, + 0.0703944f, -0.0189022f, 0.117825f, 0.0679176f, -0.0357708f, + 0.117825f, 0.0609042f, -0.0499801f, 0.117825f, 0.0499801f, + -0.0609042f, 0.117825f, 0.0357708f, -0.0679176f, 0.117825f, + 0.0189022f, -0.0703944f, 0.117825f, 2.10688e-008f, -0.0193333f, + 0.1152f, 0.0694667f, -0.0365867f, 0.1152f, 0.0622933f, -0.05112f, + 0.1152f, 0.05112f, -0.0622933f, 0.1152f, 0.0365867f, -0.0694667f, + 0.1152f, 0.0193333f, -0.072f, 0.1152f, 2.05994e-008f, -0.0663055f, + 0.117825f, 2.10688e-008f, -0.0639726f, 0.117825f, -0.0178043f, + -0.0648356f, 0.1152f, -0.0180444f, -0.0573666f, 0.117825f, + -0.033693f, -0.0581404f, 0.1152f, -0.0341475f, -0.0470769f, + 0.117825f, -0.0470769f, -0.047712f, 0.1152f, -0.047712f, + -0.033693f, 0.117825f, -0.0573666f, -0.0341476f, 0.1152f, + -0.0581404f, -0.0178043f, 0.117825f, -0.0639726f, -0.0180444f, + 0.1152f, -0.0648356f, 0f, 0.117825f, -0.0663055f, 0f, 0.1152f, + -0.0672f, -0.0664444f, 0.1194f, 2.13504e-008f, -0.0641066f, + 0.1194f, -0.0178416f, -0.0574867f, 0.1194f, -0.0337636f, + -0.0471756f, 0.1194f, -0.0471756f, -0.0337636f, 0.1194f, + -0.0574868f, -0.0178416f, 0.1194f, -0.0641066f, 0f, 0.1194f, + -0.0664444f, -0.0649803f, 0.119925f, -0.0180847f, -0.0582702f, + 0.119925f, -0.0342238f, -0.0478185f, 0.119925f, -0.0478185f, + -0.0342238f, 0.119925f, -0.0582702f, -0.0180847f, 0.119925f, + -0.0649803f, 0f, 0.119925f, -0.06735f, -0.0663364f, 0.1194f, + -0.0184621f, -0.0594863f, 0.1194f, -0.034938f, -0.0488164f, + 0.1194f, -0.0488164f, -0.034938f, 0.1194f, -0.0594863f, + -0.0184621f, 0.1194f, -0.0663364f, 0f, 0.1194f, -0.0687556f, + -0.0703944f, 0.117825f, 2.10688e-008f, -0.0679176f, 0.117825f, + -0.0189022f, -0.0609042f, 0.117825f, -0.0357708f, -0.0499801f, + 0.117825f, -0.0499801f, -0.0357708f, 0.117825f, -0.0609042f, + -0.0189022f, 0.117825f, -0.0679176f, 0f, 0.117825f, -0.0703944f, + -0.0694667f, 0.1152f, -0.0193333f, -0.0622933f, 0.1152f, + -0.0365867f, -0.05112f, 0.1152f, -0.05112f, -0.0365867f, 0.1152f, + -0.0622933f, -0.0193333f, 0.1152f, -0.0694667f, 0f, 0.1152f, + -0.072f, 0.0178043f, 0.117825f, -0.0639726f, 0.0180444f, 0.1152f, + -0.0648356f, 0.033693f, 0.117825f, -0.0573666f, 0.0341476f, + 0.1152f, -0.0581404f, 0.0470769f, 0.117825f, -0.0470769f, + 0.047712f, 0.1152f, -0.047712f, 0.0573666f, 0.117825f, -0.033693f, + 0.0581404f, 0.1152f, -0.0341475f, 0.0639726f, 0.117825f, + -0.0178043f, 0.0648356f, 0.1152f, -0.0180444f, 0.0663055f, + 0.117825f, 2.10688e-008f, 0.0178416f, 0.1194f, -0.0641066f, + 0.0337636f, 0.1194f, -0.0574867f, 0.0471756f, 0.1194f, -0.0471756f, + 0.0574868f, 0.1194f, -0.0337636f, 0.0641066f, 0.1194f, -0.0178415f, + 0.0664444f, 0.1194f, 2.13504e-008f, 0.0180847f, 0.119925f, + -0.0649803f, 0.0342238f, 0.119925f, -0.0582702f, 0.0478185f, + 0.119925f, -0.0478185f, 0.0582702f, 0.119925f, -0.0342238f, + 0.0649803f, 0.119925f, -0.0180847f, 0.0184621f, 0.1194f, + -0.0663364f, 0.034938f, 0.1194f, -0.0594863f, 0.0488164f, 0.1194f, + -0.0488164f, 0.0594863f, 0.1194f, -0.034938f, 0.0663364f, 0.1194f, + -0.0184621f, 0.0687556f, 0.1194f, 2.13504e-008f, 0.0189022f, + 0.117825f, -0.0679176f, 0.0357708f, 0.117825f, -0.0609042f, + 0.0499801f, 0.117825f, -0.0499801f, 0.0609042f, 0.117825f, + -0.0357708f, 0.0679176f, 0.117825f, -0.0189022f, 0.0703944f, + 0.117825f, 2.10688e-008f, 0.0193333f, 0.1152f, -0.0694667f, + 0.0365867f, 0.1152f, -0.0622933f, 0.05112f, 0.1152f, -0.05112f, + 0.0622933f, 0.1152f, -0.0365867f, 0.0694667f, 0.1152f, -0.0193333f, + 0.0779444f, 0.102617f, 1.83493e-008f, 0.075202f, 0.102617f, + 0.0209295f, 0.0694667f, 0.1152f, 0.0193333f, 0.0674364f, 0.102617f, + 0.0396073f, 0.0622933f, 0.1152f, 0.0365867f, 0.0553406f, 0.102617f, + 0.0553406f, 0.0396073f, 0.102617f, 0.0674364f, 0.0365867f, 0.1152f, + 0.0622933f, 0.0209296f, 0.102617f, 0.0752019f, 0.0193334f, 0.1152f, + 0.0694667f, 0f, 0.102617f, 0.0779444f, 0.0835556f, 0.0901333f, + 1.61171e-008f, 0.0806156f, 0.0901333f, 0.0224362f, 0.072291f, + 0.0901333f, 0.0424586f, 0.0593244f, 0.0901334f, 0.0593245f, + 0.0424586f, 0.0901333f, 0.072291f, 0.0224362f, 0.0901333f, + 0.0806156f, 0f, 0.0901333f, 0.0835556f, 0.0885f, 0.07785f, + 1.39207e-008f, 0.0853861f, 0.07785f, 0.0237639f, 0.0765689f, + 0.07785f, 0.0449711f, 0.062835f, 0.07785f, 0.062835f, 0.0449711f, + 0.07785f, 0.0765689f, 0.0237639f, 0.07785f, 0.0853861f, 0f, + 0.07785f, 0.0885f, 0.0924444f, 0.0658667f, 1.17779e-008f, + 0.0891918f, 0.0658667f, 0.024823f, 0.0799816f, 0.0658667f, + 0.0469755f, 0.0656356f, 0.0658667f, 0.0656356f, 0.0469755f, + 0.0658667f, 0.0799816f, 0.0248231f, 0.0658667f, 0.0891918f, 0f, + 0.0658667f, 0.0924444f, 0.0950556f, 0.0542833f, 9.7066e-009f, + 0.091711f, 0.0542833f, 0.0255242f, 0.0822407f, 0.0542833f, + 0.0483023f, 0.0674895f, 0.0542833f, 0.0674895f, 0.0483023f, + 0.0542833f, 0.0822406f, 0.0255242f, 0.0542833f, 0.091711f, 0f, + 0.0542833f, 0.0950556f, 0.096f, 0.0432f, 7.72476e-009f, 0.0926222f, + 0.0432f, 0.0257778f, 0.0830578f, 0.0432f, 0.0487822f, 0.06816f, + 0.0432f, 0.06816f, 0.0487822f, 0.0432f, 0.0830578f, 0.0257778f, + 0.0432f, 0.0926222f, 0f, 0.0432f, 0.096f, 0f, 0.102617f, + 0.0779444f, -0.0209295f, 0.102617f, 0.075202f, -0.0193333f, + 0.1152f, 0.0694667f, -0.0396073f, 0.102617f, 0.0674364f, + -0.0365867f, 0.1152f, 0.0622933f, -0.0553405f, 0.102617f, + 0.0553405f, -0.0674364f, 0.102617f, 0.0396073f, -0.0622933f, + 0.1152f, 0.0365867f, -0.075202f, 0.102617f, 0.0209296f, + -0.0694667f, 0.1152f, 0.0193334f, -0.0779444f, 0.102617f, + 1.83493e-008f, 0f, 0.0901333f, 0.0835555f, -0.0224362f, 0.0901333f, + 0.0806156f, -0.0424586f, 0.0901333f, 0.072291f, -0.0593244f, + 0.0901334f, 0.0593244f, -0.072291f, 0.0901334f, 0.0424586f, + -0.0806156f, 0.0901333f, 0.0224362f, -0.0835555f, 0.0901333f, + 1.61171e-008f, -0.0237639f, 0.07785f, 0.0853861f, -0.0449711f, + 0.07785f, 0.0765689f, -0.062835f, 0.07785f, 0.062835f, -0.0765689f, + 0.07785f, 0.0449711f, -0.0853861f, 0.07785f, 0.0237639f, -0.0885f, + 0.07785f, 1.39207e-008f, 0f, 0.0658667f, 0.0924444f, -0.024823f, + 0.0658667f, 0.0891918f, -0.0469755f, 0.0658667f, 0.0799816f, + -0.0656356f, 0.0658667f, 0.0656356f, -0.0799816f, 0.0658667f, + 0.0469755f, -0.0891918f, 0.0658667f, 0.0248231f, -0.0924444f, + 0.0658667f, 1.17779e-008f, 0f, 0.0542833f, 0.0950556f, -0.0255242f, + 0.0542833f, 0.091711f, -0.0483023f, 0.0542833f, 0.0822407f, + -0.0674894f, 0.0542834f, 0.0674894f, -0.0822406f, 0.0542834f, + 0.0483023f, -0.091711f, 0.0542833f, 0.0255242f, -0.0950556f, + 0.0542833f, 9.70661e-009f, -0.0257778f, 0.0432f, 0.0926222f, + -0.0487822f, 0.0432f, 0.0830578f, -0.06816f, 0.0432f, 0.06816f, + -0.0830578f, 0.0432f, 0.0487822f, -0.0926222f, 0.0432f, 0.0257778f, + -0.096f, 0.0432f, 7.72476e-009f, -0.0779444f, 0.102617f, + 1.83493e-008f, -0.075202f, 0.102617f, -0.0209295f, -0.0694667f, + 0.1152f, -0.0193333f, -0.0674364f, 0.102617f, -0.0396073f, + -0.0622933f, 0.1152f, -0.0365866f, -0.0553406f, 0.102617f, + -0.0553406f, -0.0396073f, 0.102617f, -0.0674364f, -0.0365867f, + 0.1152f, -0.0622933f, -0.0209296f, 0.102617f, -0.0752019f, + -0.0193334f, 0.1152f, -0.0694667f, 0f, 0.102617f, -0.0779444f, + -0.0835556f, 0.0901333f, 1.61171e-008f, -0.0806156f, 0.0901333f, + -0.0224362f, -0.072291f, 0.0901333f, -0.0424586f, -0.0593244f, + 0.0901333f, -0.0593244f, -0.0424586f, 0.0901333f, -0.072291f, + -0.0224362f, 0.0901333f, -0.0806156f, 0f, 0.0901333f, -0.0835556f, + -0.0853861f, 0.07785f, -0.0237639f, -0.0765689f, 0.07785f, + -0.0449711f, -0.062835f, 0.07785f, -0.062835f, -0.0449711f, + 0.07785f, -0.0765689f, -0.0237639f, 0.07785f, -0.0853861f, 0f, + 0.07785f, -0.0885f, -0.0924444f, 0.0658666f, 1.17779e-008f, + -0.0891918f, 0.0658666f, -0.024823f, -0.0799816f, 0.0658666f, + -0.0469755f, -0.0656356f, 0.0658666f, -0.0656356f, -0.0469755f, + 0.0658666f, -0.0799816f, -0.0248231f, 0.0658666f, -0.0891918f, 0f, + 0.0658666f, -0.0924444f, -0.0950556f, 0.0542833f, 9.7066e-009f, + -0.091711f, 0.0542833f, -0.0255242f, -0.0822407f, 0.0542833f, + -0.0483023f, -0.0674894f, 0.0542833f, -0.0674894f, -0.0483023f, + 0.0542833f, -0.0822407f, -0.0255242f, 0.0542833f, -0.091711f, 0f, + 0.0542833f, -0.0950556f, -0.0926222f, 0.0432f, -0.0257778f, + -0.0830578f, 0.0432f, -0.0487822f, -0.06816f, 0.0432f, -0.06816f, + -0.0487822f, 0.0432f, -0.0830578f, -0.0257778f, 0.0432f, + -0.0926222f, 0f, 0.0432f, -0.096f, 0.0209295f, 0.102617f, + -0.075202f, 0.0193333f, 0.1152f, -0.0694667f, 0.0396073f, + 0.102617f, -0.0674364f, 0.0365867f, 0.1152f, -0.0622933f, + 0.0553406f, 0.102617f, -0.0553406f, 0.0674364f, 0.102617f, + -0.0396073f, 0.0622933f, 0.1152f, -0.0365867f, 0.0752019f, + 0.102617f, -0.0209295f, 0.0694667f, 0.1152f, -0.0193333f, + 0.0779444f, 0.102617f, 1.83493e-008f, 0.0224362f, 0.0901333f, + -0.0806156f, 0.0424586f, 0.0901333f, -0.072291f, 0.0593244f, + 0.0901333f, -0.0593244f, 0.072291f, 0.0901333f, -0.0424586f, + 0.0806156f, 0.0901333f, -0.0224362f, 0.0835556f, 0.0901333f, + 1.61171e-008f, 0.0237639f, 0.07785f, -0.0853861f, 0.0449711f, + 0.07785f, -0.0765689f, 0.062835f, 0.07785f, -0.062835f, 0.0765689f, + 0.07785f, -0.0449711f, 0.0853861f, 0.07785f, -0.0237639f, + 0.024823f, 0.0658666f, -0.0891918f, 0.0469755f, 0.0658666f, + -0.0799816f, 0.0656356f, 0.0658666f, -0.0656356f, 0.0799816f, + 0.0658666f, -0.0469755f, 0.0891918f, 0.0658666f, -0.0248231f, + 0.0924444f, 0.0658666f, 1.17779e-008f, 0.0255242f, 0.0542833f, + -0.091711f, 0.0483023f, 0.0542833f, -0.0822407f, 0.0674894f, + 0.0542833f, -0.0674894f, 0.0822407f, 0.0542833f, -0.0483023f, + 0.091711f, 0.0542833f, -0.0255242f, 0.0950556f, 0.0542833f, + 9.7066e-009f, 0.0257778f, 0.0432f, -0.0926222f, 0.0487822f, + 0.0432f, -0.0830578f, 0.06816f, 0.0432f, -0.06816f, 0.0830578f, + 0.0432f, -0.0487822f, 0.0926222f, 0.0432f, -0.0257778f, 0.0942222f, + 0.0332833f, 5.95152e-009f, 0.090907f, 0.0332833f, 0.0253004f, + 0.0815197f, 0.0332833f, 0.0478788f, 0.0668978f, 0.0332833f, + 0.0668978f, 0.0478789f, 0.0332833f, 0.0815197f, 0.0253004f, + 0.0332833f, 0.090907f, 0f, 0.0332833f, 0.0942222f, 0.0897778f, + 0.0250667f, 4.48227e-009f, 0.0866189f, 0.0250667f, 0.024107f, + 0.0776744f, 0.0250667f, 0.0456204f, 0.0637422f, 0.0250667f, + 0.0637422f, 0.0456204f, 0.0250667f, 0.0776744f, 0.024107f, + 0.0250667f, 0.0866189f, 0f, 0.0250667f, 0.0897778f, 0.084f, + 0.01845f, 3.29912e-009f, 0.0810445f, 0.01845f, 0.0225556f, + 0.0726756f, 0.01845f, 0.0426844f, 0.05964f, 0.01845f, 0.05964f, + 0.0426845f, 0.01845f, 0.0726755f, 0.0225556f, 0.01845f, 0.0810444f, + 0f, 0.01845f, 0.084f, 0.0782222f, 0.0133334f, 2.38419e-009f, + 0.07547f, 0.0133333f, 0.0210041f, 0.0676767f, 0.0133333f, + 0.0397485f, 0.0555378f, 0.0133333f, 0.0555378f, 0.0397485f, + 0.0133333f, 0.0676767f, 0.0210041f, 0.0133333f, 0.07547f, 0f, + 0.0133333f, 0.0782222f, 0.0737778f, 0.00961668f, 1.7196e-009f, + 0.0711819f, 0.00961668f, 0.0198107f, 0.0638315f, 0.00961668f, + 0.03749f, 0.0523822f, 0.00961668f, 0.0523822f, 0.0374901f, + 0.00961668f, 0.0638314f, 0.0198107f, 0.00961668f, 0.0711819f, 0f, + 0.00961668f, 0.0737778f, 0.072f, 0.0072f, 1.28746e-009f, + 0.0694667f, 0.0072f, 0.0193333f, 0.0622933f, 0.00719999f, + 0.0365867f, 0.05112f, 0.00719999f, 0.05112f, 0.0365867f, + 0.00719999f, 0.0622933f, 0.0193334f, 0.00719999f, 0.0694667f, 0f, + 0.00719999f, 0.072f, -0.0253004f, 0.0332833f, 0.090907f, + -0.0478788f, 0.0332833f, 0.0815197f, -0.0668978f, 0.0332833f, + 0.0668978f, -0.0815197f, 0.0332833f, 0.0478789f, -0.090907f, + 0.0332833f, 0.0253004f, -0.0942222f, 0.0332833f, 5.95152e-009f, + -0.024107f, 0.0250667f, 0.0866189f, -0.0456204f, 0.0250667f, + 0.0776744f, -0.0637422f, 0.0250667f, 0.0637422f, -0.0776744f, + 0.0250667f, 0.0456204f, -0.0866189f, 0.0250667f, 0.024107f, + -0.0897778f, 0.0250667f, 4.48227e-009f, -0.0225556f, 0.01845f, + 0.0810445f, -0.0426844f, 0.01845f, 0.0726756f, -0.05964f, 0.01845f, + 0.05964f, -0.0726755f, 0.01845f, 0.0426845f, -0.0810444f, 0.01845f, + 0.0225556f, -0.084f, 0.01845f, 3.29912e-009f, -0.0210041f, + 0.0133333f, 0.07547f, -0.0397485f, 0.0133333f, 0.0676767f, + -0.0555378f, 0.0133333f, 0.0555378f, -0.0676767f, 0.0133333f, + 0.0397485f, -0.07547f, 0.0133333f, 0.0210041f, -0.0782222f, + 0.0133334f, 2.38419e-009f, -0.0198107f, 0.00961668f, 0.0711819f, + -0.03749f, 0.00961667f, 0.0638315f, -0.0523822f, 0.00961668f, + 0.0523822f, -0.0638314f, 0.00961668f, 0.0374901f, -0.0711819f, + 0.00961668f, 0.0198107f, -0.0737778f, 0.00961668f, 1.7196e-009f, + -0.0193333f, 0.00719999f, 0.0694667f, -0.0365867f, 0.00719999f, + 0.0622933f, -0.05112f, 0.00719999f, 0.05112f, -0.0622933f, + 0.00719999f, 0.0365867f, -0.0694667f, 0.0072f, 0.0193334f, -0.072f, + 0.0072f, 1.28746e-009f, -0.090907f, 0.0332833f, -0.0253004f, + -0.0815197f, 0.0332833f, -0.0478788f, -0.0668978f, 0.0332833f, + -0.0668978f, -0.0478789f, 0.0332833f, -0.0815197f, -0.0253004f, + 0.0332833f, -0.090907f, 0f, 0.0332833f, -0.0942222f, -0.0866189f, + 0.0250667f, -0.024107f, -0.0776744f, 0.0250667f, -0.0456204f, + -0.0637422f, 0.0250667f, -0.0637422f, -0.0456204f, 0.0250667f, + -0.0776744f, -0.024107f, 0.0250667f, -0.0866189f, 0f, 0.0250667f, + -0.0897778f, -0.0810445f, 0.01845f, -0.0225556f, -0.0726756f, + 0.01845f, -0.0426844f, -0.05964f, 0.01845f, -0.05964f, -0.0426845f, + 0.01845f, -0.0726755f, -0.0225556f, 0.01845f, -0.0810444f, 0f, + 0.01845f, -0.084f, -0.07547f, 0.0133334f, -0.0210041f, -0.0676767f, + 0.0133334f, -0.0397485f, -0.0555378f, 0.0133334f, -0.0555378f, + -0.0397485f, 0.0133334f, -0.0676767f, -0.0210041f, 0.0133334f, + -0.07547f, 0f, 0.0133334f, -0.0782222f, -0.0711819f, 0.00961669f, + -0.0198107f, -0.0638315f, 0.00961669f, -0.03749f, -0.0523822f, + 0.00961669f, -0.0523822f, -0.0374901f, 0.00961669f, -0.0638314f, + -0.0198107f, 0.00961669f, -0.0711819f, 0f, 0.00961669f, + -0.0737778f, -0.0694667f, 0.0072f, -0.0193333f, -0.0622933f, + 0.00720001f, -0.0365867f, -0.05112f, 0.00720001f, -0.05112f, + -0.0365867f, 0.00720001f, -0.0622933f, -0.0193334f, 0.00720001f, + -0.0694667f, 0f, 0.00720001f, -0.072f, 0.0253004f, 0.0332833f, + -0.090907f, 0.0478788f, 0.0332833f, -0.0815197f, 0.0668978f, + 0.0332833f, -0.0668978f, 0.0815197f, 0.0332833f, -0.0478789f, + 0.090907f, 0.0332833f, -0.0253004f, 0.024107f, 0.0250667f, + -0.0866189f, 0.0456204f, 0.0250667f, -0.0776744f, 0.0637422f, + 0.0250667f, -0.0637422f, 0.0776744f, 0.0250667f, -0.0456204f, + 0.0866189f, 0.0250667f, -0.024107f, 0.0225556f, 0.01845f, + -0.0810445f, 0.0426844f, 0.01845f, -0.0726756f, 0.05964f, 0.01845f, + -0.05964f, 0.0726755f, 0.01845f, -0.0426845f, 0.0810444f, 0.01845f, + -0.0225556f, 0.0210041f, 0.0133334f, -0.07547f, 0.0397485f, + 0.0133334f, -0.0676767f, 0.0555378f, 0.0133334f, -0.0555378f, + 0.0676767f, 0.0133334f, -0.0397485f, 0.07547f, 0.0133334f, + -0.0210041f, 0.0198107f, 0.00961669f, -0.0711819f, 0.03749f, + 0.00961669f, -0.0638315f, 0.0523822f, 0.00961669f, -0.0523822f, + 0.0638314f, 0.00961669f, -0.0374901f, 0.0711819f, 0.00961668f, + -0.0198107f, 0.0193333f, 0.00720001f, -0.0694667f, 0.0365867f, + 0.00720001f, -0.0622933f, 0.05112f, 0.00720001f, -0.05112f, + 0.0622933f, 0.00720001f, -0.0365867f, 0.0694667f, 0.0072f, + -0.0193334f, -0.0923778f, 0.09715f, 1.73718e-008f, -0.0768f, + 0.0972f, 1.73807e-008f, -0.0924979f, 0.0979463f, 0.00600001f, + -0.0764444f, 0.098f, 0.00600001f, -0.0927984f, 0.099937f, + 0.00960001f, -0.0755556f, 0.1f, 0.00960001f, -0.0931889f, + 0.102525f, 0.0108f, -0.0744f, 0.1026f, 0.0108f, -0.0935794f, + 0.105113f, 0.0096f, -0.0732444f, 0.1052f, 0.0096f, -0.0938798f, + 0.107104f, 0.006f, -0.0723556f, 0.1072f, 0.006f, -0.094f, 0.1079f, + 1.9294e-008f, -0.072f, 0.108f, 1.93119e-008f, -0.105422f, 0.0968f, + 1.73092e-008f, -0.105909f, 0.0975704f, 0.00600001f, -0.107128f, + 0.0994963f, 0.00960001f, -0.108711f, 0.102f, 0.0108f, -0.110295f, + 0.104504f, 0.0096f, -0.111513f, 0.10643f, 0.006f, -0.112f, 0.1072f, + 1.91688e-008f, -0.1158f, 0.09585f, 1.71393e-008f, -0.116556f, + 0.09655f, 0.00600001f, -0.118444f, 0.0983f, 0.00960001f, -0.1209f, + 0.100575f, 0.0108f, -0.123356f, 0.10285f, 0.0096f, -0.125244f, + 0.1046f, 0.006f, -0.126f, 0.1053f, 1.88291e-008f, -0.123378f, + 0.094f, 1.68085e-008f, -0.124313f, 0.094563f, 0.00600001f, + -0.12665f, 0.0959704f, 0.00960001f, -0.129689f, 0.0978f, 0.0108f, + -0.132728f, 0.0996296f, 0.0096f, -0.135065f, 0.101037f, 0.006f, + -0.136f, 0.1016f, 1.81675e-008f, -0.128022f, 0.09095f, + 1.62631e-008f, -0.129058f, 0.091287f, 0.00600001f, -0.131646f, + 0.0921296f, 0.00960001f, -0.135011f, 0.093225f, 0.0108f, + -0.138376f, 0.0943204f, 0.0096f, -0.140965f, 0.095163f, 0.006f, + -0.142f, 0.0955f, 1.70767e-008f, -0.1296f, 0.0864f, 1.54495e-008f, + -0.130667f, 0.0864f, 0.00600001f, -0.133333f, 0.0864f, 0.00960001f, + -0.1368f, 0.0864f, 0.0108f, -0.140267f, 0.0864f, 0.0096f, + -0.142933f, 0.0864f, 0.006f, -0.144f, 0.0864f, 1.54495e-008f, + -0.0938798f, 0.107104f, -0.00599999f, -0.0723556f, 0.1072f, + -0.00599999f, -0.0935794f, 0.105113f, -0.0096f, -0.0732444f, + 0.1052f, -0.0096f, -0.0931889f, 0.102525f, -0.0108f, -0.0744f, + 0.1026f, -0.0108f, -0.0927983f, 0.099937f, -0.00959999f, + -0.0755556f, 0.1f, -0.00959999f, -0.0924979f, 0.0979463f, + -0.00599998f, -0.0764444f, 0.098f, -0.00599998f, -0.0923778f, + 0.09715f, 1.73718e-008f, -0.112f, 0.1072f, 1.91688e-008f, + -0.111513f, 0.10643f, -0.00599999f, -0.110295f, 0.104504f, + -0.00959999f, -0.108711f, 0.102f, -0.0108f, -0.107128f, 0.0994963f, + -0.00959999f, -0.105909f, 0.0975704f, -0.00599998f, -0.105422f, + 0.0968f, 1.73092e-008f, -0.125244f, 0.1046f, -0.00599999f, + -0.123356f, 0.10285f, -0.0096f, -0.1209f, 0.100575f, -0.0108f, + -0.118444f, 0.0983f, -0.00959999f, -0.116556f, 0.09655f, + -0.00599998f, -0.136f, 0.1016f, 1.81675e-008f, -0.135065f, + 0.101037f, -0.00599999f, -0.132728f, 0.0996296f, -0.0096f, + -0.129689f, 0.0978f, -0.0108f, -0.12665f, 0.0959704f, -0.00959999f, + -0.124313f, 0.094563f, -0.00599998f, -0.123378f, 0.094f, + 1.68085e-008f, -0.142f, 0.0955f, 1.70767e-008f, -0.140965f, + 0.095163f, -0.00599999f, -0.138376f, 0.0943204f, -0.0096f, + -0.135011f, 0.093225f, -0.0108f, -0.131646f, 0.0921296f, + -0.00959999f, -0.129058f, 0.091287f, -0.00599998f, -0.128022f, + 0.09095f, 1.62631e-008f, -0.142933f, 0.0864f, -0.00599999f, + -0.140267f, 0.0864f, -0.0096f, -0.1368f, 0.0864f, -0.0108f, + -0.133333f, 0.0864f, -0.00959999f, -0.130667f, 0.0864f, + -0.00599998f, -0.128778f, 0.0802f, 1.43409e-008f, -0.129801f, + 0.079871f, 0.00600001f, -0.132358f, 0.0790484f, 0.00960001f, + -0.135683f, 0.0779792f, 0.0108f, -0.139008f, 0.0769099f, 0.0096f, + -0.141566f, 0.0760873f, 0.006f, -0.142589f, 0.0757583f, + 1.35466e-008f, -0.126222f, 0.0728f, 1.30176e-008f, -0.127118f, + 0.0722568f, 0.00600001f, -0.129356f, 0.0708988f, 0.00960001f, + -0.132267f, 0.0691333f, 0.0108f, -0.135177f, 0.0673679f, 0.0096f, + -0.137416f, 0.0660099f, 0.00599999f, -0.138311f, 0.0654667f, + 1.17063e-008f, -0.1218f, 0.0648f, 1.15871e-008f, -0.122489f, + 0.0641167f, 0.00600001f, -0.124211f, 0.0624083f, 0.00960001f, + -0.12645f, 0.0601875f, 0.0108f, -0.128689f, 0.0579667f, 0.0096f, + -0.130411f, 0.0562583f, 0.00599999f, -0.1311f, 0.055575f, + 9.93757e-009f, -0.115378f, 0.0568f, 1.01566e-008f, -0.115786f, + 0.0560099f, 0.00600001f, -0.116807f, 0.0540345f, 0.0096f, + -0.118133f, 0.0514667f, 0.0108f, -0.11946f, 0.0488987f, 0.0096f, + -0.120481f, 0.0469234f, 0.00599999f, -0.120889f, 0.0461333f, + 8.24927e-009f, -0.106822f, 0.0494f, 8.8334e-009f, -0.106881f, + 0.0484957f, 0.00600001f, -0.107027f, 0.0462349f, 0.00960001f, + -0.107217f, 0.0432958f, 0.0108f, -0.107407f, 0.0403568f, 0.0096f, + -0.107553f, 0.038096f, 0.00599999f, -0.107611f, 0.0371916f, + 6.65038e-009f, -0.0956444f, 0.0421333f, 0.00600001f, -0.0947556f, + 0.0394667f, 0.0096f, -0.0936f, 0.036f, 0.0108f, -0.0924444f, + 0.0325333f, 0.0096f, -0.0915556f, 0.0298667f, 0.00599999f, + -0.0912f, 0.0288f, 5.14984e-009f, -0.141566f, 0.0760873f, + -0.00599999f, -0.139008f, 0.0769099f, -0.0096f, -0.135683f, + 0.0779792f, -0.0108f, -0.132358f, 0.0790484f, -0.00959999f, + -0.129801f, 0.079871f, -0.00599998f, -0.137416f, 0.0660099f, + -0.006f, -0.135177f, 0.0673679f, -0.0096f, -0.132267f, 0.0691333f, + -0.0108f, -0.129356f, 0.0708988f, -0.00959999f, -0.127118f, + 0.0722568f, -0.00599998f, -0.130411f, 0.0562583f, -0.006f, + -0.128689f, 0.0579667f, -0.0096f, -0.12645f, 0.0601875f, -0.0108f, + -0.124211f, 0.0624083f, -0.00959999f, -0.122489f, 0.0641167f, + -0.00599998f, -0.120481f, 0.0469234f, -0.006f, -0.11946f, + 0.0488988f, -0.0096f, -0.118133f, 0.0514667f, -0.0108f, -0.116807f, + 0.0540346f, -0.00959999f, -0.115786f, 0.0560099f, -0.00599998f, + -0.107553f, 0.038096f, -0.006f, -0.107407f, 0.0403568f, -0.0096f, + -0.107217f, 0.0432958f, -0.0108f, -0.107027f, 0.0462349f, + -0.00959999f, -0.106881f, 0.0484957f, -0.00599998f, -0.0915556f, + 0.0298667f, -0.006f, -0.0924444f, 0.0325333f, -0.0096f, -0.0936f, + 0.036f, -0.0108f, -0.0947556f, 0.0394667f, -0.00959999f, + -0.0956445f, 0.0421333f, -0.00599998f, 0.0988222f, 0.0708667f, + 1.2672e-008f, 0.0816f, 0.0684f, 1.22309e-008f, 0.0994741f, + 0.0684099f, 0.0125926f, 0.0816f, 0.0654667f, 0.0132f, 0.101104f, + 0.0622679f, 0.0201482f, 0.0816f, 0.0581333f, 0.02112f, 0.103222f, + 0.0542833f, 0.0226667f, 0.0816f, 0.0486f, 0.02376f, 0.105341f, + 0.0462987f, 0.0201481f, 0.0816f, 0.0390666f, 0.02112f, 0.10697f, + 0.0401568f, 0.0125926f, 0.0816f, 0.0317333f, 0.0132f, 0.107622f, + 0.0377f, 6.74128e-009f, 0.0816f, 0.0288f, 5.14984e-009f, 0.108978f, + 0.0773333f, 1.38283e-008f, 0.109926f, 0.0754568f, 0.0110741f, + 0.112296f, 0.0707654f, 0.0177185f, 0.115378f, 0.0646667f, + 0.0199333f, 0.118459f, 0.0585679f, 0.0177185f, 0.12083f, + 0.0538765f, 0.0110741f, 0.121778f, 0.052f, 9.29832e-009f, 0.1146f, + 0.0864f, 1.54495e-008f, 0.115667f, 0.0851333f, 0.00910001f, + 0.118333f, 0.0819667f, 0.01456f, 0.1218f, 0.07785f, 0.01638f, + 0.125267f, 0.0737333f, 0.01456f, 0.127933f, 0.0705667f, + 0.00909999f, 0.129f, 0.0693f, 1.23918e-008f, 0.118222f, 0.0966667f, + 1.72853e-008f, 0.119407f, 0.0959654f, 0.00712594f, 0.12237f, + 0.0942123f, 0.0114015f, 0.126222f, 0.0919333f, 0.0128267f, + 0.130074f, 0.0896543f, 0.0114015f, 0.133037f, 0.0879012f, + 0.00712592f, 0.134222f, 0.0872f, 1.55926e-008f, 0.122378f, + 0.106733f, 1.90854e-008f, 0.123859f, 0.106479f, 0.00560742f, + 0.127563f, 0.105843f, 0.00897186f, 0.132378f, 0.105017f, + 0.0100933f, 0.137193f, 0.10419f, 0.00897185f, 0.140896f, 0.103554f, + 0.00560741f, 0.142378f, 0.1033f, 1.84715e-008f, 0.1296f, 0.1152f, + 2.05994e-008f, 0.131733f, 0.1152f, 0.00500001f, 0.137067f, 0.1152f, + 0.00800001f, 0.144f, 0.1152f, 0.00900001f, 0.150933f, 0.1152f, + 0.008f, 0.156267f, 0.1152f, 0.005f, 0.1584f, 0.1152f, + 2.05994e-008f, 0.107622f, 0.0377f, 6.74128e-009f, 0.10697f, + 0.0401568f, -0.0125926f, 0.0816f, 0.0317333f, -0.0132f, 0.105341f, + 0.0462988f, -0.0201482f, 0.0816f, 0.0390667f, -0.02112f, 0.103222f, + 0.0542833f, -0.0226667f, 0.0816f, 0.0486f, -0.02376f, 0.101104f, + 0.0622679f, -0.0201481f, 0.0816f, 0.0581334f, -0.02112f, + 0.0994741f, 0.0684099f, -0.0125926f, 0.0816f, 0.0654667f, -0.0132f, + 0.0988222f, 0.0708667f, 1.2672e-008f, 0.121778f, 0.052f, + 9.29832e-009f, 0.12083f, 0.0538765f, -0.0110741f, 0.118459f, + 0.0585679f, -0.0177185f, 0.115378f, 0.0646667f, -0.0199333f, + 0.112296f, 0.0707654f, -0.0177185f, 0.109926f, 0.0754568f, + -0.011074f, 0.127933f, 0.0705667f, -0.0091f, 0.125267f, 0.0737333f, + -0.01456f, 0.1218f, 0.07785f, -0.01638f, 0.118333f, 0.0819667f, + -0.01456f, 0.115667f, 0.0851333f, -0.00909997f, 0.134222f, 0.0872f, + 1.55926e-008f, 0.133037f, 0.0879012f, -0.00712592f, 0.130074f, + 0.0896543f, -0.0114015f, 0.126222f, 0.0919333f, -0.0128267f, + 0.12237f, 0.0942123f, -0.0114015f, 0.119407f, 0.0959654f, + -0.0071259f, 0.118222f, 0.0966667f, 1.72853e-008f, 0.142378f, + 0.1033f, 1.84715e-008f, 0.140896f, 0.103554f, -0.0056074f, + 0.137193f, 0.10419f, -0.00897185f, 0.132378f, 0.105017f, + -0.0100933f, 0.127563f, 0.105843f, -0.00897184f, 0.123859f, + 0.106479f, -0.00560739f, 0.122378f, 0.106733f, 1.90854e-008f, + 0.156267f, 0.1152f, -0.00499999f, 0.150933f, 0.1152f, -0.00799999f, + 0.144f, 0.1152f, -0.00899999f, 0.137067f, 0.1152f, -0.00799999f, + 0.131733f, 0.1152f, -0.00499998f, 0.131956f, 0.1167f, + 2.08676e-008f, 0.134228f, 0.116732f, 0.00485187f, 0.139908f, + 0.116813f, 0.00776297f, 0.147292f, 0.116919f, 0.00873334f, + 0.154676f, 0.117024f, 0.00776297f, 0.160356f, 0.117105f, + 0.00485185f, 0.162628f, 0.117137f, 2.09458e-008f, 0.134044f, + 0.1176f, 2.10285e-008f, 0.136309f, 0.117659f, 0.0044815f, + 0.141972f, 0.117807f, 0.00717038f, 0.149333f, 0.118f, 0.00806668f, + 0.156695f, 0.118193f, 0.00717038f, 0.162357f, 0.118341f, + 0.00448149f, 0.164622f, 0.1184f, 2.11716e-008f, 0.1356f, 0.1179f, + 2.10822e-008f, 0.137744f, 0.117975f, 0.00400002f, 0.143106f, + 0.118162f, 0.00640002f, 0.150075f, 0.118406f, 0.00720001f, + 0.157044f, 0.11865f, 0.00640001f, 0.162406f, 0.118838f, + 0.00400001f, 0.16455f, 0.118912f, 2.12632e-008f, 0.136356f, + 0.1176f, 2.10285e-008f, 0.138298f, 0.117674f, 0.00351854f, + 0.143154f, 0.117859f, 0.00562965f, 0.149467f, 0.1181f, 0.00633335f, + 0.155779f, 0.118341f, 0.00562964f, 0.160635f, 0.118526f, + 0.00351853f, 0.162578f, 0.1186f, 2.12074e-008f, 0.136044f, 0.1167f, + 2.08676e-008f, 0.137735f, 0.116751f, 0.00314817f, 0.141963f, + 0.116878f, 0.00503706f, 0.147458f, 0.117044f, 0.00566668f, + 0.152954f, 0.117209f, 0.00503705f, 0.157181f, 0.117337f, + 0.00314816f, 0.158872f, 0.117387f, 2.09906e-008f, 0.1344f, 0.1152f, + 2.05994e-008f, 0.135822f, 0.1152f, 0.00300002f, 0.139378f, 0.1152f, + 0.00480002f, 0.144f, 0.1152f, 0.00540002f, 0.148622f, 0.1152f, + 0.00480002f, 0.152178f, 0.1152f, 0.00300001f, 0.1536f, 0.1152f, + 2.05994e-008f, 0.160356f, 0.117105f, -0.00485184f, 0.154676f, + 0.117024f, -0.00776296f, 0.147292f, 0.116919f, -0.00873333f, + 0.139908f, 0.116813f, -0.00776295f, 0.134228f, 0.116732f, + -0.00485183f, 0.162357f, 0.118341f, -0.00448147f, 0.156695f, + 0.118193f, -0.00717036f, 0.149333f, 0.118f, -0.00806666f, + 0.141972f, 0.117807f, -0.00717036f, 0.136309f, 0.117659f, + -0.00448146f, 0.162406f, 0.118837f, -0.00399998f, 0.157044f, + 0.11865f, -0.00639999f, 0.150075f, 0.118406f, -0.00719999f, + 0.143106f, 0.118162f, -0.00639998f, 0.137744f, 0.117975f, + -0.00399998f, 0.160635f, 0.118526f, -0.0035185f, 0.155779f, + 0.118341f, -0.00562961f, 0.149467f, 0.1181f, -0.00633332f, + 0.143154f, 0.117859f, -0.00562961f, 0.138298f, 0.117674f, + -0.00351849f, 0.157181f, 0.117337f, -0.00314813f, 0.152954f, + 0.117209f, -0.00503702f, 0.147458f, 0.117044f, -0.00566665f, + 0.141963f, 0.116878f, -0.00503701f, 0.137735f, 0.116751f, + -0.00314812f, 0.152178f, 0.1152f, -0.00299998f, 0.148622f, 0.1152f, + -0.00479998f, 0.144f, 0.1152f, -0.00539998f, 0.139378f, 0.1152f, + -0.00479998f, 0.135822f, 0.1152f, -0.00299997f, 0.0133778f, + 0.1501f, 2.684e-008f, 0f, 0.1512f, 2.70367e-008f, 0.0129094f, + 0.1501f, 0.00360378f, 0f, 0.1512f, 2.70367e-008f, 0.0115817f, + 0.1501f, 0.00681272f, 0f, 0.1512f, 2.70367e-008f, 0.00951072f, + 0.1501f, 0.00951074f, 0.00681272f, 0.1501f, 0.0115817f, + 0.00360377f, 0.1501f, 0.0129094f, 0f, 0.1501f, 0.0133778f, + 0.0174222f, 0.1472f, 2.63214e-008f, 0.0168122f, 0.1472f, + 0.00469302f, 0.0150829f, 0.1472f, 0.00887204f, 0.0123858f, 0.1472f, + 0.0123858f, 0.00887205f, 0.1472f, 0.0150829f, 0.00469303f, 0.1472f, + 0.0168122f, 0f, 0.1472f, 0.0174222f, 0.0156f, 0.1431f, + 2.55883e-008f, 0.0150536f, 0.1431f, 0.00420141f, 0.0135049f, + 0.1431f, 0.00794312f, 0.0110895f, 0.1431f, 0.0110895f, 0.00794312f, + 0.1431f, 0.0135049f, 0.00420141f, 0.1431f, 0.0150536f, 0f, 0.1431f, + 0.0156f, 0.0113778f, 0.1384f, 2.47478e-008f, 0.0109789f, 0.1384f, + 0.00306257f, 0.00984863f, 0.1384f, 0.00579109f, 0.00808622f, + 0.1384f, 0.00808624f, 0.00579109f, 0.1384f, 0.00984864f, + 0.00306257f, 0.1384f, 0.0109789f, 0f, 0.1384f, 0.0113778f, + 0.00822222f, 0.1337f, 2.39074e-008f, 0.00793338f, 0.1337f, + 0.00221015f, 0.00711523f, 0.1337f, 0.00418109f, 0.00584028f, + 0.1337f, 0.0058403f, 0.00418108f, 0.1337f, 0.00711524f, + 0.00221014f, 0.1337f, 0.0079334f, 0f, 0.1337f, 0.00822224f, + 0.0096f, 0.1296f, 2.31743e-008f, 0.00926222f, 0.1296f, 0.0025778f, + 0.00830578f, 0.1296f, 0.00487824f, 0.006816f, 0.1296f, 0.00681602f, + 0.00487823f, 0.1296f, 0.00830579f, 0.00257779f, 0.1296f, + 0.00926224f, 0f, 0.1296f, 0.00960002f, 0f, 0.1501f, 0.0133778f, + -0.00360375f, 0.1501f, 0.0129094f, -0.0068127f, 0.1501f, + 0.0115817f, -0.00951072f, 0.1501f, 0.00951074f, -0.0115817f, + 0.1501f, 0.00681274f, -0.0129094f, 0.1501f, 0.00360379f, + -0.0133778f, 0.1501f, 2.684e-008f, 0f, 0.1472f, 0.0174222f, + -0.004693f, 0.1472f, 0.0168122f, -0.00887203f, 0.1472f, 0.0150829f, + -0.0123858f, 0.1472f, 0.0123858f, -0.0150829f, 0.1472f, + 0.00887207f, -0.0168122f, 0.1472f, 0.00469305f, -0.0174222f, + 0.1472f, 2.63214e-008f, -0.00420139f, 0.1431f, 0.0150536f, + -0.0079431f, 0.1431f, 0.0135049f, -0.0110895f, 0.1431f, 0.0110895f, + -0.0135049f, 0.1431f, 0.00794314f, -0.0150536f, 0.1431f, + 0.00420143f, -0.0156f, 0.1431f, 2.55883e-008f, 0f, 0.1384f, + 0.0113778f, -0.00306255f, 0.1384f, 0.010979f, -0.00579108f, + 0.1384f, 0.00984865f, -0.00808623f, 0.1384f, 0.00808624f, + -0.00984862f, 0.1384f, 0.00579111f, -0.0109789f, 0.1384f, + 0.00306259f, -0.0113778f, 0.1384f, 2.47478e-008f, 0f, 0.1337f, + 0.00822224f, -0.00221013f, 0.1337f, 0.00793341f, -0.00418107f, + 0.1337f, 0.00711525f, -0.00584028f, 0.1337f, 0.0058403f, + -0.00711522f, 0.1337f, 0.0041811f, -0.00793338f, 0.1337f, + 0.00221017f, -0.00822222f, 0.1337f, 2.39074e-008f, -0.00257778f, + 0.1296f, 0.00926224f, -0.00487822f, 0.1296f, 0.0083058f, + -0.006816f, 0.1296f, 0.00681602f, -0.00830577f, 0.1296f, + 0.00487825f, -0.00926222f, 0.1296f, 0.00257781f, -0.0096f, 0.1296f, + 2.31743e-008f, -0.0133778f, 0.1501f, 2.684e-008f, -0.0129094f, + 0.1501f, -0.00360373f, -0.0115817f, 0.1501f, -0.00681268f, + -0.00951073f, 0.1501f, -0.00951071f, -0.00681272f, 0.1501f, + -0.0115816f, -0.00360377f, 0.1501f, -0.0129094f, 0f, 0.1501f, + -0.0133778f, -0.0174222f, 0.1472f, 2.63214e-008f, -0.0168122f, + 0.1472f, -0.00469298f, -0.0150829f, 0.1472f, -0.00887201f, + -0.0123858f, 0.1472f, -0.0123858f, -0.00887205f, 0.1472f, + -0.0150829f, -0.00469303f, 0.1472f, -0.0168122f, 0f, 0.1472f, + -0.0174222f, -0.0150536f, 0.1431f, -0.00420136f, -0.0135049f, + 0.1431f, -0.00794309f, -0.0110895f, 0.1431f, -0.0110895f, + -0.00794312f, 0.1431f, -0.0135049f, -0.00420141f, 0.1431f, + -0.0150536f, 0f, 0.1431f, -0.0156f, -0.0113778f, 0.1384f, + 2.47478e-008f, -0.0109789f, 0.1384f, -0.00306252f, -0.00984862f, + 0.1384f, -0.00579105f, -0.00808622f, 0.1384f, -0.0080862f, + -0.00579108f, 0.1384f, -0.0098486f, -0.00306256f, 0.1384f, + -0.0109789f, 0f, 0.1384f, -0.0113778f, -0.00822222f, 0.1337f, + 2.39074e-008f, -0.00793338f, 0.1337f, -0.00221011f, -0.00711523f, + 0.1337f, -0.00418104f, -0.00584028f, 0.1337f, -0.00584025f, + -0.00418108f, 0.1337f, -0.0071152f, -0.00221014f, 0.1337f, + -0.00793336f, 0f, 0.1337f, -0.0082222f, -0.00926222f, 0.1296f, + -0.00257775f, -0.00830578f, 0.1296f, -0.0048782f, -0.006816f, + 0.1296f, -0.00681598f, -0.00487823f, 0.1296f, -0.00830575f, + -0.00257779f, 0.1296f, -0.0092622f, 0f, 0.1296f, -0.00959998f, + 0.00360375f, 0.1501f, -0.0129094f, 0.0068127f, 0.1501f, + -0.0115817f, 0.00951073f, 0.1501f, -0.00951071f, 0.0115817f, + 0.1501f, -0.0068127f, 0.0129094f, 0.1501f, -0.00360375f, + 0.0133778f, 0.1501f, 2.684e-008f, 0.004693f, 0.1472f, -0.0168122f, + 0.00887203f, 0.1472f, -0.0150829f, 0.0123858f, 0.1472f, + -0.0123858f, 0.0150829f, 0.1472f, -0.00887203f, 0.0168122f, + 0.1472f, -0.004693f, 0.0174222f, 0.1472f, 2.63214e-008f, + 0.00420139f, 0.1431f, -0.0150536f, 0.0079431f, 0.1431f, + -0.0135049f, 0.0110895f, 0.1431f, -0.0110895f, 0.0135049f, 0.1431f, + -0.00794311f, 0.0150536f, 0.1431f, -0.00420139f, 0.00306255f, + 0.1384f, -0.0109789f, 0.00579107f, 0.1384f, -0.0098486f, + 0.00808622f, 0.1384f, -0.0080862f, 0.00984861f, 0.1384f, + -0.00579106f, 0.0109789f, 0.1384f, -0.00306254f, 0.0113778f, + 0.1384f, 2.47478e-008f, 0.00221013f, 0.1337f, -0.00793336f, + 0.00418106f, 0.1337f, -0.00711521f, 0.00584028f, 0.1337f, + -0.00584025f, 0.00711522f, 0.1337f, -0.00418105f, 0.00793338f, + 0.1337f, -0.00221012f, 0.00822222f, 0.1337f, 2.39074e-008f, + 0.00257778f, 0.1296f, -0.0092622f, 0.00487822f, 0.1296f, + -0.00830576f, 0.006816f, 0.1296f, -0.00681598f, 0.00830577f, + 0.1296f, -0.00487821f, 0.00926222f, 0.1296f, -0.00257777f, + 0.0168444f, 0.126533f, 2.26259e-008f, 0.0162518f, 0.126533f, + 0.00452306f, 0.0145736f, 0.126533f, 0.00855948f, 0.0119595f, + 0.126533f, 0.0119596f, 0.00855948f, 0.126533f, 0.0145736f, + 0.00452306f, 0.126533f, 0.0162518f, 0f, 0.126533f, 0.0168444f, + 0.0275555f, 0.124267f, 2.22206e-008f, 0.026586f, 0.124267f, + 0.00739918f, 0.0238406f, 0.124267f, 0.0140023f, 0.0195644f, + 0.124267f, 0.0195644f, 0.0140023f, 0.124267f, 0.0238406f, + 0.0073992f, 0.124267f, 0.026586f, 0f, 0.124267f, 0.0275555f, + 0.0396f, 0.1224f, 2.18868e-008f, 0.0382067f, 0.1224f, 0.0106333f, + 0.0342613f, 0.1224f, 0.0201227f, 0.028116f, 0.1224f, 0.028116f, + 0.0201227f, 0.1224f, 0.0342613f, 0.0106334f, 0.1224f, 0.0382067f, + 0f, 0.1224f, 0.0396f, 0.0508444f, 0.120533f, 2.1553e-008f, + 0.0490554f, 0.120533f, 0.0136527f, 0.0439898f, 0.120533f, + 0.0258365f, 0.0360995f, 0.120533f, 0.0360995f, 0.0258365f, + 0.120533f, 0.0439898f, 0.0136527f, 0.120533f, 0.0490554f, 0f, + 0.120533f, 0.0508444f, 0.0591555f, 0.118267f, 2.11477e-008f, + 0.0570741f, 0.118267f, 0.0158844f, 0.0511805f, 0.118267f, + 0.0300598f, 0.0420004f, 0.118267f, 0.0420004f, 0.0300598f, + 0.118267f, 0.0511805f, 0.0158844f, 0.118267f, 0.0570741f, 0f, + 0.118267f, 0.0591555f, 0.0624f, 0.1152f, 2.05994e-008f, 0.0602044f, + 0.1152f, 0.0167556f, 0.0539876f, 0.1152f, 0.0317084f, 0.044304f, + 0.1152f, 0.044304f, 0.0317085f, 0.1152f, 0.0539875f, 0.0167556f, + 0.1152f, 0.0602044f, 0f, 0.1152f, 0.0624f, -0.00452304f, 0.126533f, + 0.0162518f, -0.00855946f, 0.126533f, 0.0145736f, -0.0119595f, + 0.126533f, 0.0119596f, -0.0145735f, 0.126533f, 0.0085595f, + -0.0162518f, 0.126533f, 0.00452308f, -0.0168444f, 0.126533f, + 2.26259e-008f, -0.00739916f, 0.124267f, 0.026586f, -0.0140023f, + 0.124267f, 0.0238407f, -0.0195644f, 0.124267f, 0.0195644f, + -0.0238406f, 0.124267f, 0.0140023f, -0.026586f, 0.124267f, + 0.00739922f, -0.0275555f, 0.124267f, 2.22206e-008f, -0.0106333f, + 0.1224f, 0.0382067f, -0.0201227f, 0.1224f, 0.0342613f, -0.028116f, + 0.1224f, 0.028116f, -0.0342613f, 0.1224f, 0.0201227f, -0.0382067f, + 0.1224f, 0.0106334f, -0.0396f, 0.1224f, 2.18868e-008f, -0.0136527f, + 0.120533f, 0.0490554f, -0.0258365f, 0.120533f, 0.0439898f, + -0.0360995f, 0.120533f, 0.0360995f, -0.0439898f, 0.120533f, + 0.0258365f, -0.0490554f, 0.120533f, 0.0136527f, -0.0508444f, + 0.120533f, 2.1553e-008f, -0.0158843f, 0.118267f, 0.0570741f, + -0.0300597f, 0.118267f, 0.0511805f, -0.0420004f, 0.118267f, + 0.0420004f, -0.0511805f, 0.118267f, 0.0300598f, -0.0570741f, + 0.118267f, 0.0158844f, -0.0591555f, 0.118267f, 2.11477e-008f, + -0.0167555f, 0.1152f, 0.0602044f, -0.0317084f, 0.1152f, 0.0539876f, + -0.044304f, 0.1152f, 0.044304f, -0.0539875f, 0.1152f, 0.0317085f, + -0.0602044f, 0.1152f, 0.0167556f, -0.0624f, 0.1152f, 2.05994e-008f, + -0.0162518f, 0.126533f, -0.00452302f, -0.0145736f, 0.126533f, + -0.00855945f, -0.0119595f, 0.126533f, -0.0119595f, -0.00855948f, + 0.126533f, -0.0145735f, -0.00452306f, 0.126533f, -0.0162517f, 0f, + 0.126533f, -0.0168444f, -0.026586f, 0.124267f, -0.00739915f, + -0.0238406f, 0.124267f, -0.0140023f, -0.0195644f, 0.124267f, + -0.0195644f, -0.0140023f, 0.124267f, -0.0238406f, -0.0073992f, + 0.124267f, -0.026586f, 0f, 0.124267f, -0.0275555f, -0.0382067f, + 0.1224f, -0.0106333f, -0.0342613f, 0.1224f, -0.0201226f, + -0.028116f, 0.1224f, -0.028116f, -0.0201227f, 0.1224f, -0.0342613f, + -0.0106334f, 0.1224f, -0.0382066f, 0f, 0.1224f, -0.0396f, + -0.0490554f, 0.120533f, -0.0136526f, -0.0439898f, 0.120533f, + -0.0258365f, -0.0360995f, 0.120533f, -0.0360995f, -0.0258365f, + 0.120533f, -0.0439898f, -0.0136527f, 0.120533f, -0.0490554f, 0f, + 0.120533f, -0.0508444f, -0.0570741f, 0.118267f, -0.0158843f, + -0.0511805f, 0.118267f, -0.0300597f, -0.0420004f, 0.118267f, + -0.0420004f, -0.0300598f, 0.118267f, -0.0511805f, -0.0158844f, + 0.118267f, -0.0570741f, 0f, 0.118267f, -0.0591555f, -0.0602044f, + 0.1152f, -0.0167555f, -0.0539876f, 0.1152f, -0.0317084f, + -0.044304f, 0.1152f, -0.044304f, -0.0317085f, 0.1152f, -0.0539875f, + -0.0167556f, 0.1152f, -0.0602044f, 0f, 0.1152f, -0.0624f, + 0.00452304f, 0.126533f, -0.0162517f, 0.00855946f, 0.126533f, + -0.0145735f, 0.0119595f, 0.126533f, -0.0119595f, 0.0145735f, + 0.126533f, -0.00855947f, 0.0162518f, 0.126533f, -0.00452304f, + 0.00739916f, 0.124267f, -0.026586f, 0.0140023f, 0.124267f, + -0.0238406f, 0.0195644f, 0.124267f, -0.0195644f, 0.0238406f, + 0.124267f, -0.0140023f, 0.026586f, 0.124267f, -0.00739919f, + 0.0106333f, 0.1224f, -0.0382067f, 0.0201227f, 0.1224f, -0.0342613f, + 0.028116f, 0.1224f, -0.028116f, 0.0342613f, 0.1224f, -0.0201227f, + 0.0382067f, 0.1224f, -0.0106334f, 0.0136527f, 0.120533f, + -0.0490554f, 0.0258365f, 0.120533f, -0.0439898f, 0.0360995f, + 0.120533f, -0.0360995f, 0.0439898f, 0.120533f, -0.0258365f, + 0.0490554f, 0.120533f, -0.0136527f, 0.0158843f, 0.118267f, + -0.0570741f, 0.0300597f, 0.118267f, -0.0511805f, 0.0420004f, + 0.118267f, -0.0420004f, 0.0511805f, 0.118267f, -0.0300598f, + 0.0570741f, 0.118267f, -0.0158844f, 0.0167555f, 0.1152f, + -0.0602044f, 0.0317084f, 0.1152f, -0.0539876f, 0.044304f, 0.1152f, + -0.044304f, 0.0539875f, 0.1152f, -0.0317085f, 0.0602044f, 0.1152f, + -0.0167556f, 0.0290833f, 0.000283333f, 5.06639e-011f, 0f, 0f, 0f, + 0.02806f, 0.000283335f, -0.00780941f, 0.0251625f, 0.000283336f, + -0.0147786f, 0.0206492f, 0.000283337f, -0.0206492f, 0.0147787f, + 0.000283338f, -0.0251625f, 0.00780945f, 0.000283338f, -0.02806f, + 0f, 0.000283338f, -0.0290833f, 0.0490667f, 0.00106667f, + 1.90735e-010f, 0.0473403f, 0.00106667f, -0.0131753f, 0.0424518f, + 0.00106667f, -0.0249331f, 0.0348373f, 0.00106667f, -0.0348373f, + 0.0249332f, 0.00106667f, -0.0424517f, 0.0131754f, 0.00106667f, + -0.0473402f, 0f, 0.00106667f, -0.0490667f, 0.06165f, 0.00225f, + 4.02331e-010f, 0.0594808f, 0.00225f, -0.0165542f, 0.0533387f, + 0.00225001f, -0.0313273f, 0.0437715f, 0.00225001f, -0.0437715f, + 0.0313274f, 0.00225001f, -0.0533386f, 0.0165542f, 0.00225001f, + -0.0594808f, 0f, 0.00225001f, -0.06165f, 0.0685333f, 0.00373333f, + 6.67572e-010f, 0.066122f, 0.00373334f, -0.0184025f, 0.059294f, + 0.00373334f, -0.0348251f, 0.0486587f, 0.00373334f, -0.0486587f, + 0.0348251f, 0.00373334f, -0.059294f, 0.0184026f, 0.00373334f, + -0.066122f, 0f, 0.00373334f, -0.0685333f, 0.0714167f, 0.00541667f, + 9.68575e-010f, 0.0689039f, 0.00541667f, -0.0191767f, 0.0617887f, + 0.00541667f, -0.0362902f, 0.0507058f, 0.00541668f, -0.0507058f, + 0.0362903f, 0.00541668f, -0.0617886f, 0.0191768f, 0.00541668f, + -0.0689038f, 0f, 0.00541668f, -0.0714167f, 0.0694667f, 0.0072f, + -0.0193333f, 0.0622933f, 0.00720001f, -0.0365866f, 0.0365867f, + 0.00720001f, -0.0622933f, 0.0193334f, 0.00720001f, -0.0694666f, 0f, + 0.000283338f, -0.0290833f, -0.0078094f, 0.000283338f, -0.02806f, + -0.0147786f, 0.000283338f, -0.0251625f, -0.0206492f, 0.000283337f, + -0.0206492f, -0.0251624f, 0.000283336f, -0.0147787f, -0.02806f, + 0.000283335f, -0.00780945f, -0.0290833f, 0.000283333f, + 5.06639e-011f, 0f, 0.00106667f, -0.0490667f, -0.0131753f, + 0.00106667f, -0.0473402f, -0.0249331f, 0.00106667f, -0.0424518f, + -0.0348373f, 0.00106667f, -0.0348373f, -0.0424517f, 0.00106667f, + -0.0249332f, -0.0473402f, 0.00106667f, -0.0131754f, -0.0490667f, + 0.00106667f, 1.90735e-010f, -0.0165542f, 0.00225001f, -0.0594808f, + -0.0313273f, 0.00225001f, -0.0533387f, -0.0437715f, 0.00225001f, + -0.0437715f, -0.0533386f, 0.00225001f, -0.0313274f, -0.0594808f, + 0.00225f, -0.0165542f, -0.06165f, 0.00225f, 4.02331e-010f, 0f, + 0.00373334f, -0.0685333f, -0.0184024f, 0.00373334f, -0.066122f, + -0.0348251f, 0.00373334f, -0.059294f, -0.0486587f, 0.00373334f, + -0.0486587f, -0.059294f, 0.00373334f, -0.0348251f, -0.0661219f, + 0.00373334f, -0.0184026f, -0.0685333f, 0.00373333f, 6.67572e-010f, + 0f, 0.00541667f, -0.0714167f, -0.0191767f, 0.00541668f, + -0.0689039f, -0.0362902f, 0.00541667f, -0.0617887f, -0.0507058f, + 0.00541667f, -0.0507058f, -0.0617886f, 0.00541667f, -0.0362903f, + -0.0689038f, 0.00541667f, -0.0191768f, -0.0714167f, 0.00541666f, + 9.68575e-010f, -0.0193333f, 0.00720001f, -0.0694667f, -0.0365866f, + 0.00720001f, -0.0622933f, -0.0622933f, 0.00720001f, -0.0365867f, + -0.0694666f, 0.0072f, -0.0193334f, -0.0290833f, 0.000283334f, + 5.0664e-011f, -0.02806f, 0.000283332f, 0.00780941f, -0.0251625f, + 0.000283331f, 0.0147786f, -0.0206492f, 0.00028333f, 0.0206492f, + -0.0147787f, 0.000283329f, 0.0251625f, -0.00780945f, 0.000283329f, + 0.02806f, 0f, 0.000283329f, 0.0290833f, -0.0490667f, 0.00106667f, + 1.90735e-010f, -0.0473403f, 0.00106667f, 0.0131753f, -0.0424518f, + 0.00106666f, 0.0249331f, -0.0348374f, 0.00106666f, 0.0348374f, + -0.0249332f, 0.00106666f, 0.0424517f, -0.0131754f, 0.00106666f, + 0.0473402f, 0f, 0.00106666f, 0.0490667f, -0.0594808f, 0.00225f, + 0.0165542f, -0.0533387f, 0.00224999f, 0.0313273f, -0.0437715f, + 0.00224999f, 0.0437715f, -0.0313274f, 0.00224999f, 0.0533386f, + -0.0165542f, 0.00224999f, 0.0594808f, 0f, 0.00224999f, 0.06165f, + -0.0685333f, 0.00373334f, 6.67572e-010f, -0.066122f, 0.00373333f, + 0.0184025f, -0.059294f, 0.00373333f, 0.0348251f, -0.0486587f, + 0.00373333f, 0.0486587f, -0.0348251f, 0.00373333f, 0.059294f, + -0.0184026f, 0.00373333f, 0.066122f, 0f, 0.00373333f, 0.0685333f, + -0.0714167f, 0.00541667f, 9.68576e-010f, -0.0689039f, 0.00541667f, + 0.0191767f, -0.0617887f, 0.00541666f, 0.0362902f, -0.0507058f, + 0.00541666f, 0.0507058f, -0.0362903f, 0.00541666f, 0.0617886f, + -0.0191768f, 0.00541666f, 0.0689038f, 0f, 0.00541666f, 0.0714167f, + -0.0694667f, 0.0072f, 0.0193333f, -0.0622933f, 0.00719999f, + 0.0365866f, -0.05112f, 0.00719999f, 0.05112f, -0.0365867f, + 0.00719999f, 0.0622933f, -0.0193334f, 0.00719999f, 0.0694666f, + 0.00780941f, 0.000283329f, 0.02806f, 0.0147786f, 0.000283329f, + 0.0251625f, 0.0206492f, 0.00028333f, 0.0206492f, 0.0251625f, + 0.000283331f, 0.0147787f, 0.02806f, 0.000283332f, 0.00780945f, + 0.0290833f, 0.000283334f, 5.0664e-011f, 0.0131753f, 0.00106666f, + 0.0473403f, 0.0249331f, 0.00106666f, 0.0424518f, 0.0348374f, + 0.00106666f, 0.0348374f, 0.0424517f, 0.00106666f, 0.0249332f, + 0.0473402f, 0.00106666f, 0.0131754f, 0.0490667f, 0.00106667f, + 1.90735e-010f, 0.0165542f, 0.00224999f, 0.0594808f, 0.0313273f, + 0.00224999f, 0.0533387f, 0.0437715f, 0.00224999f, 0.0437715f, + 0.0533386f, 0.00224999f, 0.0313274f, 0.0594808f, 0.00225f, + 0.0165542f, 0.0184025f, 0.00373333f, 0.066122f, 0.0348251f, + 0.00373333f, 0.059294f, 0.0486587f, 0.00373333f, 0.0486587f, + 0.059294f, 0.00373333f, 0.0348251f, 0.066122f, 0.00373333f, + 0.0184026f, 0.0685333f, 0.00373334f, 6.67572e-010f, 0.0191767f, + 0.00541666f, 0.0689039f, 0.0362902f, 0.00541666f, 0.0617887f, + 0.0507058f, 0.00541666f, 0.0507058f, 0.0617886f, 0.00541666f, + 0.0362903f, 0.0689038f, 0.00541667f, 0.0191768f, 0.0714167f, + 0.00541667f, 9.68576e-010f, 0.0193333f, 0.00719999f, 0.0694667f, + 0.0365866f, 0.00719999f, 0.0622933f, 0.05112f, 0.00719999f, + 0.05112f, 0.0622933f, 0.00719999f, 0.0365867f, 0.0694666f, 0.0072f, + 0.0193334f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, + 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, + 0f, 0f, 0f, 0f, 0f, -0.06165f, 0.00225f, 4.02331e-010f, 0f, 0f, 0f, + 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, + 0f, 0.06165f, 0.00225f, 4.02331e-010f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, + 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0.006816f, 0.1296f, + 0.00681602f, 0.00487823f, 0.1296f, 0.00830579f, 0.00257779f, + 0.1296f, 0.00926224f, 0f, 0.1296f, 0.00960002f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0.00830577f, 0.1296f, -0.00487821f, 0.00487822f, + 0.1296f, -0.00830576f, 0.00257778f, 0.1296f, -0.0092622f, 0f, + 0.1296f, -0.00959998f, -0.00257779f, 0.1296f, -0.0092622f, + -0.00487823f, 0.1296f, -0.00830575f, -0.00830578f, 0.1296f, + -0.0048782f, -0.00257778f, 0.1296f, 0.00926224f, -0.00487822f, + 0.1296f, 0.0083058f, -0.006816f, 0.1296f, 0.00681602f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0f, 0.1512f, 2.70367e-008f, 0f, 0.1512f, + 2.70367e-008f, 0.156267f, 0.1152f, -0.00499999f, 0.131733f, + 0.1152f, -0.00499998f, 0.1296f, 0.1152f, 2.05994e-008f, 0.137067f, + 0.1152f, 0.00800001f, -0.094f, 0.1079f, 1.9294e-008f, -0.096f, + 0.0432f, 7.72476e-009f, -0.0897778f, 0.0250667f, 4.48227e-009f, + 0.0897778f, 0.0250667f, 4.48227e-009f, -0.084f, 0.01845f, + 3.29912e-009f, 0.084f, 0.01845f, 3.29912e-009f, -0.0782222f, + 0.0133334f, 2.38419e-009f, 0.0782222f, 0.0133334f, 2.38419e-009f, + -0.0737778f, 0.00961668f, 1.7196e-009f, 0.0737778f, 0.00961668f, + 1.7196e-009f, 0.0926222f, 0.0432f, 0.0257778f, 0.072f, 0.1152f, + 2.05994e-008f, 0.05112f, 0.1152f, -0.05112f, 0f, 0.1152f, -0.072f, + -0.05112f, 0.1152f, -0.05112f, -0.072f, 0.1152f, 2.05994e-008f, 0f, + 0.1152f, 0.072f, -0.05112f, 0.1152f, 0.05112f, -0.0687556f, + 0.1194f, 2.13504e-008f, 0.05112f, 0.1152f, 0.05112f, 0f, 0.117825f, + 0.0663056f, -0.0396f, 0.1224f, 2.18868e-008f, 0.0396f, 0.1224f, + 2.18868e-008f }; + static float teapot_normals[] = { -0.987635f, -0.156768f, 0f, -0.902861f, + -0.429933f, 0f, -0.953562f, -0.156989f, -0.257047f, -0.871509f, + -0.430441f, -0.234929f, -0.854265f, -0.157281f, -0.495474f, + -0.780517f, -0.431109f, -0.4527f, -0.698293f, -0.157393f, + -0.698294f, -0.637936f, -0.431366f, -0.637936f, -0.495474f, + -0.157281f, -0.854265f, -0.4527f, -0.431109f, -0.780517f, + -0.257047f, -0.156989f, -0.953562f, -0.234929f, -0.430441f, + -0.871509f, 0f, -0.156767f, -0.987636f, 0f, -0.429933f, -0.902861f, + -0.880022f, 0.474932f, 0f, -0.849414f, 0.475466f, -0.228973f, + -0.76067f, 0.476166f, -0.441189f, -0.621695f, 0.476435f, + -0.621695f, -0.441189f, 0.476166f, -0.76067f, -0.228972f, + 0.475466f, -0.849414f, 0f, 0.474932f, -0.880022f, 0f, 1f, 0f, + -3.12489e-007f, 1f, -4.53013e-008f, -4.74898e-007f, 1f, + -2.15741e-007f, 0f, 1f, 0f, -1.19502e-007f, 1f, -2.57504e-007f, + -5.01339e-008f, 1f, -1.37835e-007f, 0f, 1f, 0f, 0.556738f, + 0.830688f, 0f, 0.537013f, 0.831061f, 0.14476f, 0.480481f, 0.83155f, + 0.278679f, 0.392564f, 0.831738f, 0.392564f, 0.278679f, 0.83155f, + 0.480481f, 0.14476f, 0.831061f, 0.537012f, 0f, 0.830688f, + 0.556738f, 0.783289f, 0.621658f, 0f, 0.755869f, 0.622211f, + 0.203756f, 0.67669f, 0.622937f, 0.39248f, 0.552994f, 0.623214f, + 0.552994f, 0.39248f, 0.622936f, 0.676691f, 0.203756f, 0.62221f, + 0.755869f, 0f, 0.621658f, 0.783289f, 0.90286f, 0.429934f, 0f, + 0.871509f, 0.430442f, 0.234929f, 0.780517f, 0.431109f, 0.4527f, + 0.637935f, 0.431366f, 0.637936f, 0.4527f, 0.431109f, 0.780517f, + 0.234929f, 0.430441f, 0.87151f, 0f, 0.429934f, 0.90286f, 0.257047f, + -0.156989f, -0.953562f, 0.234929f, -0.430441f, -0.871509f, + 0.495474f, -0.157281f, -0.854265f, 0.4527f, -0.431109f, -0.780517f, + 0.698293f, -0.157393f, -0.698294f, 0.637936f, -0.431366f, + -0.637936f, 0.854265f, -0.157281f, -0.495474f, 0.780517f, + -0.431109f, -0.4527f, 0.953562f, -0.156989f, -0.257047f, 0.871509f, + -0.430441f, -0.234929f, 0.987636f, -0.156767f, 0f, 0.902861f, + -0.429933f, 0f, 0.228973f, 0.475465f, -0.849414f, 0.441188f, + 0.476167f, -0.760669f, 0.621695f, 0.476434f, -0.621696f, 0.76067f, + 0.476167f, -0.441188f, 0.849414f, 0.475466f, -0.228972f, 0.880022f, + 0.474932f, 0f, 4.53013e-008f, 1f, -3.12489e-007f, 2.15741e-007f, + 1f, -4.74898e-007f, 0f, 1f, 0f, 2.57504e-007f, 1f, -1.19502e-007f, + 1.37835e-007f, 1f, -5.01339e-008f, 0f, 1f, 0f, 0f, 0.830689f, + 0.556737f, -0.14476f, 0.831061f, 0.537012f, -0.278679f, 0.83155f, + 0.480481f, -0.392563f, 0.831738f, 0.392563f, -0.480482f, 0.83155f, + 0.27868f, -0.537012f, 0.831061f, 0.14476f, -0.556738f, 0.830688f, + 0f, 0f, 0.621658f, 0.783289f, -0.203756f, 0.62221f, 0.755869f, + -0.39248f, 0.622937f, 0.67669f, -0.552993f, 0.623215f, 0.552993f, + -0.67669f, 0.622937f, 0.39248f, -0.755869f, 0.62221f, 0.203756f, + -0.783289f, 0.621658f, 0f, -0.234929f, 0.430442f, 0.871509f, + -0.4527f, 0.431109f, 0.780517f, -0.637935f, 0.431366f, 0.637936f, + -0.780517f, 0.431109f, 0.4527f, -0.87151f, 0.430441f, 0.234929f, + -0.90286f, 0.429934f, 0f, 0.987636f, -0.156767f, 0f, 0.953562f, + -0.156989f, 0.257047f, 0.871509f, -0.430441f, 0.234929f, 0.854265f, + -0.15728f, 0.495474f, 0.780517f, -0.431109f, 0.4527f, 0.698294f, + -0.157393f, 0.698293f, 0.637936f, -0.431366f, 0.637936f, 0.495474f, + -0.157281f, 0.854265f, 0.4527f, -0.431109f, 0.780517f, 0.257047f, + -0.156989f, 0.953562f, 0.234929f, -0.430441f, 0.871509f, 0f, + -0.156767f, 0.987636f, 0f, -0.429933f, 0.902861f, 0.880022f, + 0.474934f, 0f, 0.849413f, 0.475467f, 0.228972f, 0.760669f, + 0.476167f, 0.441188f, 0.621695f, 0.476436f, 0.621695f, 0.441188f, + 0.476167f, 0.760669f, 0.228972f, 0.475466f, 0.849414f, 0f, + 0.474934f, 0.880022f, 3.12489e-007f, 1f, 4.53013e-008f, + 4.74898e-007f, 1f, 2.15741e-007f, 0f, 1f, 0f, 1.19502e-007f, 1f, + 2.57504e-007f, 5.01339e-008f, 1f, 1.37835e-007f, 0f, 1f, 0f, + -0.537013f, 0.831061f, -0.14476f, -0.480482f, 0.83155f, -0.27868f, + -0.392566f, 0.831735f, -0.392566f, -0.27868f, 0.83155f, -0.480482f, + -0.14476f, 0.831061f, -0.537012f, 0f, 0.830688f, -0.556738f, + -0.783289f, 0.621657f, 0f, -0.755869f, 0.62221f, -0.203756f, + -0.676691f, 0.622936f, -0.39248f, -0.552994f, 0.623215f, + -0.552993f, -0.392481f, 0.622936f, -0.676691f, -0.203756f, + 0.622209f, -0.75587f, 0f, 0.621657f, -0.783289f, -0.871509f, + 0.430442f, -0.234929f, -0.780517f, 0.431109f, -0.4527f, -0.637936f, + 0.431366f, -0.637935f, -0.4527f, 0.431109f, -0.780517f, -0.234929f, + 0.430441f, -0.87151f, 0f, 0.429934f, -0.90286f, -0.257047f, + -0.156989f, 0.953562f, -0.234929f, -0.430441f, 0.871509f, + -0.495474f, -0.15728f, 0.854265f, -0.4527f, -0.431109f, 0.780517f, + -0.698294f, -0.157393f, 0.698293f, -0.637936f, -0.431366f, + 0.637936f, -0.854265f, -0.157281f, 0.495474f, -0.780517f, + -0.431109f, 0.4527f, -0.953562f, -0.156989f, 0.257047f, -0.871509f, + -0.430442f, 0.234928f, -0.987636f, -0.156767f, 0f, -0.228972f, + 0.475467f, 0.849413f, -0.441188f, 0.476167f, 0.760669f, -0.621695f, + 0.476436f, 0.621695f, -0.76067f, 0.476167f, 0.441188f, -0.849414f, + 0.475466f, 0.228972f, -0.880022f, 0.474934f, 0f, -4.53013e-008f, + 1f, 3.12489e-007f, -2.15741e-007f, 1f, 4.74898e-007f, 0f, 1f, 0f, + -2.57504e-007f, 1f, 1.19502e-007f, -1.37835e-007f, 1f, + 5.01339e-008f, 0.14476f, 0.831061f, -0.537013f, 0.27868f, 0.83155f, + -0.480482f, 0.392566f, 0.831735f, -0.392566f, 0.480482f, 0.83155f, + -0.27868f, 0.537012f, 0.831061f, -0.14476f, 0.556738f, 0.830688f, + 0f, 0.203756f, 0.62221f, -0.755869f, 0.392481f, 0.622936f, + -0.67669f, 0.552994f, 0.623215f, -0.552993f, 0.676691f, 0.622936f, + -0.39248f, 0.75587f, 0.622209f, -0.203756f, 0.783289f, 0.621657f, + 0f, 0.234929f, 0.430442f, -0.871509f, 0.4527f, 0.431109f, + -0.780517f, 0.637936f, 0.431366f, -0.637935f, 0.780517f, 0.431109f, + -0.4527f, 0.87151f, 0.430441f, -0.234928f, 0.906828f, 0.421501f, + 0f, 0.875348f, 0.422003f, 0.235963f, 0.871509f, 0.430442f, + 0.234929f, 0.783966f, 0.422664f, 0.4547f, 0.780517f, 0.43111f, + 0.4527f, 0.640758f, 0.422917f, 0.640758f, 0.4547f, 0.422664f, + 0.783966f, 0.4527f, 0.43111f, 0.780517f, 0.235964f, 0.422003f, + 0.875348f, 0.234929f, 0.430442f, 0.871509f, 0f, 0.421501f, + 0.906828f, 0.918633f, 0.395111f, 0f, 0.886771f, 0.395595f, + 0.239043f, 0.794229f, 0.39623f, 0.460653f, 0.649156f, 0.396474f, + 0.649157f, 0.460653f, 0.39623f, 0.794229f, 0.239043f, 0.395595f, + 0.886771f, 0f, 0.395111f, 0.918633f, 0.937749f, 0.347314f, 0f, + 0.905271f, 0.347757f, 0.244029f, 0.810853f, 0.34834f, 0.470295f, + 0.662761f, 0.348563f, 0.662761f, 0.470295f, 0.34834f, 0.810853f, + 0.24403f, 0.347757f, 0.90527f, 0f, 0.347314f, 0.937749f, 0.96234f, + 0.271848f, 0f, 0.929073f, 0.272213f, 0.250446f, 0.832247f, + 0.272693f, 0.482704f, 0.680271f, 0.272877f, 0.680271f, 0.482704f, + 0.272693f, 0.832247f, 0.250446f, 0.272213f, 0.929073f, 0f, + 0.271848f, 0.96234f, 0.987204f, 0.15946f, 0f, 0.953145f, 0.159686f, + 0.256935f, 0.85389f, 0.159982f, 0.495256f, 0.697986f, 0.160096f, + 0.697986f, 0.495256f, 0.159982f, 0.853889f, 0.256935f, 0.159686f, + 0.953145f, 0f, 0.15946f, 0.987204f, 1f, 0f, 0f, 0.965535f, + -2.69333e-008f, 0.260275f, 0.865031f, -2.6582e-008f, 0.501718f, + 0.707107f, -1.58051e-008f, 0.707107f, 0.501718f, -5.72888e-009f, + 0.865031f, 0.260275f, -7.99313e-010f, 0.965535f, 0f, 0f, 1f, 0f, + 0.421501f, 0.906828f, -0.235963f, 0.422003f, 0.875348f, -0.234928f, + 0.430442f, 0.871509f, -0.4547f, 0.422664f, 0.783966f, -0.4527f, + 0.43111f, 0.780517f, -0.640758f, 0.422917f, 0.640758f, -0.783966f, + 0.422664f, 0.454701f, -0.780517f, 0.43111f, 0.4527f, -0.875348f, + 0.422003f, 0.235964f, -0.871509f, 0.430442f, 0.234929f, -0.906828f, + 0.421501f, 0f, 0f, 0.395111f, 0.918633f, -0.239043f, 0.395595f, + 0.886771f, -0.460653f, 0.39623f, 0.794229f, -0.649157f, 0.396474f, + 0.649157f, -0.794229f, 0.39623f, 0.460653f, -0.886771f, 0.395595f, + 0.239043f, -0.918633f, 0.395111f, 0f, -0.244029f, 0.347757f, + 0.905271f, -0.470295f, 0.34834f, 0.810853f, -0.662761f, 0.348563f, + 0.662761f, -0.810853f, 0.34834f, 0.470295f, -0.90527f, 0.347757f, + 0.24403f, -0.937749f, 0.347314f, 0f, 0f, 0.271848f, 0.96234f, + -0.250446f, 0.272213f, 0.929073f, -0.482703f, 0.272693f, 0.832248f, + -0.680271f, 0.272877f, 0.680271f, -0.832247f, 0.272693f, 0.482704f, + -0.929073f, 0.272213f, 0.250446f, -0.96234f, 0.271848f, 0f, 0f, + 0.159461f, 0.987204f, -0.256935f, 0.159686f, 0.953145f, -0.495256f, + 0.159983f, 0.853889f, -0.697986f, 0.160096f, 0.697986f, -0.853889f, + 0.159982f, 0.495256f, -0.953145f, 0.159686f, 0.256935f, -0.987204f, + 0.159461f, 0f, -0.260274f, -7.9931e-010f, 0.965535f, -0.501718f, + -5.72887e-009f, 0.865031f, -0.707107f, -1.58051e-008f, 0.707107f, + -0.865031f, -2.6582e-008f, 0.501718f, -0.965535f, -2.69333e-008f, + 0.260275f, 0.410365f, 0.911921f, 0f, -0.906828f, 0.421501f, 0f, + -0.875348f, 0.422003f, -0.235963f, -0.871509f, 0.430442f, + -0.234928f, -0.783966f, 0.422664f, -0.4547f, -0.780517f, 0.43111f, + -0.4527f, -0.640758f, 0.422917f, -0.640758f, -0.454701f, 0.422664f, + -0.783966f, -0.4527f, 0.43111f, -0.780517f, -0.235964f, 0.422003f, + -0.875348f, -0.234929f, 0.430442f, -0.871509f, 0f, 0.421501f, + -0.906828f, -0.918633f, 0.395111f, 0f, -0.886771f, 0.395595f, + -0.239043f, -0.794229f, 0.39623f, -0.460653f, -0.649157f, + 0.396474f, -0.649156f, -0.460653f, 0.39623f, -0.794229f, + -0.239043f, 0.395595f, -0.886771f, 0f, 0.395111f, -0.918633f, + -0.905271f, 0.347757f, -0.244029f, -0.810853f, 0.34834f, + -0.470295f, -0.662761f, 0.348563f, -0.662761f, -0.470295f, + 0.34834f, -0.810853f, -0.24403f, 0.347757f, -0.90527f, 0f, + 0.347314f, -0.937749f, -0.96234f, 0.271847f, 0f, -0.929073f, + 0.272213f, -0.250446f, -0.832248f, 0.272693f, -0.482703f, + -0.680271f, 0.272877f, -0.680271f, -0.482704f, 0.272693f, + -0.832247f, -0.250446f, 0.272213f, -0.929073f, 0f, 0.271847f, + -0.96234f, -0.987204f, 0.15946f, 0f, -0.953145f, 0.159685f, + -0.256935f, -0.85389f, 0.159982f, -0.495256f, -0.697986f, + 0.160096f, -0.697986f, -0.495256f, 0.159982f, -0.853889f, + -0.256935f, 0.159685f, -0.953145f, 0f, 0.15946f, -0.987204f, + -0.965535f, 2.69333e-008f, -0.260274f, -0.865031f, 2.6582e-008f, + -0.501718f, -0.707107f, 1.58051e-008f, -0.707107f, -0.501718f, + 5.72888e-009f, -0.865031f, -0.260275f, 7.99313e-010f, -0.965535f, + 0f, 0f, -1f, 0.235963f, 0.422003f, -0.875348f, 0.234928f, + 0.430442f, -0.871509f, 0.4547f, 0.422664f, -0.783966f, 0.4527f, + 0.43111f, -0.780517f, 0.640758f, 0.422917f, -0.640758f, 0.783966f, + 0.422664f, -0.4547f, 0.780517f, 0.43111f, -0.4527f, 0.875348f, + 0.422003f, -0.235964f, 0.871509f, 0.430442f, -0.234929f, 0.906828f, + 0.421501f, 0f, 0.239043f, 0.395595f, -0.886771f, 0.460653f, + 0.39623f, -0.794229f, 0.649157f, 0.396474f, -0.649156f, 0.794229f, + 0.39623f, -0.460653f, 0.886771f, 0.395595f, -0.239043f, 0.918633f, + 0.395111f, 0f, 0.244029f, 0.347757f, -0.905271f, 0.470295f, + 0.34834f, -0.810853f, 0.662761f, 0.348563f, -0.662761f, 0.810853f, + 0.34834f, -0.470295f, 0.90527f, 0.347757f, -0.24403f, 0.250446f, + 0.272213f, -0.929073f, 0.482704f, 0.272693f, -0.832247f, 0.680271f, + 0.272877f, -0.680271f, 0.832247f, 0.272693f, -0.482704f, 0.929073f, + 0.272213f, -0.250446f, 0.96234f, 0.271847f, 0f, 0.256935f, + 0.159685f, -0.953145f, 0.495256f, 0.159982f, -0.85389f, 0.697986f, + 0.160096f, -0.697986f, 0.853889f, 0.159982f, -0.495256f, 0.953145f, + 0.159685f, -0.256935f, 0.987204f, 0.15946f, 0f, 0.260274f, + 7.9931e-010f, -0.965535f, 0.501718f, 5.72887e-009f, -0.865031f, + 0.707107f, 1.58051e-008f, -0.707107f, 0.865031f, 2.6582e-008f, + -0.501718f, 0.965535f, 2.69333e-008f, -0.260275f, 0.938373f, + -0.345625f, -3.10672e-010f, 0.905874f, -0.346066f, 0.244192f, + 0.811396f, -0.346647f, 0.470609f, 0.663205f, -0.346869f, 0.663205f, + 0.47061f, -0.346647f, 0.811395f, 0.244192f, -0.346066f, 0.905874f, + 0f, -0.345625f, 0.938373f, 0.811257f, -0.584689f, -4.41262e-009f, + 0.782908f, -0.585247f, 0.211045f, 0.700957f, -0.58598f, 0.406555f, + 0.572843f, -0.586261f, 0.572843f, 0.406555f, -0.58598f, 0.700957f, + 0.211045f, -0.585247f, 0.782908f, 0f, -0.584689f, 0.811257f, + 0.6981f, -0.716f, -1.94916e-008f, 0.673539f, -0.716506f, 0.181563f, + 0.602839f, -0.717169f, 0.349647f, 0.492597f, -0.717423f, 0.492597f, + 0.349647f, -0.717169f, 0.602839f, 0.181563f, -0.716506f, 0.673539f, + 0f, -0.716f, 0.6981f, 0.636383f, -0.771373f, -5.3452e-008f, + 0.61392f, -0.771826f, 0.165491f, 0.549392f, -0.772419f, 0.318648f, + 0.448897f, -0.772647f, 0.448897f, 0.318648f, -0.772419f, 0.549392f, + 0.165492f, -0.771826f, 0.61392f, 0f, -0.771373f, 0.636383f, + 0.675056f, -0.737767f, -1.05865e-007f, 0.651275f, -0.738254f, + 0.175561f, 0.582878f, -0.738893f, 0.338069f, 0.476275f, -0.739138f, + 0.476275f, 0.338069f, -0.738893f, 0.582878f, 0.175561f, -0.738254f, + 0.651275f, 0f, -0.737767f, 0.675056f, 1f, 0f, 0f, 0.965535f, + -2.69332e-008f, 0.260274f, 0.865031f, -2.65819e-008f, 0.501718f, + 0.707107f, -1.5805e-008f, 0.707107f, 0.501718f, -5.72887e-009f, + 0.865031f, 0.260275f, -7.99311e-010f, 0.965535f, 0f, 0f, 1f, + -0.244192f, -0.346066f, 0.905874f, -0.470609f, -0.346647f, + 0.811396f, -0.663205f, -0.346869f, 0.663205f, -0.811395f, + -0.346647f, 0.47061f, -0.905874f, -0.346066f, 0.244193f, + -0.938373f, -0.345625f, -3.10672e-010f, -0.211045f, -0.585247f, + 0.782908f, -0.406555f, -0.58598f, 0.700957f, -0.572843f, + -0.586261f, 0.572843f, -0.700957f, -0.58598f, 0.406555f, + -0.782908f, -0.585247f, 0.211045f, -0.811257f, -0.584689f, + -4.41262e-009f, -0.181563f, -0.716506f, 0.673539f, -0.349647f, + -0.717169f, 0.602839f, -0.492597f, -0.717423f, 0.492597f, + -0.602839f, -0.717169f, 0.349647f, -0.673539f, -0.716506f, + 0.181563f, -0.6981f, -0.716f, -1.94916e-008f, -0.165491f, + -0.771826f, 0.61392f, -0.318648f, -0.772419f, 0.549393f, + -0.448897f, -0.772647f, 0.448897f, -0.549392f, -0.772419f, + 0.318648f, -0.61392f, -0.771826f, 0.165492f, -0.636383f, + -0.771373f, -5.3452e-008f, -0.175561f, -0.738254f, 0.651275f, + -0.338069f, -0.738893f, 0.582878f, -0.476275f, -0.739138f, + 0.476275f, -0.582878f, -0.738893f, 0.338069f, -0.651275f, + -0.738254f, 0.175561f, -0.675056f, -0.737767f, -1.05865e-007f, + -0.260274f, -7.99309e-010f, 0.965535f, -0.501718f, -5.72886e-009f, + 0.865031f, -0.707107f, -1.5805e-008f, 0.707107f, -0.865031f, + -2.65819e-008f, 0.501718f, -0.965535f, -2.69333e-008f, 0.260275f, + -1f, 0f, 0f, -0.905874f, -0.346066f, -0.244192f, -0.811396f, + -0.346647f, -0.470609f, -0.663205f, -0.346869f, -0.663205f, + -0.47061f, -0.346647f, -0.811395f, -0.244192f, -0.346066f, + -0.905874f, 0f, -0.345625f, -0.938373f, -0.782908f, -0.585247f, + -0.211045f, -0.700957f, -0.58598f, -0.406555f, -0.572843f, + -0.586261f, -0.572843f, -0.406555f, -0.58598f, -0.700957f, + -0.211045f, -0.585247f, -0.782908f, 0f, -0.584689f, -0.811257f, + -0.673539f, -0.716506f, -0.181563f, -0.602839f, -0.717169f, + -0.349647f, -0.492597f, -0.717423f, -0.492597f, -0.349647f, + -0.717169f, -0.602839f, -0.181563f, -0.716506f, -0.673539f, 0f, + -0.716f, -0.6981f, -0.61392f, -0.771826f, -0.165491f, -0.549392f, + -0.77242f, -0.318647f, -0.448897f, -0.772647f, -0.448897f, + -0.318648f, -0.77242f, -0.549392f, -0.165492f, -0.771826f, + -0.61392f, 0f, -0.771373f, -0.636383f, -0.651275f, -0.738254f, + -0.175561f, -0.582877f, -0.738894f, -0.338069f, -0.476274f, + -0.739138f, -0.476274f, -0.338069f, -0.738894f, -0.582877f, + -0.175561f, -0.738255f, -0.651275f, 0f, -0.737767f, -0.675055f, + -0.965535f, 2.69333e-008f, -0.260274f, -0.865031f, 2.6582e-008f, + -0.501718f, -0.707107f, 1.58051e-008f, -0.707107f, -0.501718f, + 5.7289e-009f, -0.865031f, -0.260275f, 7.99315e-010f, -0.965535f, + 0f, 0f, -1f, 0.244192f, -0.346066f, -0.905874f, 0.470609f, + -0.346647f, -0.811396f, 0.663205f, -0.346869f, -0.663205f, + 0.811395f, -0.346647f, -0.47061f, 0.905874f, -0.346066f, + -0.244192f, 0.211045f, -0.585247f, -0.782908f, 0.406555f, + -0.58598f, -0.700957f, 0.572843f, -0.586261f, -0.572843f, + 0.700957f, -0.58598f, -0.406555f, 0.782908f, -0.585247f, + -0.211045f, 0.181563f, -0.716506f, -0.673539f, 0.349647f, + -0.717169f, -0.602839f, 0.492597f, -0.717423f, -0.492597f, + 0.602839f, -0.717169f, -0.349647f, 0.673539f, -0.716506f, + -0.181563f, 0.165491f, -0.771826f, -0.61392f, 0.318647f, -0.77242f, + -0.549392f, 0.448897f, -0.772647f, -0.448897f, 0.549392f, + -0.77242f, -0.318648f, 0.61392f, -0.771826f, -0.165492f, 0.175561f, + -0.738255f, -0.651275f, 0.338069f, -0.738894f, -0.582877f, + 0.476274f, -0.739138f, -0.476274f, 0.582877f, -0.738894f, + -0.338069f, 0.651275f, -0.738254f, -0.175561f, 0.260274f, + 7.99314e-010f, -0.965535f, 0.501718f, 5.72889e-009f, -0.865031f, + 0.707107f, 1.58051e-008f, -0.707107f, 0.865031f, 2.6582e-008f, + -0.501718f, 0.965535f, 2.69333e-008f, -0.260275f, 0.0104645f, + -0.999945f, 0f, 0f, -1f, 0f, 0.0104255f, -0.954681f, 0.297447f, + 2.56825e-008f, -0.95448f, 0.298276f, 0.00846391f, -0.708083f, + 0.706078f, 1.14879e-007f, -0.707106f, 0.707108f, -2.9238e-009f, + -8.98486e-008f, 1f, 8.16344e-015f, -8.94074e-008f, 1f, + -0.00997561f, 0.707961f, 0.706181f, 5.80084e-008f, 0.707107f, + 0.707107f, -0.0140841f, 0.95459f, 0.297589f, 1.94189e-007f, + 0.95448f, 0.298275f, -0.0149982f, 0.999888f, 0f, 0f, 1f, 0f, + 0.0510697f, -0.998695f, 0f, 0.0510028f, -0.953615f, 0.296676f, + 0.0415993f, -0.706917f, 0.706072f, -2.78701e-009f, -9.11701e-008f, + 1f, -0.0493858f, 0.704244f, 0.708239f, -0.0701018f, 0.951466f, + 0.299663f, -0.07479f, 0.997199f, 0f, 0.14834f, -0.988936f, 0f, + 0.148104f, -0.941964f, 0.30128f, 0.119688f, -0.688399f, 0.715389f, + 7.13598e-009f, -8.17051e-008f, 1f, -0.141352f, 0.675015f, + 0.724137f, -0.204668f, 0.927128f, 0.313917f, -0.219512f, 0.97561f, + 0f, 0.364399f, -0.931243f, 0f, 0.359682f, -0.875088f, 0.323804f, + 0.275915f, -0.604128f, 0.747597f, 1.54202e-008f, -6.37972e-008f, + 1f, -0.313659f, 0.564289f, 0.763672f, -0.474611f, 0.807244f, + 0.350859f, -0.514496f, 0.857493f, 0f, 0.767382f, -0.64119f, 0f, + 0.727532f, -0.577566f, 0.37029f, 0.497151f, -0.35353f, 0.792374f, + 1.10972e-008f, -5.53164e-008f, 1f, -0.519904f, 0.300684f, + 0.799556f, -0.810111f, 0.441475f, 0.385771f, -0.882353f, 0.470588f, + 0f, 1f, 0f, 0f, 0.923077f, -3.76483e-008f, 0.384616f, 0.599999f, + -4.20741e-008f, 0.8f, 0f, -4.47037e-008f, 1f, -0.600001f, + -5.17421e-008f, 0.799999f, -0.923077f, -4.14964e-008f, 0.384614f, + -1f, 0f, 0f, -0.014084f, 0.95459f, -0.297589f, 5.67983e-008f, + 0.95448f, -0.298275f, -0.00997558f, 0.707961f, -0.706182f, + -4.84905e-008f, 0.707107f, -0.707107f, 5.84773e-010f, + 8.94956e-008f, -1f, -8.16344e-015f, 8.94074e-008f, -1f, 0.0084637f, + -0.708085f, -0.706076f, 3.66172e-008f, -0.707108f, -0.707106f, + 0.0104256f, -0.954682f, -0.297445f, 7.36826e-009f, -0.95448f, + -0.298274f, 0.0104646f, -0.999945f, 0f, -0.07479f, 0.997199f, 0f, + -0.0701018f, 0.951466f, -0.299663f, -0.0493858f, 0.704243f, + -0.708239f, -8.36107e-009f, 8.41192e-008f, -1f, 0.0415994f, + -0.706919f, -0.70607f, 0.0510028f, -0.953616f, -0.296674f, + 0.0510696f, -0.998695f, 0f, -0.204668f, 0.927128f, -0.313917f, + -0.141352f, 0.675015f, -0.724137f, -7.13598e-009f, 8.17051e-008f, + -1f, 0.119688f, -0.688401f, -0.715387f, 0.148104f, -0.941964f, + -0.301278f, -0.514495f, 0.857493f, 0f, -0.47461f, 0.807244f, + -0.350859f, -0.313658f, 0.564289f, -0.763673f, -9.25216e-009f, + 7.40412e-008f, -1f, 0.275916f, -0.60413f, -0.747595f, 0.359681f, + -0.875089f, -0.323802f, 0.364399f, -0.931243f, 0f, -0.882353f, + 0.470589f, 0f, -0.810111f, 0.441477f, -0.385771f, -0.519903f, + 0.300684f, -0.799556f, -1.01322e-008f, 5.82809e-008f, -1f, + 0.497153f, -0.353532f, -0.792373f, 0.727532f, -0.577567f, + -0.370288f, 0.767381f, -0.641191f, 0f, -0.923077f, 4.14963e-008f, + -0.384615f, -0.6f, 5.17421e-008f, -0.8f, 0f, 4.47037e-008f, -1f, + 0.600002f, 4.2074e-008f, -0.799999f, 0.923078f, 3.76482e-008f, + -0.384614f, 0.972045f, 0.234794f, 0f, 0.895972f, 0.219226f, + 0.38623f, 0.57987f, 0.145888f, 0.801541f, -1.56774e-008f, + -4.06593e-008f, 1f, -0.577708f, -0.153129f, 0.801751f, -0.890548f, + -0.23959f, 0.386678f, -0.965311f, -0.261102f, 0f, 0.913811f, + 0.406139f, 0f, 0.842942f, 0.38439f, 0.376421f, 0.548194f, + 0.264706f, 0.793356f, -1.8594e-008f, -5.87553e-008f, 1f, + -0.534196f, -0.289235f, 0.794341f, -0.807437f, -0.452559f, + 0.378465f, -0.869653f, -0.493664f, 0f, 0.83205f, 0.5547f, 0f, + 0.772293f, 0.530527f, 0.349435f, 0.515845f, 0.379263f, 0.768156f, + -2.48164e-008f, -6.43889e-008f, 1f, -0.486434f, -0.411777f, + 0.770598f, -0.700515f, -0.619694f, 0.353919f, -0.743581f, + -0.668646f, 0f, 0.722373f, 0.691503f, 0f, 0.676612f, 0.666255f, + 0.31353f, 0.471519f, 0.495195f, 0.729693f, -2.71577e-008f, + -7.53755e-008f, 1f, -0.433172f, -0.52092f, 0.73553f, -0.589822f, + -0.740319f, 0.322549f, -0.617031f, -0.786939f, 0f, 0.580972f, + 0.813923f, 0f, 0.548733f, 0.784249f, 0.289562f, 0.396971f, + 0.593617f, 0.700024f, -2.572e-008f, -8.77449e-008f, 1f, -0.367048f, + -0.602921f, 0.708352f, -0.485318f, -0.820874f, 0.301051f, + -0.504835f, -0.863216f, 0f, 0.390503f, 0.867784f, 0.307341f, + 0.285351f, 0.634113f, 0.718663f, -2.36665e-008f, -9.72958e-008f, + 1f, -0.285351f, -0.634114f, 0.718661f, -0.390503f, -0.867784f, + 0.30734f, -0.410365f, -0.911921f, 0f, -0.890548f, -0.23959f, + -0.386679f, -0.577707f, -0.153129f, -0.801752f, 1.08654e-008f, + 5.5622e-008f, -1f, 0.579872f, 0.145888f, -0.801539f, 0.895973f, + 0.219227f, -0.386228f, -0.807437f, -0.452558f, -0.378466f, + -0.534196f, -0.289235f, -0.794341f, 2.27516e-008f, 5.19016e-008f, + -1f, 0.548196f, 0.264707f, -0.793355f, 0.842943f, 0.384391f, + -0.376419f, -0.700515f, -0.619694f, -0.353919f, -0.486433f, + -0.411777f, -0.770599f, 2.48164e-008f, 6.43889e-008f, -1f, + 0.515847f, 0.379264f, -0.768154f, 0.772293f, 0.530528f, -0.349433f, + -0.589822f, -0.740319f, -0.322549f, -0.433171f, -0.520919f, + -0.735531f, 2.71577e-008f, 7.53755e-008f, -1f, 0.47152f, 0.495196f, + -0.729691f, 0.676612f, 0.666255f, -0.313529f, -0.485318f, + -0.820874f, -0.301052f, -0.367047f, -0.60292f, -0.708353f, + 2.88747e-008f, 8.75411e-008f, -1f, 0.396972f, 0.593619f, + -0.700022f, 0.548733f, 0.784249f, -0.289561f, -0.390503f, + -0.867784f, -0.30734f, -0.285351f, -0.634113f, -0.718662f, + 2.36665e-008f, 9.72958e-008f, -1f, 0.285351f, 0.634114f, + -0.718661f, 0.390503f, 0.867785f, -0.307339f, -0.333935f, + 0.942596f, 0f, 0f, 1f, 0f, -0.291732f, 0.855995f, 0.426808f, + -0.0157731f, 0.886804f, 0.461877f, -0.135103f, 0.53438f, 0.834377f, + -0.0291362f, 0.514277f, 0.857129f, 0.110195f, 0.0292375f, 0.99348f, + 4.3732e-009f, -8.94073e-008f, 1f, 0.348602f, -0.464039f, 0.814337f, + 0.0673463f, -0.513328f, 0.855546f, 0.492146f, -0.767551f, + 0.410679f, 0.134339f, -0.878875f, 0.457746f, 0.528678f, -0.848822f, + 0f, 0.158678f, -0.98733f, 0f, -0.731055f, 0.682318f, 0f, -0.64585f, + 0.656206f, 0.390219f, -0.31251f, 0.484842f, 0.816864f, 0.215359f, + 0.108813f, 0.970454f, 0.627608f, -0.260237f, 0.733747f, 0.813963f, + -0.465103f, 0.348055f, 0.854063f, -0.52017f, 0f, -0.920582f, + 0.39055f, 0f, -0.835236f, 0.412221f, 0.363943f, -0.451322f, + 0.38916f, 0.803034f, 0.214084f, 0.180281f, 0.960035f, 0.705425f, + -0.0805069f, 0.704198f, 0.913262f, -0.239978f, 0.329185f, + 0.957826f, -0.287348f, 0f, -0.948683f, 0.316228f, 0f, -0.842821f, + 0.34961f, 0.409177f, -0.452672f, 0.347535f, 0.821162f, 0.113546f, + 0.191909f, 0.974822f, 0.60461f, -0.0547987f, 0.794634f, 0.880145f, + -0.253261f, 0.401503f, 0.947589f, -0.319493f, 0f, -0.874591f, + 0.484861f, 0f, -0.723794f, 0.476715f, 0.498864f, -0.365377f, + 0.375544f, 0.851743f, 0.0260102f, 0.151516f, 0.988113f, 0.417243f, + -0.185123f, 0.88974f, 0.70819f, -0.506054f, 0.492318f, 0.787582f, + -0.61621f, 0f, -0.600001f, 0.799999f, 0f, -0.497164f, 0.711095f, + 0.497165f, -0.267367f, 0.443286f, 0.855577f, 0f, -4.47006e-008f, + 1f, 0.250514f, -0.54278f, 0.801644f, 0.366221f, -0.855433f, + 0.36622f, 0.384615f, -0.923077f, 0f, 0.528678f, -0.848822f, 0f, + 0.492146f, -0.767551f, -0.41068f, 0.134339f, -0.878875f, + -0.457747f, 0.348602f, -0.464038f, -0.814337f, 0.0673462f, + -0.513327f, -0.855546f, 0.110195f, 0.0292377f, -0.99348f, + -4.3732e-009f, 8.94073e-008f, -1f, -0.135104f, 0.534382f, + -0.834376f, -0.0291362f, 0.514278f, -0.857128f, -0.291732f, + 0.855996f, -0.426806f, -0.0157731f, 0.886804f, -0.461876f, + -0.333935f, 0.942596f, 0f, 0.854063f, -0.52017f, 0f, 0.813963f, + -0.465103f, -0.348056f, 0.627607f, -0.260237f, -0.733748f, + 0.215359f, 0.108813f, -0.970454f, -0.312512f, 0.484843f, + -0.816862f, -0.645851f, 0.656206f, -0.390218f, 0.913262f, + -0.239977f, -0.329185f, 0.705424f, -0.0805064f, -0.704199f, + 0.214084f, 0.180281f, -0.960035f, -0.451324f, 0.38916f, -0.803032f, + -0.835237f, 0.412221f, -0.363941f, 0.947589f, -0.319493f, 0f, + 0.880144f, -0.253261f, -0.401503f, 0.60461f, -0.0547981f, + -0.794635f, 0.113546f, 0.191909f, -0.974822f, -0.452675f, + 0.347535f, -0.821161f, -0.842822f, 0.34961f, -0.409175f, + -0.948683f, 0.316228f, 0f, 0.787582f, -0.61621f, 0f, 0.70819f, + -0.506053f, -0.492318f, 0.417243f, -0.185122f, -0.88974f, + 0.0260103f, 0.151516f, -0.988113f, -0.365379f, 0.375545f, + -0.851742f, -0.723796f, 0.476715f, -0.498861f, -0.874591f, + 0.484861f, 0f, 0.36622f, -0.855433f, -0.36622f, 0.250514f, + -0.54278f, -0.801644f, 0f, 4.47006e-008f, -1f, -0.267368f, + 0.443289f, -0.855575f, -0.497165f, 0.711096f, -0.497162f, + -0.467888f, 0.883788f, 0f, -0.387053f, 0.824948f, 0.411887f, + -0.215548f, 0.655025f, 0.72421f, -0.00489616f, 0.343259f, + 0.939228f, 0.269127f, -0.23781f, 0.933283f, 0.442187f, -0.761825f, + 0.473385f, 0.463425f, -0.886136f, 0f, -0.306008f, 0.952029f, 0f, + -0.253998f, 0.928137f, 0.272115f, -0.14959f, 0.863647f, 0.481391f, + -0.0195232f, 0.746219f, 0.665414f, 0.218115f, 0.441118f, 0.870541f, + 0.612385f, -0.337374f, 0.714957f, 0.694135f, -0.719844f, 0f, 0f, + 1f, 0f, -0.0182315f, 0.999613f, -0.0210205f, -0.0369304f, + 0.999286f, 0.00796664f, -0.0348909f, 0.997622f, 0.059444f, + -0.00787177f, 0.994104f, 0.108145f, 0.0539575f, 0.992309f, + 0.111405f, 0.106533f, 0.994309f, 0f, 0.913813f, 0.406135f, 0f, + 0.507716f, 0.52532f, -0.682835f, 0.148478f, 0.676273f, -0.721533f, + -0.0300304f, 0.787464f, -0.615629f, -0.144372f, 0.876436f, + -0.459366f, -0.223743f, 0.943891f, -0.242919f, -0.253109f, + 0.967438f, 0f, 0.789351f, -0.613942f, 0f, 0.577415f, -0.400033f, + -0.711734f, 0.241288f, -0.0136421f, -0.970358f, -0.0103803f, + 0.344669f, -0.938667f, -0.199105f, 0.663018f, -0.72164f, + -0.316295f, 0.875642f, -0.364979f, -0.349987f, 0.936755f, 0f, 0.6f, + -0.8f, 0f, 0.483629f, -0.690899f, -0.537366f, 0.247465f, -0.40568f, + -0.879878f, 0f, 4.47028e-008f, -1f, -0.236617f, 0.486025f, + -0.841304f, -0.378646f, 0.824393f, -0.420717f, -0.410365f, + 0.911921f, 0f, 0.442188f, -0.761824f, -0.473386f, 0.269127f, + -0.237807f, -0.933284f, -0.0048962f, 0.343262f, -0.939227f, + -0.215548f, 0.655028f, -0.724208f, -0.387053f, 0.82495f, + -0.411884f, 0.612385f, -0.337369f, -0.714959f, 0.218114f, + 0.441124f, -0.870538f, -0.0195232f, 0.746221f, -0.665412f, + -0.14959f, 0.863648f, -0.481389f, -0.253997f, 0.928138f, + -0.272112f, 0.0539562f, 0.992309f, -0.111404f, -0.00787199f, + 0.994104f, -0.108144f, -0.0348909f, 0.997622f, -0.0594425f, + -0.0369306f, 0.999286f, -0.00796709f, -0.0182318f, 0.999613f, + 0.0210199f, -0.223743f, 0.943891f, 0.242919f, -0.144372f, + 0.876437f, 0.459364f, -0.0300305f, 0.787466f, 0.615626f, 0.148478f, + 0.676276f, 0.721529f, 0.507717f, 0.525323f, 0.682832f, -0.316294f, + 0.875642f, 0.364979f, -0.199104f, 0.663019f, 0.72164f, -0.0103804f, + 0.344672f, 0.938666f, 0.241289f, -0.0136406f, 0.970357f, 0.577417f, + -0.400034f, 0.711732f, -0.378646f, 0.824393f, 0.420718f, + -0.236617f, 0.486023f, 0.841305f, 0f, -4.47028e-008f, 1f, + 0.247466f, -0.405682f, 0.879877f, 0.48363f, -0.690899f, 0.537365f, + 0.249998f, 0.968246f, 0f, 0.001257f, 0.999999f, 0f, 0.241077f, + 0.968356f, 0.0645611f, 0.00120899f, 0.999999f, 0.000335259f, + 0.215548f, 0.968509f, 0.124615f, 0.00108352f, 0.999999f, + 0.000626407f, 0.175886f, 0.96857f, 0.175886f, 0.124616f, 0.968509f, + 0.215548f, 0.0645611f, 0.968356f, 0.241077f, 0f, 0.968246f, + 0.249998f, 0.989204f, 0.146548f, 0f, 0.955495f, 0.146755f, + 0.255913f, 0.856312f, 0.147029f, 0.495088f, 0.699411f, 0.147135f, + 0.699411f, 0.495089f, 0.147029f, 0.856312f, 0.255914f, 0.146754f, + 0.955495f, 0f, 0.146548f, 0.989204f, 0.780869f, -0.624695f, 0f, + 0.753687f, -0.625441f, 0.201937f, 0.674735f, -0.626493f, 0.390178f, + 0.550895f, -0.62692f, 0.550896f, 0.390179f, -0.626493f, 0.674734f, + 0.201938f, -0.625441f, 0.753688f, 0f, -0.624695f, 0.780869f, + 0.747409f, -0.664364f, 0f, 0.721243f, -0.665116f, 0.193465f, + 0.645526f, -0.66618f, 0.373497f, 0.527081f, -0.666611f, 0.527081f, + 0.373498f, -0.66618f, 0.645526f, 0.193466f, -0.665116f, 0.721243f, + 0f, -0.664364f, 0.747409f, 0.950775f, -0.309882f, 0f, 0.917897f, + -0.310647f, 0.246906f, 0.822132f, -0.311772f, 0.476337f, 0.671753f, + -0.312241f, 0.671754f, 0.476338f, -0.311771f, 0.822132f, 0.246907f, + -0.310647f, 0.917897f, 0f, -0.309882f, 0.950775f, 0.6f, 0.8f, 0f, + 0.578783f, 0.800417f, 0.15602f, 0.517905f, 0.800964f, 0.300385f, + 0.423156f, 0.801173f, 0.423156f, 0.300386f, 0.800964f, 0.517904f, + 0.156021f, 0.800416f, 0.578784f, 0f, 0.799999f, 0.600001f, 0f, + 0.968246f, 0.249998f, -0.064561f, 0.968356f, 0.241077f, -0.124615f, + 0.968509f, 0.215548f, -0.175885f, 0.968571f, 0.175885f, -0.215548f, + 0.968509f, 0.124616f, -0.241076f, 0.968356f, 0.064561f, -0.249998f, + 0.968246f, 0f, 0f, 0.146549f, 0.989203f, -0.255913f, 0.146755f, + 0.955495f, -0.495088f, 0.14703f, 0.856312f, -0.699411f, 0.147136f, + 0.699411f, -0.856311f, 0.14703f, 0.495089f, -0.955495f, 0.146755f, + 0.255914f, -0.989203f, 0.146549f, 0f, -0.201937f, -0.625441f, + 0.753688f, -0.390178f, -0.626493f, 0.674735f, -0.550895f, + -0.62692f, 0.550896f, -0.674734f, -0.626493f, 0.390179f, + -0.753687f, -0.625441f, 0.201939f, -0.780869f, -0.624695f, 0f, 0f, + -0.664364f, 0.747409f, -0.193465f, -0.665116f, 0.721244f, + -0.373497f, -0.66618f, 0.645527f, -0.527081f, -0.666611f, + 0.527081f, -0.645526f, -0.66618f, 0.373498f, -0.721243f, + -0.665116f, 0.193466f, -0.747409f, -0.664364f, 0f, 0f, -0.309883f, + 0.950775f, -0.246906f, -0.310648f, 0.917897f, -0.476336f, + -0.311773f, 0.822132f, -0.671753f, -0.312242f, 0.671753f, + -0.822131f, -0.311773f, 0.476338f, -0.917897f, -0.310648f, + 0.246907f, -0.950775f, -0.309883f, 0f, -0.15602f, 0.800417f, + 0.578784f, -0.300385f, 0.800964f, 0.517905f, -0.423156f, 0.801173f, + 0.423156f, -0.517904f, 0.800964f, 0.300386f, -0.578783f, 0.800417f, + 0.15602f, -0.6f, 0.8f, 0f, -0.249998f, 0.968246f, 0f, -0.241077f, + 0.968356f, -0.064561f, -0.215548f, 0.968509f, -0.124615f, + -0.175885f, 0.968571f, -0.175885f, -0.124616f, 0.968509f, + -0.215548f, -0.064561f, 0.968356f, -0.241077f, 0f, 0.968246f, + -0.249998f, -0.989204f, 0.146547f, 0f, -0.955496f, 0.146753f, + -0.255912f, -0.856312f, 0.147028f, -0.495088f, -0.699411f, + 0.147134f, -0.699411f, -0.495089f, 0.147028f, -0.856312f, + -0.255914f, 0.146753f, -0.955495f, 0f, 0.146547f, -0.989204f, + -0.753688f, -0.625441f, -0.201937f, -0.674735f, -0.626494f, + -0.390178f, -0.550896f, -0.62692f, -0.550895f, -0.390179f, + -0.626494f, -0.674734f, -0.201938f, -0.625441f, -0.753687f, 0f, + -0.624695f, -0.780869f, -0.747409f, -0.664364f, 0f, -0.721244f, + -0.665116f, -0.193465f, -0.645526f, -0.66618f, -0.373497f, + -0.527081f, -0.666612f, -0.527081f, -0.373498f, -0.66618f, + -0.645526f, -0.193466f, -0.665116f, -0.721243f, 0f, -0.664364f, + -0.747409f, -0.950776f, -0.30988f, 0f, -0.917898f, -0.310645f, + -0.246906f, -0.822133f, -0.31177f, -0.476337f, -0.671754f, + -0.312239f, -0.671754f, -0.476338f, -0.31177f, -0.822132f, + -0.246907f, -0.310646f, -0.917898f, 0f, -0.309881f, -0.950775f, + -0.578783f, 0.800417f, -0.15602f, -0.517905f, 0.800964f, + -0.300384f, -0.423155f, 0.801174f, -0.423155f, -0.300386f, + 0.800964f, -0.517904f, -0.15602f, 0.800417f, -0.578783f, 0f, 0.8f, + -0.6f, 0.064561f, 0.968356f, -0.241077f, 0.124615f, 0.968509f, + -0.215548f, 0.175885f, 0.968571f, -0.175885f, 0.215549f, 0.968509f, + -0.124616f, 0.241077f, 0.968356f, -0.064561f, 0.249998f, 0.968246f, + 0f, 0.255913f, 0.146754f, -0.955496f, 0.495088f, 0.147028f, + -0.856312f, 0.699411f, 0.147134f, -0.699411f, 0.856312f, 0.147028f, + -0.495089f, 0.955495f, 0.146753f, -0.255914f, 0.989204f, 0.146547f, + 0f, 0.201937f, -0.625441f, -0.753687f, 0.390178f, -0.626494f, + -0.674735f, 0.550896f, -0.62692f, -0.550895f, 0.674734f, + -0.626494f, -0.390179f, 0.753687f, -0.625441f, -0.201938f, + 0.193465f, -0.665116f, -0.721243f, 0.373497f, -0.66618f, + -0.645526f, 0.527081f, -0.666612f, -0.527081f, 0.645526f, + -0.66618f, -0.373498f, 0.721244f, -0.665116f, -0.193466f, + 0.747409f, -0.664364f, 0f, 0.246906f, -0.310646f, -0.917898f, + 0.476337f, -0.31177f, -0.822133f, 0.671754f, -0.312239f, + -0.671754f, 0.822133f, -0.31177f, -0.476338f, 0.917898f, + -0.310646f, -0.246907f, 0.950776f, -0.30988f, 0f, 0.15602f, + 0.800417f, -0.578783f, 0.300384f, 0.800964f, -0.517905f, 0.423155f, + 0.801174f, -0.423155f, 0.517904f, 0.800964f, -0.300386f, 0.578783f, + 0.800417f, -0.15602f, 0.268354f, 0.96332f, 0f, 0.258757f, + 0.963421f, 0.0697519f, 0.231413f, 0.963552f, 0.134219f, 0.189037f, + 0.963603f, 0.189037f, 0.13422f, 0.963552f, 0.231413f, 0.0697519f, + 0.963421f, 0.258756f, 0f, 0.96332f, 0.268354f, 0.168031f, + 0.985782f, 0f, 0.162012f, 0.985822f, 0.0436728f, 0.144879f, + 0.985875f, 0.0840299f, 0.118345f, 0.985895f, 0.118345f, 0.0840302f, + 0.985875f, 0.144879f, 0.0436728f, 0.985822f, 0.162011f, 0f, + 0.985782f, 0.168031f, 0.14834f, 0.988936f, 0f, 0.143025f, + 0.988968f, 0.0385546f, 0.127899f, 0.989009f, 0.0741814f, 0.104474f, + 0.989025f, 0.104474f, 0.0741816f, 0.989009f, 0.127899f, 0.0385547f, + 0.988968f, 0.143025f, 0f, 0.988936f, 0.148341f, 0.193633f, + 0.981074f, 0f, 0.186698f, 0.981127f, 0.0503274f, 0.166959f, + 0.981197f, 0.0968359f, 0.136382f, 0.981224f, 0.136382f, 0.0968361f, + 0.981197f, 0.166958f, 0.0503276f, 0.981127f, 0.186699f, 0f, + 0.981074f, 0.193633f, 0.390291f, 0.920691f, 0f, 0.376377f, + 0.920895f, 0.101458f, 0.336655f, 0.921161f, 0.19526f, 0.275023f, + 0.921262f, 0.275023f, 0.19526f, 0.921161f, 0.336655f, 0.101459f, + 0.920894f, 0.376377f, 0f, 0.920691f, 0.390291f, 1f, 0f, 0f, + 0.965535f, -2.6932e-008f, 0.260274f, 0.865031f, -2.65808e-008f, + 0.501718f, 0.707107f, -1.58043e-008f, 0.707107f, 0.501719f, + -5.72865e-009f, 0.865031f, 0.260276f, -7.99283e-010f, 0.965534f, + 0f, 0f, 1f, -0.0697519f, 0.963421f, 0.258757f, -0.134219f, + 0.963552f, 0.231413f, -0.189037f, 0.963603f, 0.189037f, -0.231413f, + 0.963552f, 0.13422f, -0.258756f, 0.963421f, 0.0697519f, -0.268354f, + 0.96332f, 0f, -0.0436727f, 0.985822f, 0.162012f, -0.0840298f, + 0.985875f, 0.144879f, -0.118345f, 0.985895f, 0.118345f, -0.144879f, + 0.985875f, 0.0840302f, -0.162011f, 0.985822f, 0.0436728f, + -0.168031f, 0.985782f, 0f, -0.0385546f, 0.988968f, 0.143025f, + -0.0741813f, 0.989009f, 0.127899f, -0.104474f, 0.989025f, + 0.104474f, -0.127899f, 0.989009f, 0.0741816f, -0.143025f, + 0.988968f, 0.0385547f, -0.14834f, 0.988936f, 0f, -0.0503274f, + 0.981127f, 0.186698f, -0.0968359f, 0.981197f, 0.166959f, + -0.136382f, 0.981224f, 0.136382f, -0.166958f, 0.981197f, + 0.0968361f, -0.186699f, 0.981127f, 0.0503276f, -0.193633f, + 0.981074f, 0f, -0.101458f, 0.920895f, 0.376377f, -0.19526f, + 0.921161f, 0.336655f, -0.275023f, 0.921262f, 0.275023f, -0.336655f, + 0.921161f, 0.19526f, -0.376377f, 0.920894f, 0.101459f, -0.390291f, + 0.920691f, 0f, -0.260274f, -7.99271e-010f, 0.965535f, -0.501718f, + -5.72859e-009f, 0.865031f, -0.707107f, -1.58043e-008f, 0.707107f, + -0.865031f, -2.65808e-008f, 0.501719f, -0.965534f, -2.69321e-008f, + 0.260276f, -1f, 0f, 0f, -0.258757f, 0.963421f, -0.0697518f, + -0.231413f, 0.963552f, -0.134219f, -0.189037f, 0.963603f, + -0.189037f, -0.13422f, 0.963552f, -0.231413f, -0.0697518f, + 0.963421f, -0.258756f, 0f, 0.96332f, -0.268354f, -0.162012f, + 0.985822f, -0.0436727f, -0.144879f, 0.985875f, -0.0840298f, + -0.118345f, 0.985895f, -0.118345f, -0.0840302f, 0.985875f, + -0.144879f, -0.0436727f, 0.985822f, -0.162011f, 0f, 0.985782f, + -0.168031f, -0.143025f, 0.988968f, -0.0385546f, -0.127899f, + 0.989009f, -0.0741813f, -0.104474f, 0.989025f, -0.104474f, + -0.0741816f, 0.989009f, -0.127899f, -0.0385547f, 0.988968f, + -0.143025f, 0f, 0.988936f, -0.14834f, -0.186698f, 0.981127f, + -0.0503273f, -0.166959f, 0.981197f, -0.0968358f, -0.136382f, + 0.981224f, -0.136382f, -0.0968361f, 0.981197f, -0.166958f, + -0.0503276f, 0.981127f, -0.186699f, 0f, 0.981074f, -0.193633f, + -0.376377f, 0.920895f, -0.101458f, -0.336655f, 0.921161f, + -0.19526f, -0.275023f, 0.921262f, -0.275023f, -0.19526f, 0.921161f, + -0.336655f, -0.101459f, 0.920894f, -0.376377f, 0f, 0.920691f, + -0.390291f, -0.965535f, 2.6932e-008f, -0.260274f, -0.865031f, + 2.65807e-008f, -0.501718f, -0.707107f, 1.58043e-008f, -0.707107f, + -0.501719f, 5.72864e-009f, -0.865031f, -0.260276f, 7.99283e-010f, + -0.965534f, 0f, 0f, -1f, 0.0697518f, 0.963421f, -0.258757f, + 0.134219f, 0.963552f, -0.231413f, 0.189037f, 0.963603f, -0.189037f, + 0.231413f, 0.963552f, -0.13422f, 0.258756f, 0.963421f, -0.0697518f, + 0.0436727f, 0.985822f, -0.162012f, 0.0840298f, 0.985875f, + -0.144879f, 0.118345f, 0.985895f, -0.118345f, 0.144879f, 0.985875f, + -0.0840302f, 0.162011f, 0.985822f, -0.0436727f, 0.0385546f, + 0.988968f, -0.143025f, 0.0741813f, 0.989009f, -0.127899f, + 0.104474f, 0.989025f, -0.104474f, 0.127899f, 0.989009f, + -0.0741816f, 0.143025f, 0.988968f, -0.0385547f, 0.0503274f, + 0.981127f, -0.186698f, 0.0968359f, 0.981197f, -0.166959f, + 0.136382f, 0.981224f, -0.136382f, 0.166958f, 0.981197f, + -0.0968361f, 0.186699f, 0.981127f, -0.0503276f, 0.101458f, + 0.920895f, -0.376377f, 0.19526f, 0.921161f, -0.336655f, 0.275023f, + 0.921262f, -0.275023f, 0.336655f, 0.921161f, -0.19526f, 0.376377f, + 0.920894f, -0.101459f, 0.260274f, 7.99271e-010f, -0.965535f, + 0.501718f, 5.72859e-009f, -0.865031f, 0.707107f, 1.58043e-008f, + -0.707107f, 0.865031f, 2.65807e-008f, -0.501719f, 0.965534f, + 2.6932e-008f, -0.260276f, 0.0226746f, -0.999743f, -1.91575e-007f, + 0.00017586f, -1f, -1.78936e-007f, 0.0218614f, -0.999744f, + -0.00589325f, 0.0195486f, -0.999745f, -0.0113383f, 0.0159681f, + -0.999745f, -0.0159682f, 0.0113382f, -0.999745f, -0.0195487f, + 0.0058931f, -0.999744f, -0.0218616f, 0f, -0.999743f, -0.0226747f, + 0.0623783f, -0.998053f, -2.05165e-007f, 0.0601415f, -0.998058f, + -0.0162122f, 0.0537792f, -0.998066f, -0.0311921f, 0.0439291f, + -0.998068f, -0.0439292f, 0.031192f, -0.998066f, -0.0537793f, + 0.0162121f, -0.998058f, -0.0601416f, 0f, -0.998053f, -0.0623784f, + 0.141421f, -0.98995f, -2.16354e-007f, 0.136353f, -0.989978f, + -0.0367563f, 0.121933f, -0.990016f, -0.0707209f, 0.0996006f, + -0.99003f, -0.0996008f, 0.070721f, -0.990016f, -0.121933f, + 0.0367563f, -0.989978f, -0.136353f, 0f, -0.98995f, -0.141421f, + 0.328521f, -0.944497f, -2.21665e-007f, 0.316788f, -0.944644f, + -0.0853952f, 0.283332f, -0.944838f, -0.164332f, 0.231454f, + -0.944912f, -0.231454f, 0.164333f, -0.944838f, -0.283331f, + 0.0853954f, -0.944644f, -0.316788f, 0f, -0.944497f, -0.328521f, + 0.770022f, -0.638017f, -1.57624e-007f, 0.743044f, -0.638566f, + -0.200299f, 0.665183f, -0.639286f, -0.385806f, 0.543581f, + -0.639561f, -0.543581f, 0.385806f, -0.639286f, -0.665182f, 0.2003f, + -0.638566f, -0.743044f, 0f, -0.638017f, -0.770022f, 0.965535f, + 2.69333e-008f, -0.260274f, 0.865031f, 2.6582e-008f, -0.501718f, + 0.501719f, 5.7289e-009f, -0.865031f, 0.260276f, 7.9932e-010f, + -0.965534f, 0f, -0.999743f, -0.0226747f, -0.00589307f, -0.999744f, + -0.0218616f, -0.0113382f, -0.999745f, -0.0195487f, -0.015968f, + -0.999745f, -0.0159682f, -0.0195486f, -0.999745f, -0.0113384f, + -0.0218614f, -0.999744f, -0.00589328f, -0.0226746f, -0.999743f, + -1.91575e-007f, 0f, -0.998053f, -0.0623784f, -0.016212f, + -0.998058f, -0.0601416f, -0.0311919f, -0.998066f, -0.0537794f, + -0.0439291f, -0.998068f, -0.0439292f, -0.0537792f, -0.998066f, + -0.0311922f, -0.0601415f, -0.998058f, -0.0162123f, -0.0623783f, + -0.998053f, -2.05165e-007f, -0.0367561f, -0.989978f, -0.136353f, + -0.0707208f, -0.990016f, -0.121933f, -0.0996006f, -0.99003f, + -0.0996008f, -0.121932f, -0.990016f, -0.0707211f, -0.136353f, + -0.989978f, -0.0367565f, -0.141421f, -0.98995f, -2.16354e-007f, 0f, + -0.944497f, -0.32852f, -0.0853949f, -0.944644f, -0.316788f, + -0.164332f, -0.944838f, -0.283331f, -0.231454f, -0.944912f, + -0.231454f, -0.283331f, -0.944838f, -0.164333f, -0.316788f, + -0.944644f, -0.0853956f, -0.32852f, -0.944497f, -2.21665e-007f, 0f, + -0.638018f, -0.770021f, -0.200298f, -0.638567f, -0.743043f, + -0.385805f, -0.639287f, -0.665182f, -0.543581f, -0.639562f, + -0.543581f, -0.665181f, -0.639287f, -0.385806f, -0.743043f, + -0.638567f, -0.2003f, -0.770021f, -0.638018f, -1.57625e-007f, + -0.260274f, 7.99307e-010f, -0.965535f, -0.501718f, 5.72886e-009f, + -0.865031f, -0.865031f, 2.65819e-008f, -0.501719f, -0.965534f, + 2.69333e-008f, -0.260276f, -0.0226746f, -0.999743f, -1.91442e-007f, + -0.0218614f, -0.999744f, 0.00589289f, -0.0195486f, -0.999745f, + 0.011338f, -0.0159681f, -0.999745f, 0.0159679f, -0.0113382f, + -0.999745f, 0.0195484f, -0.0058931f, -0.999744f, 0.0218612f, 0f, + -0.999743f, 0.0226744f, -0.0623783f, -0.998053f, -2.04538e-007f, + -0.0601415f, -0.998058f, 0.0162119f, -0.0537793f, -0.998066f, + 0.0311918f, -0.0439291f, -0.998068f, 0.0439289f, -0.031192f, + -0.998066f, 0.0537791f, -0.0162121f, -0.998058f, 0.0601414f, 0f, + -0.998053f, 0.0623782f, -0.136353f, -0.989978f, 0.0367559f, + -0.121932f, -0.990016f, 0.0707206f, -0.0996006f, -0.99003f, + 0.0996005f, -0.0707209f, -0.990016f, 0.121932f, -0.0367563f, + -0.989978f, 0.136353f, 0f, -0.98995f, 0.141421f, -0.328521f, + -0.944497f, -2.1827e-007f, -0.316789f, -0.944644f, 0.0853949f, + -0.283332f, -0.944838f, 0.164332f, -0.231455f, -0.944911f, + 0.231454f, -0.164333f, -0.944837f, 0.283332f, -0.0853956f, + -0.944644f, 0.316789f, 0f, -0.944497f, 0.328521f, -0.770023f, + -0.638016f, -1.53325e-007f, -0.743045f, -0.638564f, 0.200299f, + -0.665184f, -0.639284f, 0.385806f, -0.543582f, -0.63956f, + 0.543582f, -0.385807f, -0.639284f, 0.665183f, -0.2003f, -0.638564f, + 0.743045f, 0f, -0.638016f, 0.770023f, -0.965535f, -2.69333e-008f, + 0.260274f, -0.865031f, -2.6582e-008f, 0.501718f, -0.707107f, + -1.58051e-008f, 0.707107f, -0.501719f, -5.7289e-009f, 0.865031f, + -0.260276f, -7.9932e-010f, 0.965534f, 0.00589307f, -0.999744f, + 0.0218612f, 0.0113382f, -0.999745f, 0.0195484f, 0.0159681f, + -0.999745f, 0.0159679f, 0.0195486f, -0.999745f, 0.011338f, + 0.0218614f, -0.999744f, 0.00589292f, 0.0226746f, -0.999743f, + -1.91442e-007f, 0.016212f, -0.998058f, 0.0601414f, 0.0311919f, + -0.998066f, 0.0537791f, 0.0439291f, -0.998068f, 0.0439289f, + 0.0537792f, -0.998066f, 0.0311918f, 0.0601415f, -0.998058f, + 0.016212f, 0.0623783f, -0.998053f, -2.04538e-007f, 0.0367561f, + -0.989978f, 0.136353f, 0.0707208f, -0.990016f, 0.121932f, + 0.0996006f, -0.99003f, 0.0996005f, 0.121932f, -0.990016f, + 0.0707208f, 0.136353f, -0.989978f, 0.0367561f, 0.0853951f, + -0.944644f, 0.316789f, 0.164332f, -0.944838f, 0.283332f, 0.231455f, + -0.944911f, 0.231454f, 0.283332f, -0.944837f, 0.164333f, 0.316789f, + -0.944644f, 0.0853954f, 0.328521f, -0.944497f, -2.1827e-007f, + 0.200299f, -0.638564f, 0.743045f, 0.385806f, -0.639284f, 0.665184f, + 0.543582f, -0.63956f, 0.543582f, 0.665183f, -0.639284f, 0.385807f, + 0.743045f, -0.638565f, 0.2003f, 0.770023f, -0.638016f, + -1.53325e-007f, 0.260274f, -7.99307e-010f, 0.965535f, 0.501718f, + -5.72886e-009f, 0.865031f, 0.707107f, -1.58051e-008f, 0.707107f, + 0.865031f, -2.65819e-008f, 0.501719f, 0.965534f, -2.69333e-008f, + 0.260276f, 0.000169553f, -1f, 4.55269e-005f, 0.000151615f, -1f, + 8.7758e-005f, 0.000123845f, -1f, 0.000123666f, 8.79365e-005f, -1f, + 0.000151436f, 4.57054e-005f, -1f, 0.000169374f, 0f, -1f, + 0.000175681f, -4.57057e-005f, -1f, 0.000169374f, -8.79367e-005f, + -1f, 0.000151436f, -0.000123845f, -1f, 0.000123666f, -0.000151615f, + -1f, 8.77577e-005f, -0.000169553f, -1f, 4.55266e-005f, + -0.00017586f, -1f, -1.78936e-007f, -0.141421f, -0.98995f, + -2.18023e-007f, 0f, -1f, -0.000176026f, -4.57022e-005f, -1f, + -0.000169719f, -8.79303e-005f, -1f, -0.000151783f, -0.000123836f, + -1f, -0.000124015f, -0.000151604f, -1f, -8.81092e-005f, + -0.00016954f, -1f, -4.58813e-005f, -0.000175847f, -1f, + -1.78936e-007f, 0.141421f, -0.98995f, -2.18023e-007f, 0.000175847f, + -1f, -1.78936e-007f, 0.000169541f, -1f, -4.58811e-005f, + 0.000151604f, -1f, -8.81091e-005f, 0.000123836f, -1f, + -0.000124015f, 8.79306e-005f, -1f, -0.000151783f, 4.57025e-005f, + -1f, -0.000169719f, 0.423155f, 0.801174f, 0.423155f, 0.300386f, + 0.800964f, 0.517905f, 0.15602f, 0.800417f, 0.578784f, 0f, 0.8f, + 0.6f, 0.000884181f, 0.999999f, 0.000884182f, 0.0006461f, 0.999999f, + 0.00107175f, 0.000305924f, 0.999999f, 0.00121748f, 0f, 0.999999f, + 0.001257f, 0.00125688f, 0.999999f, 0f, 0.00121716f, 0.999999f, + -0.000305839f, 0.00107193f, 0.999999f, -0.000646202f, 0.00088386f, + 0.999999f, -0.00088386f, 0.000626479f, 0.999999f, -0.00108364f, + 0.000335298f, 0.999999f, -0.00120914f, 0f, 0.999999f, -0.00125688f, + -0.000305839f, 0.999999f, -0.00121716f, -0.000646202f, 0.999999f, + -0.00107193f, -0.00088386f, 0.999999f, -0.00088386f, -0.00108364f, + 0.999999f, -0.000626479f, -0.00120914f, 0.999999f, -0.000335298f, + -0.00125688f, 0.999999f, 0f, 0.517904f, 0.800965f, -0.300385f, + 0.300384f, 0.800965f, -0.517904f, 0.15602f, 0.800418f, -0.578782f, + 0f, 0.800001f, -0.599999f, -0.15602f, 0.800418f, -0.578783f, + -0.300385f, 0.800965f, -0.517903f, -0.517904f, 0.800965f, + -0.300384f, -0.15602f, 0.800417f, 0.578783f, -0.300384f, 0.800964f, + 0.517905f, -0.423155f, 0.801174f, 0.423155f, 0f, 0.999999f, + 0.00125701f, -0.000335262f, 0.999999f, 0.00120901f, -0.000626413f, + 0.999999f, 0.00108353f, -0.00088419f, 0.999999f, 0.00088419f, + -0.00107176f, 0.999999f, 0.000646106f, -0.00121749f, 0.999999f, + 0.000305927f, -0.00125701f, 0.999999f, 0f, 0.366221f, -0.855433f, + -0.36622f, -0.497164f, 0.711096f, -0.497162f, -0.6f, 0.8f, 0f, + -0.267367f, 0.443287f, 0.855577f, -0.0149983f, 0.999888f, 0f, -1f, + 0f, 0f, -0.811257f, -0.584689f, -4.21204e-009f, 0.811257f, + -0.584689f, -4.21204e-009f, -0.6981f, -0.716f, -1.86057e-008f, + 0.6981f, -0.716f, -1.86057e-008f, -0.636383f, -0.771373f, + -5.10224e-008f, 0.636383f, -0.771373f, -5.10224e-008f, -0.675056f, + -0.737767f, -1.01053e-007f, 0.675056f, -0.737767f, -1.01053e-007f, + 0.965535f, -2.6933e-008f, 0.260274f, 0.902861f, 0.429933f, 0f, + 0.637936f, 0.431366f, -0.637936f, 0f, 0.429933f, -0.902861f, + -0.637936f, 0.431366f, -0.637936f, -0.902861f, 0.429933f, 0f, 0f, + 0.429933f, 0.902861f, -0.637936f, 0.431366f, 0.637936f, -0.556737f, + 0.830689f, 0f, 0.637936f, 0.431366f, 0.637936f, 0f, -0.156768f, + -0.987635f, -0.148341f, 0.988936f, 0f, 0.148341f, 0.988936f, 0 }; + + float lightAmbient[] = { 0.2f, 0.2f, 0.2f, 1 }; + float lightDiffuse[] = { 1.0f, 0.6f, 0.0f, 1 }; + float matAmbient[] = { 0.6f, 0.6f, 0.6f, 1.0f }; + float matDiffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f }; + float matSpecular[] = { 1.0f, 1.0f, 1.0f, 1.0f }; + float lightPosition[] = { 0, 0, 1.0f, 0 }; + float lightShininess = 100.0f; + float zNear = 0.1f, zFar = 1000.0f, fieldOfView = 60.0f; + float kTeapotScale = 3.0f; + + float size; + float kFilteringFactor = 0.1f; + + private Tester mTester; + private float xspeed; + private float yspeed; + private float zspeed; + + public TeapotRenderer(float _xspeed, float _yspeed, float _zspeed, Tester tester) { + // mContext = context; + xspeed = _xspeed; + yspeed = _yspeed; + zspeed = _zspeed; + mTester = tester; + teapot = new Teapot(); + teapot.setSpeedAndTester(xspeed, yspeed, zspeed, mTester); + Log.d("glesteapot", "TeapotRender"); + } + + public int[] getConfigSpec() { + // We don't need a depth buffer, and don't care about our + // color depth. + int[] configSpec = { EGL10.EGL_DEPTH_SIZE, 0, EGL10.EGL_NONE }; + Log.d("glesteapot", "TeapotRender getConfigSpec"); + return configSpec; + } + + public void onSurfaceCreated(GL10 gl, EGLConfig config) { + int w = 0, h =0; + + gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST); + gl.glViewport(0, 0, w, h); + + gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); + gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); + gl.glEnable(GL10.GL_DEPTH_TEST); + gl.glEnable(GL10.GL_CULL_FACE); + gl.glShadeModel(GL10.GL_SMOOTH); + + gl.glEnable(GL10.GL_LIGHTING); + gl.glEnable(GL10.GL_LIGHT0); + gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, matAmbient, 0); + gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, matDiffuse, 0); + gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_SPECULAR, matSpecular,0); + gl.glMaterialf(GL10.GL_FRONT_AND_BACK, GL10.GL_SHININESS, lightShininess); + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightAmbient, 0); + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightDiffuse, 0); + gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightPosition, 0); + gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); + gl.glEnableClientState(GL10.GL_NORMAL_ARRAY); + gl.glVertexPointer(3, GL10.GL_FLOAT, 0, fillFloatBuffer(teapot_vertices)); + gl.glNormalPointer(GL10.GL_FLOAT, 0, fillFloatBuffer(teapot_normals)); + gl.glEnable(GL10.GL_NORMALIZE); + + Log.d("glesteapot", "TeapotRender surfaceCreated()"); + } + + private FloatBuffer fillFloatBuffer(float[] mat) { + ByteBuffer vbb = ByteBuffer.allocateDirect(mat.length * 4); + vbb.order(ByteOrder.nativeOrder()); + FloatBuffer tmpBuffer = vbb.asFloatBuffer(); + tmpBuffer.put(mat); + tmpBuffer.position(0); + return tmpBuffer; + } + + public void onDrawFrame(GL10 gl) { + teapot.draw(gl); + } + + public void onSurfaceChanged(GL10 gl, int w, int h) { + gl.glViewport(0, 0, w, h); + + float ratio = (float) w / h; + + gl.glMatrixMode(GL10.GL_PROJECTION); + gl.glLoadIdentity(); + size = (float) (zNear * Math.tan((fieldOfView / 180 * 3.14) / 2.0)); + gl.glFrustumf(-size, size, -size / ratio, size / ratio, zNear, zFar); + gl.glMatrixMode(GL10.GL_MODELVIEW); + + gl.glClearColor(0, 0, 0, 0); + gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); + gl.glLoadIdentity(); + gl.glTranslatef(0.0f, -0.1f, -1.0f); + gl.glScalef(kTeapotScale, kTeapotScale, kTeapotScale); + Log.d("glesteapot", "sizeChanged: " + w + ", " + h); + } + + public void onSensorChanged(float[] values) { + teapot.onSensorValueChanged(values); + } + + public void setSensor(int sensorId) { + teapot.setSensor(sensorId); + } + + private Teapot teapot; +} + +class Teapot { + float kFilteringFactor = 0.1f; + float[] m2; + float sensorValues[] = new float[3]; + float _accelerometer[] = new float[3]; + private int sensorMode; + + private float xrot = 0; + private float yrot = 0; + private float zrot = 0; + static short teapot_indices[] = { 1122, 1243, 1272, 1242, 1273, 1241, 1274, + 1240, 1275, 1239, 1276, 1238, 1277, 1205, 1278, 1204, 1279, 1203, + 1280, 1202, 1281, 1201, 1282, 1200, 1283, 1199, -1, 1243, 1249, + 1242, 1248, 1241, 1247, 1240, 1246, 1239, 1245, 1238, 1244, 1205, + 1212, 1204, 1211, 1203, 1210, 1202, 1209, 1201, 1208, 1200, 1207, + 1199, 1206, -1, 1249, 1136, 1248, 1254, 1247, 1253, 1246, 1252, + 1245, 1251, 1244, 1250, 1212, 1218, 1211, 1217, 1210, 1216, 1209, + 1215, 1208, 1214, 1207, 1213, 1206, 1180, -1, 1136, 1260, 1254, + 1259, 1253, 1258, 1252, 1257, 1251, 1256, 1250, 1255, 1218, 1225, + 1217, 1224, 1216, 1223, 1215, 1222, 1214, 1221, 1213, 1220, 1180, + 1219, -1, 1260, 1266, 1259, 1265, 1258, 1264, 1257, 1263, 1256, + 1262, 1255, 1261, 1225, 1232, 1224, 1231, 1223, 1230, 1222, 1229, + 1221, 1228, 1220, 1227, 1219, 1226, -1, 1266, 384, 1265, 1271, + 1264, 1270, 1263, 1269, 1262, 1268, 1261, 1267, 1232, 390, 1231, + 1237, 1230, 1236, 1229, 1235, 1228, 1234, 1227, 1233, 1226, 426, + -1, 462, 1188, 1195, 1189, 1196, 1190, 459, 1191, 1197, 1192, 1198, + 1193, 426, 1194, -1, 1188, 1181, 1189, 1182, 1190, 1183, 1191, + 1184, 1192, 1185, 1193, 1186, 1194, 1187, -1, 1181, 1142, 1182, + 1175, 1183, 1176, 1184, 1177, 1185, 1178, 1186, 1179, 1187, 1284, + -1, 1142, 1168, 1175, 1169, 1176, 1170, 1177, 1171, 1178, 1172, + 1179, 1173, 1284, 1174, -1, 1168, 1161, 1169, 1162, 1170, 1163, + 1171, 1164, 1172, 1165, 1173, 1166, 1174, 1167, -1, 1161, 1285, + 1162, 1286, 1163, 1287, 1164, 1288, 1165, 1289, 1166, 1290, 1167, + 1291, -1, 384, 1150, 1157, 1151, 1158, 1152, 490, 1153, 1159, 1154, + 1160, 1155, 462, 1156, -1, 1150, 1143, 1151, 1144, 1152, 1145, + 1153, 1146, 1154, 1147, 1155, 1148, 1156, 1149, -1, 1143, 1292, + 1144, 1137, 1145, 1138, 1146, 1139, 1147, 1140, 1148, 1141, 1149, + 1142, -1, 1292, 1129, 1137, 1130, 1138, 1131, 1139, 1132, 1140, + 1133, 1141, 1134, 1142, 1135, -1, 1129, 1121, 1130, 1123, 1131, + 1124, 1132, 1125, 1133, 1126, 1134, 1127, 1135, 1128, -1, 1121, + 1293, 1123, 1294, 1124, 1295, 1125, 1296, 1126, 1297, 1127, 1298, + 1128, 1285, -1, 902, 1024, 901, 1023, 900, 1022, 899, 1021, 898, + 1020, 897, 1019, 862, 983, 861, 982, 860, 981, 859, 980, 858, 979, + 857, 978, 856, 977, -1, 856, 849, 857, 850, 858, 851, 1299, 852, + 1300, 853, 1301, 854, 1302, 855, -1, 849, 842, 850, 843, 851, 844, + 852, 845, 853, 846, 854, 847, 855, 848, -1, 842, 835, 843, 836, + 844, 837, 845, 838, 846, 839, 847, 840, 848, 841, -1, 835, 828, + 836, 829, 837, 830, 838, 831, 839, 832, 840, 833, 841, 834, -1, + 828, 818, 829, 820, 830, 822, 831, 824, 832, 825, 833, 826, 834, + 827, -1, 818, 819, 820, 821, 822, 823, 824, 1303, 825, 1304, 826, + 1305, 827, 1306, -1, 1307, 948, 1308, 947, 1309, 946, 1310, 945, + 1311, 944, 1312, 943, 1313, 909, 1314, 908, 1315, 907, 1316, 906, + 1317, 905, 1318, 904, 1319, 903, -1, 948, 954, 947, 953, 946, 952, + 945, 951, 944, 950, 943, 949, 909, 916, 908, 915, 907, 914, 906, + 913, 905, 912, 904, 911, 903, 910, -1, 954, 835, 953, 959, 952, + 958, 951, 957, 950, 956, 949, 955, 916, 922, 915, 921, 914, 920, + 913, 919, 912, 918, 911, 917, 910, 882, -1, 835, 965, 959, 964, + 958, 963, 957, 962, 956, 961, 955, 960, 922, 929, 921, 928, 920, + 927, 919, 926, 918, 925, 917, 924, 882, 923, -1, 965, 971, 964, + 970, 963, 969, 962, 968, 961, 967, 960, 966, 929, 936, 928, 935, + 927, 934, 926, 933, 925, 932, 924, 931, 923, 930, -1, 971, 856, + 970, 976, 969, 975, 968, 974, 967, 973, 966, 972, 936, 942, 935, + 941, 934, 940, 933, 939, 932, 938, 931, 937, 930, 902, -1, 856, + 977, 976, 1095, 1320, 1094, 974, 1093, 1321, 1092, 1322, 1091, + 1323, 1060, 1324, 1059, 1325, 1058, 939, 1057, 1326, 1056, 937, + 1055, 902, 1024, -1, 1302, 890, 1327, 891, 1328, 892, 1329, 893, + 900, 894, 901, 895, 902, 896, -1, 890, 883, 891, 884, 892, 885, + 893, 886, 894, 887, 895, 888, 896, 889, -1, 883, 841, 884, 877, + 885, 878, 886, 879, 887, 880, 888, 881, 889, 882, -1, 841, 870, + 877, 871, 878, 872, 879, 873, 880, 874, 881, 875, 882, 876, -1, + 870, 863, 871, 864, 872, 865, 873, 866, 874, 867, 875, 868, 876, + 869, -1, 863, 1330, 864, 1331, 865, 1332, 866, 1333, 867, 1334, + 868, 1335, 869, 1336, -1, 787, 780, 813, 808, 814, 809, 815, 810, + 816, 811, 817, 812, 781, 774, 782, 775, 783, 776, 784, 777, 785, + 778, 786, 779, 787, 780, -1, 774, 767, 775, 768, 776, 769, 777, + 770, 778, 771, 779, 772, 780, 773, -1, 767, 760, 768, 761, 769, + 762, 770, 763, 771, 764, 772, 765, 773, 766, 803, 798, 804, 799, + 805, 800, 806, 801, 807, 802, 767, 760, -1, 767, 774, 807, 812, + 806, 811, 805, 810, 804, 809, 803, 808, 773, 780, -1, 760, 753, + 761, 754, 762, 755, 763, 756, 764, 757, 765, 758, 766, 759, 798, + 793, 799, 794, 800, 795, 801, 796, 802, 797, 760, 753, -1, 759, + 752, 793, 788, 794, 789, 795, 790, 796, 791, 797, 792, 753, 746, + -1, 752, 703, 788, 741, 789, 742, 790, 743, 791, 744, 792, 745, + 746, 697, 747, 698, 748, 699, 749, 700, 750, 701, 751, 702, 752, + 703, -1, 752, 759, 751, 758, 750, 757, 749, 756, 748, 755, 747, + 754, 746, 753, -1, 703, 734, 1337, 735, 742, 736, 743, 737, 744, + 738, 1338, 739, 1339, 740, -1, 734, 727, 735, 728, 736, 729, 737, + 730, 738, 731, 739, 732, 740, 733, -1, 727, 682, 728, 722, 729, + 723, 730, 724, 731, 725, 732, 726, 733, 676, -1, 682, 716, 722, + 717, 723, 718, 724, 719, 725, 720, 726, 721, 676, 669, -1, 716, + 704, 717, 705, 718, 707, 719, 709, 720, 711, 721, 713, 669, 715, + -1, 704, 668, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 656, -1, 1339, 690, 698, 691, 1340, 692, 700, 693, 701, 694, + 702, 695, 703, 696, -1, 690, 683, 691, 684, 692, 685, 693, 686, + 694, 687, 695, 688, 696, 689, -1, 683, 676, 684, 677, 685, 678, + 686, 679, 687, 680, 688, 681, 689, 682, -1, 676, 669, 677, 670, + 678, 671, 679, 672, 680, 673, 681, 674, 682, 675, -1, 669, 655, + 670, 657, 671, 659, 672, 661, 673, 663, 674, 665, 675, 667, -1, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, + 668, -1, 624, 618, 650, 645, 651, 646, 652, 647, 653, 648, 654, + 649, 266, 612, -1, 266, 612, 619, 613, 620, 614, 621, 615, 622, + 616, 623, 617, 624, 618, -1, 612, 605, 613, 606, 614, 607, 615, + 608, 616, 609, 617, 610, 618, 611, 645, 640, 646, 641, 647, 642, + 648, 643, 649, 644, 612, 605, -1, 605, 598, 606, 599, 607, 600, + 608, 601, 609, 602, 610, 603, 611, 604, 640, 635, 641, 636, 642, + 637, 643, 638, 644, 639, 605, 598, -1, 604, 597, 635, 630, 636, + 631, 637, 632, 638, 633, 639, 634, 598, 591, -1, 597, 590, 630, + 625, 631, 626, 632, 627, 633, 628, 634, 629, 591, 584, -1, 590, + 541, 625, 579, 626, 580, 627, 581, 628, 582, 629, 583, 584, 535, + 585, 536, 586, 537, 587, 538, 588, 539, 589, 540, 590, 541, -1, + 590, 597, 589, 596, 588, 595, 587, 594, 586, 593, 585, 592, 584, + 591, -1, 597, 604, 596, 603, 595, 602, 594, 601, 593, 600, 592, + 599, 591, 598, -1, 541, 572, 579, 573, 580, 574, 581, 575, 582, + 576, 583, 577, 535, 578, -1, 572, 565, 573, 566, 574, 567, 575, + 568, 576, 569, 577, 570, 578, 571, -1, 565, 520, 566, 560, 567, + 561, 568, 562, 569, 563, 570, 564, 571, 514, -1, 520, 553, 560, + 554, 561, 555, 562, 556, 563, 557, 564, 558, 514, 559, -1, 553, + 505, 554, 542, 555, 544, 556, 546, 557, 548, 558, 550, 559, 552, + -1, 505, 506, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, + 552, 494, -1, 535, 528, 536, 529, 537, 530, 538, 531, 539, 532, + 540, 533, 541, 534, -1, 528, 521, 529, 522, 530, 523, 531, 524, + 532, 525, 533, 526, 534, 527, -1, 521, 514, 522, 515, 523, 516, + 524, 517, 525, 518, 526, 519, 527, 520, -1, 514, 507, 515, 508, + 516, 509, 517, 510, 518, 511, 519, 512, 520, 513, -1, 507, 493, + 508, 495, 509, 497, 510, 499, 511, 501, 512, 503, 513, 1341, -1, + 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 1341, + 506, -1, 216, 349, 348, 467, 347, 466, 346, 465, 345, 464, 344, + 463, 310, 432, 309, 431, 308, 430, 307, 429, 306, 428, 305, 427, + 1342, 396, -1, 349, 356, 467, 472, 466, 471, 465, 470, 464, 469, + 463, 468, 432, 438, 431, 437, 430, 436, 429, 435, 428, 434, 427, + 433, 396, 402, -1, 356, 363, 472, 477, 471, 476, 470, 475, 469, + 474, 468, 473, 438, 444, 437, 443, 436, 442, 435, 441, 434, 440, + 433, 439, 402, 408, -1, 363, 370, 477, 482, 476, 481, 475, 480, + 474, 479, 473, 478, 444, 450, 443, 449, 442, 448, 441, 447, 440, + 446, 439, 445, 408, 414, -1, 370, 377, 482, 487, 481, 486, 480, + 485, 479, 484, 478, 483, 450, 456, 449, 455, 448, 454, 447, 453, + 446, 452, 445, 451, 414, 420, -1, 377, 384, 487, 492, 486, 491, + 485, 490, 484, 489, 483, 488, 456, 462, 455, 461, 454, 460, 453, + 459, 452, 458, 451, 457, 420, 426, -1, 1342, 396, 265, 395, 264, + 394, 263, 393, 262, 392, 261, 391, 222, 355, 221, 354, 220, 353, + 219, 352, 218, 351, 217, 350, 216, 349, -1, 396, 1343, 395, 401, + 394, 400, 393, 399, 392, 398, 391, 397, 355, 362, 354, 361, 353, + 360, 352, 359, 351, 358, 350, 357, 349, 1344, -1, 1343, 1345, 401, + 407, 400, 406, 399, 405, 398, 404, 397, 403, 362, 369, 361, 368, + 360, 367, 359, 366, 358, 365, 357, 364, 1344, 1346, -1, 1345, 1347, + 407, 413, 406, 412, 405, 411, 404, 410, 403, 409, 369, 376, 368, + 375, 367, 374, 366, 373, 365, 372, 364, 371, 1346, 1348, -1, 1347, + 1349, 413, 419, 412, 418, 411, 417, 410, 416, 409, 415, 376, 383, + 375, 382, 374, 381, 373, 380, 372, 379, 371, 378, 1348, 1350, -1, + 1349, 426, 419, 425, 418, 424, 417, 423, 416, 422, 415, 421, 383, + 390, 382, 389, 381, 388, 380, 387, 379, 386, 378, 385, 1350, 384, + -1, 42, 320, 319, 318, 317, 316, 174, 315, 314, 313, 312, 311, 137, + 277, 276, 275, 274, 273, 134, 272, 271, 270, 269, 268, 92, 267, -1, + 320, 326, 318, 325, 316, 324, 315, 323, 313, 322, 311, 321, 277, + 284, 275, 283, 273, 282, 272, 281, 270, 280, 268, 279, 267, 278, + -1, 326, 195, 325, 331, 324, 330, 323, 329, 322, 328, 321, 327, + 284, 290, 283, 289, 282, 288, 281, 287, 280, 286, 279, 285, 278, + 246, -1, 195, 337, 331, 336, 330, 335, 329, 334, 328, 333, 327, + 332, 290, 297, 289, 296, 288, 295, 287, 294, 286, 293, 285, 292, + 246, 291, -1, 337, 343, 336, 342, 335, 341, 334, 340, 333, 339, + 332, 338, 297, 304, 296, 303, 295, 302, 294, 301, 293, 300, 292, + 299, 291, 298, -1, 343, 216, 342, 348, 341, 347, 340, 346, 339, + 345, 338, 344, 304, 310, 303, 309, 302, 308, 301, 307, 300, 306, + 299, 305, 298, 1342, -1, 222, 254, 261, 255, 262, 256, 263, 257, + 264, 258, 265, 259, 1342, 260, -1, 254, 247, 255, 248, 256, 249, + 257, 250, 258, 251, 259, 252, 260, 253, -1, 247, 201, 248, 241, + 249, 242, 250, 243, 251, 244, 252, 245, 253, 246, -1, 201, 234, + 241, 235, 242, 236, 243, 237, 244, 238, 245, 239, 246, 240, -1, + 234, 223, 235, 224, 236, 226, 237, 228, 238, 229, 239, 231, 240, + 233, -1, 223, 48, 224, 225, 226, 227, 228, 89, 229, 230, 231, 232, + 233, 92, -1, 216, 209, 1351, 210, 218, 211, 219, 212, 220, 213, + 221, 214, 222, 215, -1, 209, 202, 210, 203, 211, 204, 212, 205, + 213, 206, 214, 207, 215, 208, -1, 202, 195, 203, 196, 204, 197, + 205, 198, 206, 199, 207, 200, 208, 201, -1, 195, 188, 196, 189, + 197, 190, 198, 191, 199, 192, 200, 193, 201, 194, -1, 188, 177, + 189, 178, 190, 180, 191, 182, 192, 183, 193, 185, 194, 187, -1, + 177, 42, 178, 179, 180, 181, 182, 45, 183, 184, 185, 186, 187, 48, + -1, 1, 148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 105, + 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 60, 93, -1, 148, + 154, 146, 153, 144, 152, 142, 151, 140, 150, 138, 149, 104, 112, + 102, 111, 100, 110, 98, 109, 96, 108, 94, 107, 93, 106, -1, 154, + 21, 153, 159, 152, 158, 151, 157, 150, 156, 149, 155, 112, 118, + 111, 117, 110, 116, 109, 115, 108, 114, 107, 113, 106, 72, -1, 21, + 165, 159, 164, 158, 163, 157, 162, 156, 161, 155, 160, 118, 124, + 117, 123, 116, 122, 115, 121, 114, 120, 113, 119, 72, 79, -1, 165, + 171, 164, 170, 163, 169, 162, 168, 161, 167, 160, 166, 124, 131, + 123, 130, 122, 129, 121, 128, 120, 127, 119, 126, 79, 125, -1, 171, + 1352, 170, 176, 169, 175, 168, 1353, 167, 173, 166, 172, 131, 1354, + 130, 136, 129, 135, 128, 1355, 127, 133, 126, 132, 125, 1356, -1, + 1357, 80, 87, 81, 88, 82, 1358, 83, 90, 84, 91, 85, 1356, 86, -1, + 80, 73, 81, 74, 82, 75, 83, 76, 84, 77, 85, 78, 86, 1359, -1, 73, + 27, 74, 67, 75, 68, 76, 69, 77, 70, 78, 71, 1359, 72, -1, 27, 20, + 67, 61, 68, 62, 69, 63, 70, 64, 71, 65, 72, 66, -1, 20, 12, 61, 49, + 62, 51, 63, 53, 64, 55, 65, 57, 66, 59, -1, 12, 13, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, -1, 1352, 35, 43, 36, 44, 37, 1360, + 38, 46, 39, 47, 40, 1357, 41, -1, 35, 28, 36, 29, 37, 30, 38, 31, + 39, 32, 40, 33, 41, 34, -1, 28, 21, 29, 22, 30, 23, 31, 24, 32, 25, + 33, 26, 34, 27, -1, 21, 14, 22, 15, 23, 16, 24, 17, 25, 18, 26, 19, + 27, 20, -1, 14, 0, 15, 2, 16, 4, 17, 6, 18, 8, 19, 10, 20, 1361, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1361, 13, -1, 1024, 1055, + 1061, 1062, 1068, 1069, 1075, 1076, 1082, 1083, 1089, 1090, -1, + 1089, 1088, 1082, 1081, 1075, 1074, 1068, 1067, 1061, 1030, 1024, + 1023, -1, 1030, 1067, 1036, 1073, 1042, 1079, 1048, 1085, 1054, -1, + 1085, 1079, 1086, 1080, 1087, 1081, 1088, -1, 1081, 1080, 1074, + 1073, 1067, -1, 1080, 1079, 1073, -1, 1055, 1056, 1062, 1063, 1069, + 1070, 1076, 1077, 1083, 1084, 1090, 1116, -1, 1056, 1057, 1063, + 1064, 1070, 1071, 1077, 1078, 1084, 1111, 1116, 1117, -1, 1057, + 1058, 1064, 1065, 1071, 1072, 1078, 1106, 1111, 1112, 1117, 1118, + -1, 1058, 1059, 1065, 1066, 1072, 1101, 1106, 1107, 1112, 1113, + 1118, 1119, -1, 1059, 1060, 1066, 1096, 1101, 1102, 1107, 1108, + 1113, 1114, 1119, 1120, -1, 1060, 1091, 1096, 1097, 1102, 1103, + 1108, 1109, 1114, 1115, 1120, 1012, -1, 1091, 1092, 1097, 1098, + 1103, 1104, 1109, 1110, 1115, 1005, 1012, 1013, -1, 1092, 1093, + 1098, 1099, 1104, 1105, 1110, 998, 1005, 1006, 1013, 1014, -1, 998, + 1105, 991, 1100, 984, 1095, 977, -1, 1095, 1100, 1094, 1099, 1093, + -1, 1100, 1105, 1099, -1, 984, 977, 985, 978, 986, 979, 987, 980, + 988, 981, 989, 982, 990, 983, 1025, 1019, 1026, 1020, 1027, 1021, + 1028, 1022, 1029, 1023, 1030, -1, 1030, 1362, 1029, 1035, 1028, + 1034, 1027, 1033, 1026, 1032, 1025, 1031, 990, 997, 989, 996, 988, + 995, 987, 994, 986, 993, 985, 992, 984, 1363, -1, 1362, 1042, 1035, + 1041, 1034, 1040, 1033, 1039, 1032, 1038, 1031, 1037, 997, 1004, + 996, 1003, 995, 1002, 994, 1001, 993, 1000, 992, 999, 1363, 998, + -1, 998, 999, 1006, 1007, 1014, 1015, -1, 999, 1000, 1007, 1008, + 1015, 1016, -1, 1000, 1001, 1008, 1009, 1016, 1017, -1, 1001, 1002, + 1009, 1010, 1017, 1018, -1, 1002, 1003, 1010, 1011, 1018, 1049, -1, + 1003, 1004, 1011, 1043, 1049, 1050, -1, 1004, 1037, 1043, 1044, + 1050, 1051, -1, 1037, 1038, 1044, 1045, 1051, 1052, -1, 1038, 1039, + 1045, 1046, 1052, 1053, -1, 1039, 1040, 1046, 1047, 1053, 1054, -1, + 1054, 1047, 1048, 1041, 1042, -1, 1041, 1047, 1040, -1, }; + + private Tester mTester; + private float xspeed; + private float yspeed; + private float zspeed; + + public void setSpeedAndTester(float _xspeed, float _yspeed, float _zspeed, Tester tester) { + xspeed = _xspeed; + yspeed = _yspeed; + zspeed = _zspeed; + mTester = tester; + } + + public Teapot() { + ByteBuffer vbb = ByteBuffer.allocateDirect(teapot_indices.length * 4); + vbb.order(ByteOrder.nativeOrder()); + mVertexBuffer = vbb.asShortBuffer(); + mVertexBuffer.put(teapot_indices); + mVertexBuffer.position(0); + sensorMode = TeapotES.ACCEL_ID; + Log.d("glesteapot", "Teapot()"); + } + + public void setSensor(int sensor) { + sensorMode = sensor; + } + + public void onSensorValueChanged(float[] values) { + sensorValues = values; + } + + public void draw(GL10 gl) { + int num_teapot_indices = 2781; + int i = 0, start = 0; + float kTeapotScale = 3.0f; + + gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); + gl.glRotatef(xrot, 1, 0, 0); + gl.glRotatef(yrot, 0, 1, 0); + gl.glRotatef(zrot, 0, 0, 1); + gl.glRotatef(90.0f, 0, 0, -1); + + + while (i < num_teapot_indices) { + if (teapot_indices[i] == -1) { + gl.glDrawElements(GL10.GL_TRIANGLE_STRIP, i - start, + GL10.GL_UNSIGNED_SHORT, mVertexBuffer.position(start)); + start = i + 1; + } + i++; + } + if (start < num_teapot_indices) + gl.glDrawElements(GL10.GL_TRIANGLE_STRIP, i - start - 1, + GL10.GL_UNSIGNED_SHORT, mVertexBuffer.position(start)); + // Log.d("glesteapot", "draw"); + gl.glLoadIdentity(); + gl.glTranslatef(0.0f, -0.1f, -1.0f); + gl.glScalef(kTeapotScale, kTeapotScale, kTeapotScale); + + xrot += xspeed; + yrot += yspeed; + zrot += zspeed; + gl.glFinish(); + mTester.decreaseCounter(); + } + + private ShortBuffer mVertexBuffer; +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/BaseBenchmark.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/BaseBenchmark.java index c214a05..0cc1118 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/BaseBenchmark.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/BaseBenchmark.java @@ -17,7 +17,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Date; +import java.util.HashMap; import java.util.List; +import java.util.Map; /** * Created by iasenov on 8/22/16. @@ -25,6 +27,7 @@ import java.util.List; public class BaseBenchmark { public String benchmarkName; + public String chartName; public String version; public String date$; public String executable_name; @@ -33,6 +36,8 @@ public class BaseBenchmark { public static long endTest; public static double testTime; public static Process process_exec; + public static long elapsedFromActivityTest; //only for GPU tests + public static int mRound; //only for GPU tests public List TESTCOMMANDS; //List with Specific test commands public String[] xout = new String[20]; @@ -57,8 +62,6 @@ public class BaseBenchmark { ); - - //********************************************************************************************** //Get all commands by executable_name //********************************************************************************************** @@ -192,14 +195,14 @@ public class BaseBenchmark { } xout[15] = "\n"; - xout[elapsedTimeIdx] = " Total Elapsed Time " + String.format("%5.1f", testTime) + xout[elapsedTimeIdx] = " Total Elapsed Time " + String.format("%5.4f", testTime) + " seconds\n"; //HTML BEGIN if(iType.equals("EX")) { HtmlUtil.addTemplateParagraph(); - HtmlUtil.replaceHtmlTag("BODY", "Total Elapsed Time " + String.format("%5.1f", testTime) + " seconds\n"); + HtmlUtil.replaceHtmlTag("BODY", "Total Elapsed Time " + String.format("%5.4f", testTime) + " seconds\n"); HtmlUtil.addTemplateEnd(); }else if(iType.equals("SL")){ HtmlUtil.addTemplateExecute(); @@ -477,6 +480,48 @@ public class BaseBenchmark { return result; } + + + + //********************************************************************************************** + //Fill mapTimes map with elapsed time for every test and use it to create chart + //********************************************************************************************** + public void sendElapsedTimeToChart(){ + + double mTestTime = Math.sqrt(round((double) (endTest - startTest) / 1000,4)); + String timeStr = ""; + + if(MainActivity.mapTimes.containsKey(chartName)){ //in case test is run more than once + timeStr = MainActivity.mapTimes.get(chartName); + timeStr = timeStr + ":" + Math.sqrt(round((double) (endTest - startTest) / 1000,4)); + MainActivity.mapTimes.put(chartName, "" + timeStr); + + }else{ + MainActivity.mapTimes.put(chartName, "" + mTestTime); + } + + //Log.i(TAG, timeStr + ":" + round((double) (endTest - startTest) / 1000,1)); + } + + + //********************************************************************************************** + //Round double value by wanted places + //********************************************************************************************** + public static double round(double value, int places) { + if (places < 0) throw new IllegalArgumentException(); + + long factor = (long) Math.pow(10, places); + value = value * factor; + long tmp = Math.round(value); + return (double) tmp / factor; + } + + //********************************************************************************************** + //Add elapsed time to total elapsed time used for HTML + //********************************************************************************************** + public void submitElapsedTime(long elapsed){ + MainActivity.elapsedTotalTime = MainActivity.elapsedTotalTime + elapsed; + } //********************************************************************************************** }//BaseBenchmark //********************************************************************************************** \ No newline at end of file diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Chart.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Chart.java new file mode 100644 index 0000000..959bf8c --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Chart.java @@ -0,0 +1,232 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.util.Log; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.Toast; + + +import com.github.mikephil.charting.charts.HorizontalBarChart; +import com.github.mikephil.charting.components.YAxis; +import com.github.mikephil.charting.data.BarData; +import com.github.mikephil.charting.data.BarDataSet; +import com.github.mikephil.charting.data.BarEntry; + +import com.github.mikephil.charting.data.Entry; +import com.github.mikephil.charting.formatter.ValueFormatter; +import com.github.mikephil.charting.utils.ColorTemplate; +import com.github.mikephil.charting.utils.ViewPortHandler; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by iasenov on 10/5/16. + */ +public class Chart extends AppCompatActivity { + + private static String TAG = "Chart"; + + final String[] nameTestItems = {"MemSpeed", + "RandMem", + "Linaro-Libc-Bench", + "Linaro-StringBench", + "Linaro-Harness", + "Linaro-Dhrystone", + "Iozone", + "Bonnie++", + "Algorithm(ART)", + "BMsGame(ART)", + "Caffeine(ART)", + "Jit-out(ART)", + "Math(ART)", + "Micro(ART)", + "Stanford(ART)", + "DrawArc(GPU)", + "DrawCircle2(GPU)", + "DrawImage(GPU)", + "DrawRect(GPU)", + "DrawText(GPU)", + "DrawCircle(GPU)", + "Kubench(GPU)", + "Nehe08(GPU)", + "Nehe16(GPU)", + "TeapotES(GPU)"}; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + + List> groupList = new ArrayList>(); + ArrayList group = new ArrayList<>(); + ArrayList labels = new ArrayList(); + + ArrayList group_average = new ArrayList<>(); + + int index = 0; + boolean isAllNeededEntriesInitialized = false; + int repeat = 1; + + + for (int j = 0; j < nameTestItems.length; j++) { + + if (MainActivity.mapTimes.containsKey(nameTestItems[j])) { + + //Log.i(TAG,nameTestItems[j] + "--->" + MainActivity.mapTimes.get(nameTestItems[j])); + + String points[] = MainActivity.mapTimes.get(nameTestItems[j]).split(":"); + + repeat = points.length; + //Log.i(TAG, "repeatttt:" + repeat); + int sumPoints = 0; + + for(int i = 0; i < points.length; i++){ + + if(!isAllNeededEntriesInitialized) { + group = new ArrayList<>(); + groupList.add(group); + + if(i == points.length -1 ) { + groupList.add(group_average); + } + } + + + double pointD = Double.parseDouble(points[i]); + + int point = (int)(50*100/pointD); + sumPoints = sumPoints + point; + + if(isAllNeededEntriesInitialized){ + group = groupList.get(i) ; + } + + group.add(new BarEntry(point, index)); + //groupList.add(group); + } + + group_average.add(new BarEntry(sumPoints/repeat, index)); + + isAllNeededEntriesInitialized = true;//all group arrays are initialized and filled with firts results + labels.add(nameTestItems[j]); + + index++; + } + } + + + BarData data = new BarData(labels); + + for(int k = 0; k < repeat ;k++){ + ArrayList entries = groupList.get(k); + BarDataSet dataset = new BarDataSet(entries, "Points"); + dataset.setColors(ColorTemplate.COLORFUL_COLORS); + + final Echo echo = new Echo(k+1); + + dataset.setValueFormatter(new ValueFormatter() { + + @Override + public String getFormattedValue(float value, Entry entry, int i, ViewPortHandler viewPortHandler) { + return (int) value + " [" + echo.x +"]"; + } + }); + + + data.addDataSet(dataset); + + if(k == repeat-1){ //add data for average + //Log.i(TAG, "k:"+k + " repeat:"+repeat); + entries = groupList.get(k+1); + dataset = new BarDataSet(entries, "Points"); + dataset.setColor(ColorTemplate.rgb("#b6b2ae")); //set different color for average points + + if(repeat > 1) { //Show average group when repeat > 1 + dataset.setValueFormatter(new ValueFormatter() { + + @Override + public String getFormattedValue(float value, Entry entry, int i, ViewPortHandler viewPortHandler) { + return (int) value + " [avg]"; + } + }); + data.addDataSet(dataset); + } + } + + } + + + //final HorizontalBarChart chart = new HorizontalBarChart(this); + //setContentView(chart); + + setContentView(R.layout.chart); + + // Find the toolbar view inside the activity layout + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbarId); + // Sets the Toolbar to act as the ActionBar for this Activity window. + // Make sure the toolbar exists in the activity and is not null + setSupportActionBar(toolbar); + + + final HorizontalBarChart chart = (HorizontalBarChart) findViewById(R.id.chartId); + Button saveBtn = (Button) findViewById(R.id.saveButtonId); + + saveBtn.setOnClickListener(new View.OnClickListener(){ + @Override + //On click function + public void onClick(View v) { + chart.saveToGallery("Chart_" + MainActivity.autoTestFileNameIdentifier + ".jpg", 100); + Toast.makeText(v.getContext(), "Chart was saved to Gallery", + Toast.LENGTH_SHORT).show(); + } + }); + + + data.setValueTextSize(8f); + chart.setData(data); + + + + chart.setDescription("# Benchmark Results"); + + chart.setDragEnabled(true); // on by default + //chart.setVisibleXRangeMaximum(15); + //chart.setVisibleXRangeMaximum(20); + chart.animateXY(3000, 3000); + + chart.setDrawValueAboveBar(false); + chart.setTouchEnabled(false); + + + chart.getAxisLeft().setStartAtZero(true); + chart.getAxisRight().setStartAtZero(true); + + + chart.invalidate(); + + setTitle("Benchmark Chart"); + } + + public class Echo{ + int x; + + public Echo(int x){ + this.x = x; + } + } + + +//********************************************************************************************** +}//Chart +//********************************************************************************************** diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/MainActivity.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/MainActivity.java index ce191b7..1c00b44 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/MainActivity.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/MainActivity.java @@ -32,6 +32,8 @@ import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; +import android.view.WindowManager; +import android.widget.AbsListView; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.BaseAdapter; @@ -56,7 +58,9 @@ import java.math.BigInteger; import java.security.SecureRandom; import java.util.ArrayList; import java.util.Enumeration; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Properties; public class MainActivity extends AppCompatActivity implements View.OnClickListener { @@ -65,24 +69,21 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe private Button mStartButton; private Button mStartAutoButton; - private Button mSaveButton; + private Button mChartButton; private Button mInfo; private Button mShowHideDispay; - //private ListView mListView; private TextView mDisplayDetails; private static TextView mToolbarRepeatIndicator; - //public ArrayAdapter listAdapter; - ProgressDialog progressDialog; + public ProgressDialog progressDialog; private String mSelectedTest = ""; private String mSelectedClassTest = ""; - private String autoTestFileNameIdentifier = "Default"; + public static String autoTestFileNameIdentifier = "Default"; private String mTestResult = ""; private String mAllTestsResult = ""; public static String PACKAGE_NAME; private List mAllTests; private ArrayList selectedClassTests; - final String[] classNameTestItems = new String[15]; private static String KEY_REPEAT_NUMBER = "repeat-number"; private static String KEY_FILE_FORMAT = "file-format"; @@ -117,16 +118,19 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe private TaskCanceler taskCanceler; private Handler handler = new Handler(); - public static long startTotalTime = 0; - public static long endTotalTime = 0; + public static long elapsedTotalTime = 0; public static String runningTests = ""; public static int APP_UID; public static String mStep; public static String mFrom; + public static String mSelectedTxt; + public static String GRAPHICS_ELAPSED_TIME = "graphics_elapsed_time"; + public static String GRAPHICS_ROUND = "graphics_round"; + public static Map mapTimes = new HashMap(); //************************* private int count; @@ -135,16 +139,48 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe int pixMin; public GridView mListViewGrid; + + public static final Lock LOCK = new Lock(); + + final String[] classNameTestItems = {"Test1", + "Test2", + "Test3", + "Test4", + "Test5", + "Test6", + "Test7", + "Test8", + "Test9", + "Test10", + "Test11", + "Test12", + "Test13", + "Test14", + "Test15", + "Test16", + "Test17", + "Test18", + "Test19", + "Test20", + "Test21", + "Test22", + "Test23", + "Test24", + "Test25"}; + //********************************************************************************************** @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + //Prevent screen off cause this will interrupt the some of tests running in own activity(GPU tests) + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + mContext = getApplicationContext(); mActivity = this; - APP_UID = android.os.Process.myUid(); + APP_UID = android.os.Process.myUid(); PACKAGE_NAME = getApplicationContext().getPackageName(); mStartButton = (Button) findViewById(R.id.startButton); @@ -162,6 +198,9 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe // Sets the Toolbar to act as the ActionBar for this Activity window. // Make sure the toolbar exists in the activity and is not null setSupportActionBar(toolbar); + getSupportActionBar().setTitle(" Benchmark Framework"); + //getSupportActionBar().setSubtitle(" Linaro Open source benchmarks"); + getSupportActionBar().setIcon(R.drawable.lmg_logo_toolbar); mToolbarRepeatIndicator = (TextView) findViewById(R.id.toolbar_repeat_indicator); mToolbarRepeatIndicator.setText(" "+mRepeatNumber+" "); @@ -169,8 +208,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe mStartAutoButton = (Button) findViewById(R.id.startAutoButton); mStartAutoButton.setOnClickListener(this); - mSaveButton = (Button) findViewById(R.id.saveButton); - mSaveButton.setOnClickListener(this); + mChartButton = (Button) findViewById(R.id.chartButton); + mChartButton.setOnClickListener(this); mInfo = (Button) findViewById(R.id.infoButton); mInfo.setOnClickListener(this); @@ -204,6 +243,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe public boolean onLongClick(View v) { // TODO Auto-generated method stub Intent i = new Intent(mActivity, Results.class); + //Intent i = new Intent(mActivity, Chart.class); startActivity(i); return true; } @@ -215,42 +255,31 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe SAVE_DATA_PATH = getFilesDir() + "/download"; TEMP_PATH = EXECUTABLE_PATH + "/temp"; - classNameTestItems[0] = "Test1"; - classNameTestItems[1] = "Test2"; - classNameTestItems[2] = "Test3"; - classNameTestItems[3] = "Test4"; - classNameTestItems[4] = "Test5"; - classNameTestItems[5] = "Test6"; - classNameTestItems[6] = "Test7"; - classNameTestItems[7] = "Test8"; - - classNameTestItems[8] = "Test9"; - classNameTestItems[9] = "Test10"; - classNameTestItems[10] = "Test11"; - classNameTestItems[11] = "Test12"; - classNameTestItems[12] = "Test13"; - classNameTestItems[13] = "Test14"; - classNameTestItems[14] = "Test15"; - - - String[] displayNames = new String[15]; - displayNames[0] = "MemSpeed"; - displayNames[1] = "RandMem"; - displayNames[2] = "Linaro-Libc-Bench"; - displayNames[3] = "Linaro-StringBench"; - displayNames[4] = "Linaro-Harness"; - displayNames[5] = "Linaro-Dhrystone"; - displayNames[6] = "Iozone"; - displayNames[7] = "Bonnie++"; - - displayNames[8] = "Algorithm(ART)"; - displayNames[9] = "BMsGame(ART)"; - displayNames[10] = "Caffeine(ART)"; - displayNames[11] = "Jit-aot(ART)"; - displayNames[12] = "Math(ART)"; - displayNames[13] = "Micro(ART)"; - displayNames[14] = "Stanford(ART)"; - + final String[] displayNames = {"MemSpeed", + "RandMem", + "Linaro-Libc-Bench", + "Linaro-StringBench", + "Linaro-Harness", + "Linaro-Dhrystone", + "Iozone", + "Bonnie++", + "Algorithm(ART)", + "BMsGame(ART)", + "Caffeine(ART)", + "Jit-out(ART)", + "Math(ART)", + "Micro(ART)", + "Stanford(ART)", + "DrawArc(GPU)", + "DrawCircle2(GPU)", + "DrawImage(GPU)", + "DrawRect(GPU)", + "DrawText(GPU)", + "DrawCircle(GPU)", + "Kubench(GPU)", + "Nehe08(GPU)", + "Nehe16(GPU)", + "TeapotES(GPU)"}; //*******************GridView******************* @@ -265,9 +294,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe IS_SHELL_CONTROL = false; //Check if shell control is used for tests - //This fix issue with NullPointer on mListViewGrid(invoke isShellControl() when mListViewGrid layout is already inflate) - mListViewGrid.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @SuppressLint("NewApi") @Override @@ -293,6 +320,45 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe // put your code here... } + + //********************************************************************************************** + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + switch(requestCode) { + case (100) : { + if (resultCode == Activity.RESULT_OK) { + // TODO Extract the data returned from the child Activity. + BaseBenchmark.elapsedFromActivityTest = data.getLongExtra(MainActivity. GRAPHICS_ELAPSED_TIME,0); + BaseBenchmark.mRound = data.getIntExtra(MainActivity.GRAPHICS_ROUND,0); + Log.i(TAG,"elapsed from activity test:" + BaseBenchmark.elapsedFromActivityTest); + synchronized (MainActivity.LOCK) { + MainActivity.LOCK.setCondition(true); + MainActivity.LOCK.notifyAll(); + } + + } + if (resultCode == Activity.RESULT_CANCELED) { + Log.i(TAG,"RESULT_CANCELED"); + + //Need to set isCanceled flag here + isCanceled = true; + + //Simulate click on calcel button + progressDialog.show(); + progressDialog.getButton(DialogInterface.BUTTON_NEGATIVE).performClick(); + + synchronized (MainActivity.LOCK) { + MainActivity.LOCK.setCondition(true); + MainActivity.LOCK.notifyAll(); + } + + } + break; + } + } + } + //********************************************************************************************** //Load benchmarks libraries when benchmark test is integrated as (*.so) //********************************************************************************************** @@ -310,7 +376,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe @Override public void onClick(View v) { - Log.i(TAG,"numberOfCheckedTests: " + numberOfCheckedTests); + Log.i(TAG, "numberOfCheckedTests: " + numberOfCheckedTests); if (v.getId() == R.id.startButton && numberOfCheckedTests > 0) { isAuto = false; @@ -328,10 +394,12 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe } else if (v.getId() == R.id.startButton && numberOfCheckedTests == 0) { Toast.makeText(v.getContext(), "Please select test...", Toast.LENGTH_SHORT).show(); - } else if (v.getId() == R.id.saveButton && testDone == 1) { - saveUIResultToFile(); - } else if (v.getId() == R.id.saveButton && testDone == 0) { - Toast.makeText(v.getContext(), "No results for save", + } else if (v.getId() == R.id.chartButton && testDone == 1) { + //saveUIResultToFile(); + Intent i = new Intent(mActivity, Chart.class); + startActivity(i); + } else if (v.getId() == R.id.chartButton && testDone == 0) { + Toast.makeText(v.getContext(), "No charts to show", Toast.LENGTH_SHORT).show(); } else if (v.getId() == R.id.startAutoButton) { isAuto = true; @@ -341,7 +409,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe } else if (v.getId() == R.id.infoButton) { String info = "[RUN TEST]: Run selected tests

" + "[RUN AUTO]: Run all tests in row and save results to file automatically

" + - "[SAVE]: Save result shown on UI (display)

" + + "[CHART]: Create chart for executed tests

" + "[Settings]:
- Allow to control tests repeatability" + "

- Clear Data" + "

- File format"+ @@ -543,12 +611,16 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe public void runTests(int timesToRun) { nextTestIndex = 0; allTestsCount = 0; + elapsedTotalTime = 0; mAllTests = new ArrayList(); selectedClassTests = new ArrayList(); mAllTestsResult = ""; selectedClassTests.clear(); mAllTests.clear(); + //Clear chart data + mapTimes.clear(); + //HTML BEGIN //Clear html string if(fileFormatFromSettings.equals("html")) { @@ -557,9 +629,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe //HTML END - //Get total start time from here - startTotalTime = System.currentTimeMillis(); - //Clear summary string runningTests = ""; //reset cancel flag @@ -895,8 +964,6 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe } - - //********************************************************************************************** //Run tests in shell control //********************************************************************************************** @@ -939,18 +1006,13 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe int mActivePosition = 0; - + //Do not need to remove checks in shell mode so commented!!! + /* for (String className : classNameTestItems) { - for (String selected : testsFromShell) { - if (className.equals(selected)) { - //Click on the current test - mGridViewAdapter.removeCheckAtPosition(mActivePosition, mListViewGrid); - } - - } + mGridViewAdapter.removeCheckAtPosition(mActivePosition, mListViewGrid); mActivePosition++; } - + */ mActivePosition = 0; @@ -960,7 +1022,8 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe for (String selected : testsFromShell) { if (className.equals(selected)) { //Click on the current test - mGridViewAdapter.performItemClick(mActivePosition,mListViewGrid); + testselection[mActivePosition] = true; + //mGridViewAdapter.performItemClick(mActivePosition, mListViewGrid); } } @@ -1128,9 +1191,16 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe @Override protected String doInBackground(String... params) { + //Log.i(TAG,"isCanceled " + isCanceled); + + //if tests are canceled just return + if(isCanceled) return ""; + + //In BaseBenchmark clear() method will try "STEP_FROM" replacement again to be sure it will be done on one of both replace places mStep = Integer.toString(stepN); mFrom = Integer.toString(repeatN); + mSelectedTxt = selectedTest; publishProgress(selectedTest, selectedClassTest, Integer.toString(stepN), Integer.toString(repeatN)); @@ -1154,7 +1224,23 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe } catch (Exception e) { e.printStackTrace(); resp = e.getMessage(); + //Get what we can from the output + if(fileFormatFromSettings.equals("html")) { + HtmlUtil.addTemplateExecute(); + HtmlUtil.replaceHtmlTag("EXECUTE", ""); + HtmlUtil.addTemplateParagraph(); + HtmlUtil.replaceHtmlTag("BODY", Interceptor.outputTxt); + Interceptor.clear(); + HtmlUtil.addTemplateEnd(); + } + + mTestResult = Interceptor.outputTxt; + mAllTestsResult = mAllTestsResult + "\n\n" + mTestResult; + + //Let's call GC + System.gc(); } + return selectedClassTest; } @@ -1188,21 +1274,21 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe if (result.equals(endTest) && endTestCounter == 0 && !isCanceled) { //if last one is finished and counter is 0 and is not Canceled - //Get total end time from here - endTotalTime = System.currentTimeMillis(); - double totalTime = (double) (endTotalTime - startTotalTime) / 1000; - + //Get total time at the end + double totalTime = (double) (elapsedTotalTime) / 1000; //Inform shell that tests are done writeToSocketFile("isFinished", "1"); //Set some info to shell about test status...where results are saved - writeToSocketFile("info", "Save result to: " + autoTestFile.getAbsolutePath()); + if(autoTestFile!=null) { + writeToSocketFile("info", "Save result to: " + autoTestFile.getAbsolutePath()); + } displayResult(mAllTestsResult);//UI display if(fileFormatFromSettings.equals("html")){ HtmlUtil.addTemplateSummary(); - HtmlUtil.replaceHtmlTag("TOTAL_TIME", String.format("%5.1f", totalTime) + " seconds"); + HtmlUtil.replaceHtmlTag("TOTAL_TIME", String.format("%5.4f", totalTime) + " seconds"); if(!IS_SHELL_CONTROL) { HtmlUtil.replaceHtmlTag("REPEAT", mRepeatNumber + " time(s)"); }else{ @@ -1224,7 +1310,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe //Decrement numberOfCheckedTests(need that because test is auto checked previously) if(isAuto){ - numberOfCheckedTests = 0; + //numberOfCheckedTests = 0; } Log.i(TAG, "selectedTest:" + selectedTest); @@ -1319,20 +1405,25 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe } }); - progressDialog.show(); + + String testNumber = selectedClassTest.replace("Test", ""); + if(!(Integer.parseInt(testNumber) >=16 && Integer.parseInt(testNumber) <=25)) { + progressDialog.show(); + } if (isAuto) { int mActivePosition = 0; - - //Do remove checks here + //Do remove all checks here for (String className : classNameTestItems) { - if (className.equals(text[1])) { - //Click on the current test - mGridViewAdapter.removeCheckAtPosition(mActivePosition, mListViewGrid); - } + //mGridViewAdapter.removeCheckAtPosition(mActivePosition, mListViewGrid); + + if(testselection[mActivePosition] == true){ + testselection[mActivePosition] = false; + numberOfCheckedTests--; + } mActivePosition++; } @@ -1344,7 +1435,9 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe for (String className : classNameTestItems) { if (className.equals(text[1])) { //Click on the current test - mGridViewAdapter.performItemClick(mActivePosition,mListViewGrid); + testselection[mActivePosition] = true; + numberOfCheckedTests++; + //mGridViewAdapter.performItemClick(mActivePosition,mListViewGrid); } mActivePosition++; @@ -1389,21 +1482,21 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe public View getView(int position, View convertView, ViewGroup parent) { + //Log.i(TAG,"getView_position:" +position); + ViewHolder holder; if (convertView == null) { + //Log.i(TAG,"getView_position_null:" +position); holder = new ViewHolder(); convertView = mInflater.inflate( R.layout.listview, null); holder.textview = (TextView) convertView.findViewById(R.id.itemText); holder.checkbox = (CheckBox) convertView.findViewById(R.id.itemCheckBox); - //holder.textview.setText(testsList[position]); - //holder.textview.setTextSize(getPixels(pixMin)); - convertView.setTag(holder); - //convertView.setBackgroundResource(R.drawable.grid_items_border); } else { + //Log.i(TAG,"getView_position_not_null:" +position); holder = (ViewHolder) convertView.getTag(); } holder.checkbox.setId(position); @@ -1441,12 +1534,16 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe public void removeCheckAtPosition(int i, GridView gr) { - //for(int i = 0; i < getCount(); i++) { + //It is needed to check the max index used in getView method(because max index can be smaller than count of gridview elements) + //So catch is used to prevent from crash when i is greater than max index used in getView + try { + //Log.i(TAG, "position:" + i); + ViewGroup gridChild = (ViewGroup) gr.getChildAt(i); int childSize = gridChild.getChildCount(); - for(int k = 0; k < childSize; k++) { - if( gridChild.getChildAt(k) instanceof CheckBox ) { - CheckBox cb = (CheckBox)gridChild.getChildAt(k); + for (int k = 0; k < childSize; k++) { + if (gridChild.getChildAt(k) instanceof CheckBox) { + CheckBox cb = (CheckBox) gridChild.getChildAt(k); //Log.i(TAG,""+i); if (testselection[i]) { cb.setChecked(false); @@ -1457,7 +1554,9 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe } } - //} + }catch(Exception e){ + Log.i(TAG, "(Expected error):removeCheckAtPosition:" + e.toString()); + } } @@ -1487,6 +1586,18 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe }//ViewHolder //********************************************************************************************** + //Use object of this class for synchronization + public static class Lock { + private boolean condition; + + public boolean conditionMet() { + return condition; + } + + public void setCondition(boolean condition) { + this.condition = condition; + } + } //********************************************************************************************** }//MainActivity diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test1.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test1.java index 34e4146..552bd8a 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test1.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test1.java @@ -20,6 +20,7 @@ public class Test1 extends BaseBenchmark{ version = " Android MemSpeed Benchmark 1.1"; benchmarkName = "Test1"; integrationType = "SL"; + chartName = "MemSpeed"; clear(); @@ -39,6 +40,10 @@ public class Test1 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(-1, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test10.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test10.java index 9bf754f..ad50ca6 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test10.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test10.java @@ -36,6 +36,7 @@ public class Test10 extends BaseBenchmark{ version = " BMsGame "; benchmarkName = "Test10"; integrationType = "SL"; + chartName = "BMsGame(ART)"; long before; long after; @@ -321,6 +322,10 @@ public class Test10 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test11.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test11.java index 0c4a015..8159645 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test11.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test11.java @@ -26,6 +26,7 @@ public class Test11 extends BaseBenchmark{ version = " Caffeine(ART) "; benchmarkName = "Test11"; integrationType = "SL"; + chartName = "Caffeine(ART)"; long before; long after; @@ -155,6 +156,10 @@ public class Test11 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test12.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test12.java index 983bf53..3d5ddc3 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test12.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test12.java @@ -22,6 +22,7 @@ public class Test12 extends BaseBenchmark{ version = " Jit-out "; benchmarkName = "Test12"; integrationType = "SL"; + chartName = "Jit-out(ART)"; long before; long after; @@ -48,10 +49,13 @@ public class Test12 extends BaseBenchmark{ Invoke obj = new Invoke(); before = System.currentTimeMillis(); + obj.timeRecursionInvokeVirtual(1000); obj.timeRecursionInvokeStatic(1000); obj.timeRecursionInvokeFinal(1000); obj.timeRecursionInvokePrivate(1000); + + after = System.currentTimeMillis(); if (!obj.verify()) { rc++; @@ -86,6 +90,10 @@ public class Test12 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test13.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test13.java index 660b99f..87b7fa6 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test13.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test13.java @@ -24,6 +24,7 @@ public class Test13 extends BaseBenchmark{ version = " Math(ART) "; benchmarkName = "Test13"; integrationType = "SL"; + chartName = "Math(ART)"; long before; long after; @@ -91,6 +92,10 @@ public class Test13 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test14.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test14.java index 3693a56..9834163 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test14.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test14.java @@ -37,6 +37,7 @@ public class Test14 extends BaseBenchmark{ version = " Micro(ART) "; benchmarkName = "Test14"; integrationType = "SL"; + chartName = "Micro(ART)"; long before; long after; @@ -630,6 +631,10 @@ public class Test14 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test15.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test15.java index d9475ef..6ebc1df 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test15.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test15.java @@ -41,6 +41,7 @@ public class Test15 extends BaseBenchmark{ version = " Stanford(ART) "; benchmarkName = "Test15"; integrationType = "SL"; + chartName = "Stanford(ART)"; long before; long after; @@ -268,6 +269,10 @@ public class Test15 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test16.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test16.java new file mode 100644 index 0000000..07a88bd --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test16.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.graphics.DrawArc; + + +/** + * Created by iasenov on 10/10/16. + */ +public class Test16 extends BaseBenchmark{ + + private String TAG = "DrawArc(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " DrawArc(GPU) "; + benchmarkName = "Test16"; + integrationType = "SL"; + chartName = "DrawArc(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, DrawArc.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 500); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test17.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test17.java new file mode 100644 index 0000000..4b2e242 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test17.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.graphics.DrawArc; +import graphics_benchmarks.graphics.DrawCircle2; + +/** + * Created by iasenov on 10/10/16. + */ +public class Test17 extends BaseBenchmark{ + + private String TAG = "DrawCircle2(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " DrawCircle2(GPU) "; + benchmarkName = "Test17"; + integrationType = "SL"; + chartName = "DrawCircle2(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, DrawCircle2.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 300); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test18.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test18.java new file mode 100644 index 0000000..10a0893 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test18.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.graphics.DrawCircle2; +import graphics_benchmarks.graphics.DrawImage; + +/** + * Created by iasenov on 10/10/16. + */ +public class Test18 extends BaseBenchmark{ + + private String TAG = "DrawImage(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " DrawImage(GPU) "; + benchmarkName = "Test18"; + integrationType = "SL"; + chartName = "DrawImage(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, DrawImage.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 500); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test19.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test19.java new file mode 100644 index 0000000..6ec7f17 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test19.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.graphics.DrawImage; +import graphics_benchmarks.graphics.DrawRect; + +/** + * Created by iasenov on 10/10/16. + */ +public class Test19 extends BaseBenchmark{ + + private String TAG = "DrawRect(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " DrawRect(GPU) "; + benchmarkName = "Test19"; + integrationType = "SL"; + chartName = "DrawRect(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, DrawRect.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 300); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test2.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test2.java index 53ec02b..b9044bb 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test2.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test2.java @@ -22,6 +22,7 @@ public class Test2 extends BaseBenchmark{ version = " Android RandMem Benchmark 1.1 "; benchmarkName = "Test2"; integrationType = "SL"; + chartName = "RandMem"; clear(); @@ -42,6 +43,10 @@ public class Test2 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(-1, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test20.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test20.java new file mode 100644 index 0000000..9bf9479 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test20.java @@ -0,0 +1,70 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.graphics.DrawRect; +import graphics_benchmarks.graphics.DrawText; + +/** + * Created by iasenov on 10/10/16. + */ +public class Test20 extends BaseBenchmark{ + + private String TAG = "DrawText(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " DrawText(GPU) "; + benchmarkName = "Test20"; + integrationType = "SL"; + chartName = "DrawText(GPU)"; + + + clear(); + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, DrawText.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 300); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test21.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test21.java new file mode 100644 index 0000000..5fd5120 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test21.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.graphics.DrawCircle; +import graphics_benchmarks.graphics.DrawCircle2; + +/** + * Created by iasenov on 10/11/16. + */ +public class Test21 extends BaseBenchmark{ + + private String TAG = "DrawCircle(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " DrawCircle(GPU) "; + benchmarkName = "Test21"; + integrationType = "SL"; + chartName = "DrawCircle(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, DrawCircle.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 300); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test22.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test22.java new file mode 100644 index 0000000..72b1a75 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test22.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.graphics.DrawCircle; +import graphics_benchmarks.kubench.Kubench; + +/** + * Created by iasenov on 10/11/16. + */ +public class Test22 extends BaseBenchmark{ + + private String TAG = "Kubench(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " Kubench(GPU) "; + benchmarkName = "Test22"; + integrationType = "SL"; + chartName = "Kubench(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, Kubench.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 1000); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test23.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test23.java new file mode 100644 index 0000000..c5866ff --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test23.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.kubench.Kubench; +import graphics_benchmarks.lesson08.RunNehe08; + +/** + * Created by iasenov on 10/11/16. + */ +public class Test23 extends BaseBenchmark{ + + private String TAG = "Nehe08(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " Nehe08(GPU) "; + benchmarkName = "Test23"; + integrationType = "SL"; + chartName = "Nehe08(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, RunNehe08.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 1000); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test24.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test24.java new file mode 100644 index 0000000..9db1f87 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test24.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.lesson08.RunNehe08; +import graphics_benchmarks.lesson16.RunNehe16; + +/** + * Created by iasenov on 10/11/16. + */ +public class Test24 extends BaseBenchmark{ + + private String TAG = "Nehe16(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " Nehe16(GPU) "; + benchmarkName = "Test24"; + integrationType = "SL"; + chartName = "Nehe16(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, RunNehe16.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 1000); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test25.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test25.java new file mode 100644 index 0000000..d24c803 --- /dev/null +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test25.java @@ -0,0 +1,72 @@ +package org.linaro.iasenov.benchmarkframework; + +import android.content.Intent; +import android.util.Log; + +import graphics_benchmarks.lesson16.RunNehe16; +import graphics_benchmarks.teapot.TeapotES; + +/** + * Created by iasenov on 10/11/16. + */ +public class Test25 extends BaseBenchmark{ + + private String TAG = "TeapotES(GPU)"; + static boolean isJavaCanceled = false; + + public String startBenchmark(int count) { + + isJavaCanceled = false; + + version = " TeapotES(GPU) "; + benchmarkName = "Test25"; + integrationType = "SL"; + chartName = "TeapotES(GPU)"; + + + clear(); + + + startTest = 0;//System.currentTimeMillis(); + + MainActivity.LOCK.setCondition(false); + + Intent i = new Intent(MainActivity.mActivity, TeapotES.class); + i.putExtra(MainActivity.GRAPHICS_ROUND, 1000); + MainActivity.mActivity.startActivityForResult(i, 100); + + synchronized (MainActivity.LOCK) { + while (!MainActivity.LOCK.conditionMet()) { + try { + MainActivity.LOCK.wait(); + Log.i(TAG, "waiting is finished"); + } catch (InterruptedException e) { + Log.e(TAG, "Exception when waiting for condition", e); + } + } + } + + + float second = (elapsedFromActivityTest / 1000f); + float fps = (float) mRound / second; // milliseconds to seconds + + xout[2] = "Round = " + mRound +" fps = " + fps + "\n" + Interceptor.outputTxt; + Interceptor.clear(); + + endTest = elapsedFromActivityTest;//System.currentTimeMillis(); + + sendElapsedTimeToChart(); + + submitElapsedTime(endTest - startTest); + + //Log.i(TAG, "return"); + + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); + } + + public boolean stopBenchmark(){ + isJavaCanceled = true; + Log.i(TAG, "stopBenchmark: isJavaCanceled"); + return true; + } +} diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test3.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test3.java index c5b38c2..a488db5 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test3.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test3.java @@ -17,6 +17,7 @@ public class Test3 extends BaseBenchmark{ benchmarkName = "Test3"; executable_name = "cbench"; integrationType = "EX"; + chartName = "Linaro-Libc-Bench"; @@ -32,6 +33,10 @@ public class Test3 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test4.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test4.java index 39ba0d5..af46e7b 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test4.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test4.java @@ -14,6 +14,7 @@ public class Test4 extends BaseBenchmark{ benchmarkName = "Test4"; executable_name = "stringbench"; integrationType = "EX"; + chartName = "Linaro-StringBench"; clear(); @@ -27,6 +28,10 @@ public class Test4 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test5.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test5.java index a28ba74..9c285cc 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test5.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test5.java @@ -15,6 +15,7 @@ public class Test5 extends BaseBenchmark{ benchmarkName = "Test5"; executable_name = "harness"; integrationType = "EX"; + chartName = "Linaro-Harness"; clear(); @@ -27,6 +28,10 @@ public class Test5 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test6.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test6.java index db990cf..e897bbc 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test6.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test6.java @@ -15,6 +15,7 @@ public class Test6 extends BaseBenchmark{ benchmarkName = "Test6"; executable_name = "dhry"; integrationType = "EX"; + chartName = "Linaro-Dhrystone"; clear(); @@ -26,6 +27,10 @@ public class Test6 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test7.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test7.java index 6bfb515..8c7715f 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test7.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test7.java @@ -17,6 +17,7 @@ public class Test7 extends BaseBenchmark { benchmarkName = "Test7"; executable_name = "iozone"; integrationType = "EX"; + chartName = "Iozone"; clear(); @@ -29,6 +30,10 @@ public class Test7 extends BaseBenchmark { endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test8.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test8.java index 6938826..c02f045 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test8.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test8.java @@ -14,6 +14,7 @@ public class Test8 extends BaseBenchmark { benchmarkName = "Test8"; executable_name = "bonnie"; integrationType = "EX"; + chartName = "Bonnie++"; clear(); @@ -26,6 +27,10 @@ public class Test8 extends BaseBenchmark { endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test9.java b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test9.java index f0a885d..51f0531 100644 --- a/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test9.java +++ b/BenchmarkFramework/app/src/main/java/org/linaro/iasenov/benchmarkframework/Test9.java @@ -30,6 +30,7 @@ public class Test9 extends BaseBenchmark{ version = " Algorithm "; benchmarkName = "Test9"; integrationType = "SL"; + chartName = "Algorithm(ART)"; long before; long after; @@ -254,6 +255,10 @@ public class Test9 extends BaseBenchmark{ endTest = System.currentTimeMillis(); + sendElapsedTimeToChart(); + + submitElapsedTime(endTest-startTest); + return benchmarkName + ":" + getBenchmarkResult(5, integrationType); } diff --git a/BenchmarkFramework/app/src/main/res/drawable/buttonshape_chart.xml b/BenchmarkFramework/app/src/main/res/drawable/buttonshape_chart.xml new file mode 100644 index 0000000..0a50f16 --- /dev/null +++ b/BenchmarkFramework/app/src/main/res/drawable/buttonshape_chart.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/BenchmarkFramework/app/src/main/res/drawable/crate.bmp b/BenchmarkFramework/app/src/main/res/drawable/crate.bmp new file mode 100644 index 0000000..73fe985 Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/drawable/crate.bmp differ diff --git a/BenchmarkFramework/app/src/main/res/drawable/glass.bmp b/BenchmarkFramework/app/src/main/res/drawable/glass.bmp new file mode 100644 index 0000000..1acf064 Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/drawable/glass.bmp differ diff --git a/BenchmarkFramework/app/src/main/res/drawable/icon.png b/BenchmarkFramework/app/src/main/res/drawable/icon.png new file mode 100644 index 0000000..1f34e32 Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/drawable/icon.png differ diff --git a/BenchmarkFramework/app/src/main/res/drawable/information.png b/BenchmarkFramework/app/src/main/res/drawable/information.png index 5507135..b800a90 100644 Binary files a/BenchmarkFramework/app/src/main/res/drawable/information.png and b/BenchmarkFramework/app/src/main/res/drawable/information.png differ diff --git a/BenchmarkFramework/app/src/main/res/drawable/lmg_logo.png b/BenchmarkFramework/app/src/main/res/drawable/lmg_logo.png new file mode 100644 index 0000000..96d939d Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/drawable/lmg_logo.png differ diff --git a/BenchmarkFramework/app/src/main/res/drawable/lmg_logo_toolbar.png b/BenchmarkFramework/app/src/main/res/drawable/lmg_logo_toolbar.png new file mode 100644 index 0000000..54a171d Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/drawable/lmg_logo_toolbar.png differ diff --git a/BenchmarkFramework/app/src/main/res/layout/activity_main.xml b/BenchmarkFramework/app/src/main/res/layout/activity_main.xml index 239e22a..d5b2b96 100644 --- a/BenchmarkFramework/app/src/main/res/layout/activity_main.xml +++ b/BenchmarkFramework/app/src/main/res/layout/activity_main.xml @@ -68,9 +68,9 @@ android:background="@drawable/buttonshape"> + + + + + + + diff --git a/BenchmarkFramework/app/src/main/res/layout/circle2.xml b/BenchmarkFramework/app/src/main/res/layout/circle2.xml new file mode 100644 index 0000000..b587869 --- /dev/null +++ b/BenchmarkFramework/app/src/main/res/layout/circle2.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/BenchmarkFramework/app/src/main/res/layout/image.xml b/BenchmarkFramework/app/src/main/res/layout/image.xml new file mode 100644 index 0000000..249b8df --- /dev/null +++ b/BenchmarkFramework/app/src/main/res/layout/image.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/BenchmarkFramework/app/src/main/res/layout/listview.xml b/BenchmarkFramework/app/src/main/res/layout/listview.xml index f6ca2c0..d1cd115 100644 --- a/BenchmarkFramework/app/src/main/res/layout/listview.xml +++ b/BenchmarkFramework/app/src/main/res/layout/listview.xml @@ -9,7 +9,5 @@ android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_toRightOf="@id/itemText" android:layout_alignParentBottom="true" - android:buttonTint="#3366CC" - android:scaleX="0.90" - android:scaleY="0.90"/> + android:buttonTint="#3366CC"/> \ No newline at end of file diff --git a/BenchmarkFramework/app/src/main/res/layout/rect.xml b/BenchmarkFramework/app/src/main/res/layout/rect.xml new file mode 100644 index 0000000..34e58d8 --- /dev/null +++ b/BenchmarkFramework/app/src/main/res/layout/rect.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/BenchmarkFramework/app/src/main/res/layout/text.xml b/BenchmarkFramework/app/src/main/res/layout/text.xml new file mode 100644 index 0000000..f41ec76 --- /dev/null +++ b/BenchmarkFramework/app/src/main/res/layout/text.xml @@ -0,0 +1,12 @@ + + + + + + + diff --git a/BenchmarkFramework/app/src/main/res/mipmap-hdpi/lmg_logo.png b/BenchmarkFramework/app/src/main/res/mipmap-hdpi/lmg_logo.png new file mode 100644 index 0000000..96d939d Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/mipmap-hdpi/lmg_logo.png differ diff --git a/BenchmarkFramework/app/src/main/res/mipmap-mdpi/lmg_logo.png b/BenchmarkFramework/app/src/main/res/mipmap-mdpi/lmg_logo.png new file mode 100644 index 0000000..96d939d Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/mipmap-mdpi/lmg_logo.png differ diff --git a/BenchmarkFramework/app/src/main/res/mipmap-xhdpi/lmg_logo.png b/BenchmarkFramework/app/src/main/res/mipmap-xhdpi/lmg_logo.png new file mode 100644 index 0000000..96d939d Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/mipmap-xhdpi/lmg_logo.png differ diff --git a/BenchmarkFramework/app/src/main/res/mipmap-xxhdpi/lmg_logo.png b/BenchmarkFramework/app/src/main/res/mipmap-xxhdpi/lmg_logo.png new file mode 100644 index 0000000..96d939d Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/mipmap-xxhdpi/lmg_logo.png differ diff --git a/BenchmarkFramework/app/src/main/res/mipmap-xxxhdpi/lmg_logo.png b/BenchmarkFramework/app/src/main/res/mipmap-xxxhdpi/lmg_logo.png new file mode 100644 index 0000000..96d939d Binary files /dev/null and b/BenchmarkFramework/app/src/main/res/mipmap-xxxhdpi/lmg_logo.png differ diff --git a/BenchmarkFramework/app/src/main/res/values/styles.xml b/BenchmarkFramework/app/src/main/res/values/styles.xml index d424e6a..f8aa49d 100644 --- a/BenchmarkFramework/app/src/main/res/values/styles.xml +++ b/BenchmarkFramework/app/src/main/res/values/styles.xml @@ -1,7 +1,7 @@ -