aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar Leon Scroggins III <scroggo@google.com>2017-01-26 17:21:27 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-27 20:02:23 +0000
commit6ccd2cabaac810edccab620d8a944f64b0432d44 (patch)
treee25c0c088be285e6b990a5824c016c5a986cac70 /bench
parent91af72703830f3946c538b47c6c7c96afc0adde2 (diff)
Generate Android build targets for dm and nanobench
Generate targets for dm and nanobench from ninja and add them to the generated Android.bp file. Remove nanobenchAndroid and SkAndroidSDKCanvas. These rely on HWUI internals and are currently unused. Update gyp file references to removed files, just in case. Change-Id: Ic6ae18a70bfd0c33804e7996d077f2081dfdfe07 Reviewed-on: https://skia-review.googlesource.com/7635 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'bench')
-rw-r--r--bench/ColorCubeBench.cpp8
-rw-r--r--bench/nanobench.cpp18
-rw-r--r--bench/nanobenchAndroid.cpp51
-rw-r--r--bench/nanobenchAndroid.h32
4 files changed, 0 insertions, 109 deletions
diff --git a/bench/ColorCubeBench.cpp b/bench/ColorCubeBench.cpp
deleted file mode 100644
index e34d971c3f..0000000000
--- a/bench/ColorCubeBench.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright 2017 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-// Temporary. When gn_to_bp.py works for nanobench, we can remove this.
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 6aea7b5fbb..887fab3bad 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -53,10 +53,6 @@
#include <unistd.h>
#endif
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
- #include "nanobenchAndroid.h"
-#endif
-
#if SK_SUPPORT_GPU
#include "gl/GrGLDefines.h"
#include "GrCaps.h"
@@ -468,15 +464,6 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c
}
#undef CPU_CONFIG
-
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
- if (config->getTag().equals("hwui")) {
- Config config = { SkString("hwui"), Benchmark::kHWUI_Backend,
- kRGBA_8888_SkColorType, kPremul_SkAlphaType, nullptr,
- 0, kBogusContextType, kBogusContextOptions, false };
- configs->push_back(config);
- }
-#endif
}
// Append all configs that are enabled and supported.
@@ -511,11 +498,6 @@ static Target* is_enabled(Benchmark* bench, const Config& config) {
target = new GPUTarget(config);
break;
#endif
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
- case Benchmark::kHWUI_Backend:
- target = new HWUITarget(config, bench);
- break;
-#endif
default:
target = new Target(config);
break;
diff --git a/bench/nanobenchAndroid.cpp b/bench/nanobenchAndroid.cpp
deleted file mode 100644
index cb6f09d654..0000000000
--- a/bench/nanobenchAndroid.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "nanobenchAndroid.h"
-
-/* These functions are only compiled in the Android Framework. */
-
-HWUITarget::HWUITarget(const Config& c, Benchmark* bench) : Target(c) { }
-
-void HWUITarget::setup() {
- this->renderer.fence();
-}
-
-SkCanvas* HWUITarget::beginTiming(SkCanvas* canvas) {
- SkCanvas* targetCanvas = this->renderer.prepareToDraw();
- if (targetCanvas) {
- this->fc.reset(targetCanvas);
- canvas = &this->fc;
- // This might minimally distort timing, but canvas isn't valid outside the timer.
- canvas->clear(SK_ColorWHITE);
- }
-
- return canvas;
-}
-
-void HWUITarget::endTiming() {
- this->renderer.finishDrawing();
-}
-
-void HWUITarget::fence() {
- this->renderer.fence();
-}
-
-bool HWUITarget::needsFrameTiming(int* frameLag) const {
- extern int FLAGS_gpuFrameLag;
- *frameLag = FLAGS_gpuFrameLag;
- return true;
-}
-
-bool HWUITarget::init(SkImageInfo info, Benchmark* bench) {
- this->renderer.initialize(bench->getSize().x(), bench->getSize().y());
- return true;
-}
-
-bool HWUITarget::capturePixels(SkBitmap* bmp) {
- return this->renderer.capturePixels(bmp);
-}
diff --git a/bench/nanobenchAndroid.h b/bench/nanobenchAndroid.h
deleted file mode 100644
index ef28751aca..0000000000
--- a/bench/nanobenchAndroid.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef nanobenchAndroid_DEFINED
-#define nanobenchAndroid_DEFINED
-
-#include "SkAndroidSDKCanvas.h"
-#include <utils/TestWindowContext.h>
-
-#include "nanobench.h"
-
-struct HWUITarget : public Target {
- explicit HWUITarget(const Config& c, Benchmark* bench);
-
- android::uirenderer::TestWindowContext renderer;
- SkAndroidSDKCanvas fc;
-
- void setup() override;
- SkCanvas* beginTiming(SkCanvas* canvas) override;
- void endTiming() override;
- void fence() override;
- bool needsFrameTiming(int* frameLag) const override;
-
- bool init(SkImageInfo info, Benchmark* bench) override;
- bool capturePixels(SkBitmap* bmp) override;
-};
-
-#endif // nanobenchAndroid_DEFINED