Commit 739de36a authored by Antoine Labour's avatar Antoine Labour Committed by Commit Bot

Introduce DecoderPerfTest

This is a microbenchmark that measures the raw throughput of the GLES2 decoders.

Bug: 775212
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Ic701af8c5e83a5eee347f481ee5319dfa6fc0ffc
Reviewed-on: https://chromium-review.googlesource.com/719462
Commit-Queue: Antoine Labour <piman@chromium.org>
Reviewed-by: default avatarVictor Miura <vmiura@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509270}
parent 4a917c60
......@@ -402,9 +402,10 @@ test("gpu_perftests") {
]
deps = [
":gpu",
"//base",
"//base/test:test_support",
"//gpu/command_buffer/service",
"//gpu/command_buffer/client:gles2_implementation",
"//testing/gmock",
"//testing/gtest",
"//testing/perf",
......@@ -425,6 +426,36 @@ test("gpu_perftests") {
assert_no_deps = [ "//chrome" ]
}
test("command_buffer_perftests") {
sources = [
"command_buffer/tests/decoder_perftest.cc",
"perftests/run_all_tests.cc",
]
deps = [
":gpu",
"//base",
"//base/test:test_support",
"//gpu/command_buffer/client:gles2_implementation",
"//testing/gtest",
"//testing/perf",
"//ui/gfx/geometry",
"//ui/gl",
"//ui/gl/init",
]
data = [
# Needed for isolate script to execute.
"//testing/scripts/common.py",
"//testing/xvfb.py",
"//testing/scripts/run_gtest_perf_test.py",
"//tools/perf/generate_legacy_perf_dashboard_json.py",
]
# This target should not require the Chrome executable to run.
assert_no_deps = [ "//chrome" ]
}
fuzzer_test("gpu_fuzzer") {
sources = [
"command_buffer/tests/fuzzer_main.cc",
......
......@@ -69,6 +69,10 @@ class GPU_EXPORT CommandBufferDirect : public CommandBuffer,
scoped_refptr<Buffer> CreateTransferBufferWithId(size_t size, int32_t id);
void SetGetOffsetForTest(int32_t get_offset) {
service_.SetGetOffsetForTest(get_offset);
}
private:
CommandBufferService service_;
SyncPointManager* sync_point_manager_;
......
......@@ -120,6 +120,10 @@ class GPU_EXPORT CommandBufferService : public CommandBufferServiceBase {
int32_t put_offset() const { return put_offset_; }
void SetGetOffsetForTest(int32_t get_offset) {
state_.get_offset = get_offset;
}
private:
CommandBufferServiceClient* client_;
TransferBufferManager* transfer_buffer_manager_;
......
This diff is collapsed.
......@@ -3,16 +3,39 @@
// found in the LICENSE file.
#include "base/bind.h"
#include "base/command_line.h"
#include "base/feature_list.h"
#include "base/message_loop/message_loop.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "build/build_config.h"
#include "ui/gl/init/gl_factory.h"
static int RunHelper(base::TestSuite* test_suite) {
#if defined(USE_OZONE)
base::MessageLoopForUI main_loop;
#else
base::MessageLoopForIO message_loop;
#endif
base::FeatureList::InitializeInstance(std::string(), std::string());
auto* command_line = base::CommandLine::ForCurrentProcess();
ALLOW_UNUSED_LOCAL(command_line);
CHECK(gl::init::InitializeGLOneOff());
return test_suite->Run();
}
int main(int argc, char** argv) {
base::TestSuite test_suite(argc, argv);
base::CommandLine::Init(argc, argv);
#if defined(OS_MACOSX)
base::mac::ScopedNSAutoreleasePool pool;
#endif
// Always run the perf tests serially, to avoid distorting
// perf measurements with randomness resulting from running
// in parallel.
const auto& run_test_suite =
base::Bind(&base::TestSuite::Run, base::Unretained(&test_suite));
base::Bind(&RunHelper, base::Unretained(&test_suite));
return base::LaunchUnitTestsSerially(argc, argv, run_test_suite);
}
......@@ -28,10 +28,6 @@
#include "ui/gl/init/gl_factory.h"
#include "ui/gl/scoped_make_current.h"
#if defined(USE_OZONE)
#include "base/message_loop/message_loop.h"
#endif
namespace gpu {
namespace {
......@@ -179,13 +175,6 @@ class TextureUploadPerfTest : public testing::Test {
// Overridden from testing::Test
void SetUp() override {
#if defined(USE_OZONE)
// On Ozone, the backend initializes the event system using a UI
// thread.
base::MessageLoopForUI main_loop;
#endif
static bool gl_initialized = gl::init::InitializeGLOneOff();
DCHECK(gl_initialized);
// Initialize an offscreen surface and a gl context.
surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());
gl_context_ =
......
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