Commit 545f1c28 authored by jbates@chromium.org's avatar jbates@chromium.org

Add threaded-compositor test mode to throughput_tests

BUG=138880

Review URL: https://chromiumcodereview.appspot.com/10823007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148415 0039d316-1c4b-4281-b951-d872f2087c98
parent 33cd6997
...@@ -54,7 +54,8 @@ enum RunTestFlags { ...@@ -54,7 +54,8 @@ enum RunTestFlags {
enum ThroughputTestFlags { enum ThroughputTestFlags {
kSW = 0, kSW = 0,
kGPU = 1 << 0 kGPU = 1 << 0,
kCompositorThread = 1 << 1
}; };
const int kSpinUpTimeMs = 4 * 1000; const int kSpinUpTimeMs = 4 * 1000;
...@@ -63,8 +64,9 @@ const int kIgnoreSomeFrames = 3; ...@@ -63,8 +64,9 @@ const int kIgnoreSomeFrames = 3;
class ThroughputTest : public BrowserPerfTest { class ThroughputTest : public BrowserPerfTest {
public: public:
explicit ThroughputTest(ThroughputTestFlags flags) : explicit ThroughputTest(int flags) :
use_gpu_(flags & kGPU), use_gpu_(flags & kGPU),
use_compositor_thread_(flags & kCompositorThread),
spinup_time_ms_(kSpinUpTimeMs), spinup_time_ms_(kSpinUpTimeMs),
run_time_ms_(kRunTimeMs) {} run_time_ms_(kRunTimeMs) {}
...@@ -195,6 +197,12 @@ class ThroughputTest : public BrowserPerfTest { ...@@ -195,6 +197,12 @@ class ThroughputTest : public BrowserPerfTest {
command_line->AppendSwitch(switches::kDisableExperimentalWebGL); command_line->AppendSwitch(switches::kDisableExperimentalWebGL);
command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas);
} }
if (use_compositor_thread_) {
ASSERT_TRUE(use_gpu_);
command_line->AppendSwitch(switches::kEnableThreadedCompositing);
} else {
command_line->AppendSwitch(switches::kDisableThreadedCompositing);
}
} }
void Wait(int ms) { void Wait(int ms) {
...@@ -368,7 +376,8 @@ class ThroughputTest : public BrowserPerfTest { ...@@ -368,7 +376,8 @@ class ThroughputTest : public BrowserPerfTest {
// Print perf results. // Print perf results.
double mean_ms = stats.mean_us / 1000.0; double mean_ms = stats.mean_us / 1000.0;
double std_dev_ms = stats.standard_deviation_us / 1000.0 / 1000.0; double std_dev_ms = stats.standard_deviation_us / 1000.0 / 1000.0;
std::string trace_name = ran_on_gpu ? "gpu" : "software"; std::string trace_name = use_compositor_thread_? "gpu_thread" :
ran_on_gpu ? "gpu" : "software";
std::string mean_and_error = base::StringPrintf("%f,%f", mean_ms, std::string mean_and_error = base::StringPrintf("%f,%f", mean_ms,
std_dev_ms); std_dev_ms);
perf_test::PrintResultMeanAndError(test_name, "", trace_name, perf_test::PrintResultMeanAndError(test_name, "", trace_name,
...@@ -426,6 +435,7 @@ class ThroughputTest : public BrowserPerfTest { ...@@ -426,6 +435,7 @@ class ThroughputTest : public BrowserPerfTest {
}; };
bool use_gpu_; bool use_gpu_;
bool use_compositor_thread_;
int spinup_time_ms_; int spinup_time_ms_;
int run_time_ms_; int run_time_ms_;
FilePath local_cache_path_; FilePath local_cache_path_;
...@@ -440,6 +450,12 @@ class ThroughputTestGPU : public ThroughputTest { ...@@ -440,6 +450,12 @@ class ThroughputTestGPU : public ThroughputTest {
ThroughputTestGPU() : ThroughputTest(kGPU) {} ThroughputTestGPU() : ThroughputTest(kGPU) {}
}; };
// For running tests on GPU with the compositor thread:
class ThroughputTestThread : public ThroughputTest {
public:
ThroughputTestThread() : ThroughputTest(kGPU | kCompositorThread) {}
};
// For running tests on Software: // For running tests on Software:
class ThroughputTestSW : public ThroughputTest { class ThroughputTestSW : public ThroughputTest {
public: public:
...@@ -479,6 +495,10 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, Particles) { ...@@ -479,6 +495,10 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, Particles) {
RunTest("particles", kInternal); RunTest("particles", kInternal);
} }
IN_PROC_BROWSER_TEST_F(ThroughputTestThread, Particles) {
RunTest("particles", kInternal);
}
IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasDemoSW) { IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasDemoSW) {
RunTest("canvas-demo", kInternal); RunTest("canvas-demo", kInternal);
} }
...@@ -487,6 +507,10 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasDemoGPU) { ...@@ -487,6 +507,10 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasDemoGPU) {
RunTest("canvas-demo", kInternal | kIsGpuCanvasTest); RunTest("canvas-demo", kInternal | kIsGpuCanvasTest);
} }
IN_PROC_BROWSER_TEST_F(ThroughputTestThread, CanvasDemoGPU) {
RunTest("canvas-demo", kInternal | kIsGpuCanvasTest);
}
// CompositingHugeDivSW timed out on Mac Intel Release GPU bot // CompositingHugeDivSW timed out on Mac Intel Release GPU bot
// See crbug.com/114781 // See crbug.com/114781
// Stopped producing results in SW: crbug.com/127621 // Stopped producing results in SW: crbug.com/127621
...@@ -507,6 +531,10 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, DrawImageShadowGPU) { ...@@ -507,6 +531,10 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, DrawImageShadowGPU) {
RunTest("canvas2d_balls_with_shadow", kNone | kIsGpuCanvasTest); RunTest("canvas2d_balls_with_shadow", kNone | kIsGpuCanvasTest);
} }
IN_PROC_BROWSER_TEST_F(ThroughputTestThread, DrawImageShadowGPU) {
RunTest("canvas2d_balls_with_shadow", kNone | kIsGpuCanvasTest);
}
IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasToCanvasDrawSW) { IN_PROC_BROWSER_TEST_F(ThroughputTestSW, CanvasToCanvasDrawSW) {
if (IsGpuAvailable() && if (IsGpuAvailable() &&
GPUTestBotConfig::CurrentConfigMatches("MAC AMD")) GPUTestBotConfig::CurrentConfigMatches("MAC AMD"))
...@@ -559,4 +587,8 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) { ...@@ -559,4 +587,8 @@ IN_PROC_BROWSER_TEST_F(ThroughputTestGPU, CanvasManyImagesGPU) {
RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest); RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest);
} }
IN_PROC_BROWSER_TEST_F(ThroughputTestThread, CanvasManyImagesGPU) {
RunCanvasBenchTest("many_images", kNone | kIsGpuCanvasTest);
}
} // namespace } // namespace
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment