chromium/cc/raster/raster_buffer_provider_perftest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <stddef.h>
#include <stdint.h>

#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
#include "base/timer/lap_timer.h"
#include "build/build_config.h"
#include "cc/raster/bitmap_raster_buffer_provider.h"
#include "cc/raster/gpu_raster_buffer_provider.h"
#include "cc/raster/one_copy_raster_buffer_provider.h"
#include "cc/raster/raster_buffer_provider.h"
#include "cc/raster/raster_query_queue.h"
#include "cc/raster/synchronous_task_graph_runner.h"
#include "cc/raster/zero_copy_raster_buffer_provider.h"
#include "cc/resources/resource_pool.h"
#include "cc/test/fake_layer_tree_frame_sink.h"
#include "cc/tiles/tile_task_manager.h"
#include "components/viz/client/client_resource_provider.h"
#include "components/viz/common/gpu/context_cache_controller.h"
#include "components/viz/common/gpu/raster_context_provider.h"
#include "components/viz/common/resources/platform_color.h"
#include "components/viz/common/resources/shared_image_format_utils.h"
#include "components/viz/test/test_context_provider.h"
#include "components/viz/test/test_context_support.h"
#include "components/viz/test/test_gles2_interface.h"
#include "gpu/command_buffer/client/raster_implementation_gles.h"
#include "gpu/command_buffer/common/sync_token.h"
#include "gpu/config/gpu_feature_info.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/gpu/GrDirectContext.h"

namespace cc {
namespace {

class PerfGLES2Interface : public gpu::gles2::GLES2InterfaceStub {};

}  // namespace

class PerfContextProvider
    : public base::RefCountedThreadSafe<PerfContextProvider>,
      public viz::RasterContextProvider {};

namespace {

enum RasterBufferProviderType {};

static const int kTimeLimitMillis =;
static const int kWarmupRuns =;
static const int kTimeCheckInterval =;

class PerfTileTask : public TileTask {};

class PerfImageDecodeTaskImpl : public PerfTileTask {};

class PerfRasterBufferProviderHelper {};

class PerfRasterTaskImpl : public PerfTileTask {};

class RasterBufferProviderPerfTestBase {};

class RasterBufferProviderPerfTest
    : public RasterBufferProviderPerfTestBase,
      public PerfRasterBufferProviderHelper,
      public testing::TestWithParam<RasterBufferProviderType> {};

TEST_P(RasterBufferProviderPerfTest, ScheduleTasks) {}

TEST_P(RasterBufferProviderPerfTest, ScheduleAlternateTasks) {}

TEST_P(RasterBufferProviderPerfTest, ScheduleAndExecuteTasks) {}

INSTANTIATE_TEST_SUITE_P();

class RasterBufferProviderCommonPerfTest
    : public RasterBufferProviderPerfTestBase,
      public testing::Test {};

TEST_F(RasterBufferProviderCommonPerfTest, BuildTileTaskGraph) {}

}  // namespace
}  // namespace cc