diff options
author | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-17 19:43:19 +0000 |
---|---|---|
committer | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-17 19:43:19 +0000 |
commit | 48330e9c6467b13f140e6b9d93a81878414cb6f7 (patch) | |
tree | 38efcc747281c468f70662ac4e14367ec92cf394 /cc | |
parent | aaecf7935d3227893f11d1d92d371ee9188412cf (diff) | |
download | chromium_src-48330e9c6467b13f140e6b9d93a81878414cb6f7.zip chromium_src-48330e9c6467b13f140e6b9d93a81878414cb6f7.tar.gz chromium_src-48330e9c6467b13f140e6b9d93a81878414cb6f7.tar.bz2 |
cc: Remove TestWebGraphicsContext3D overhead from RasterWorkerPool perf tests.
Use gpu::gles2::GLES2InterfaceStub instead of TestWebGraphicsContext3D for RasterWorkerPool perf tests.
BUG=269841
TEST=cc_perftests --gtest_filter=RasterWorkerPoolPerfTests/RasterWorkerPoolPerfTest.ScheduleAndExecuteTasks/*
Review URL: https://codereview.chromium.org/175423003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/resources/raster_worker_pool_perftest.cc | 31 | ||||
-rw-r--r-- | cc/test/fake_output_surface.h | 2 |
2 files changed, 30 insertions, 3 deletions
diff --git a/cc/resources/raster_worker_pool_perftest.cc b/cc/resources/raster_worker_pool_perftest.cc index 9fb7dfc..851f1f6 100644 --- a/cc/resources/raster_worker_pool_perftest.cc +++ b/cc/resources/raster_worker_pool_perftest.cc @@ -5,6 +5,7 @@ #include "cc/resources/raster_worker_pool.h" #include "base/time/time.h" +#include "cc/output/context_provider.h" #include "cc/resources/direct_raster_worker_pool.h" #include "cc/resources/image_raster_worker_pool.h" #include "cc/resources/pixel_buffer_raster_worker_pool.h" @@ -13,6 +14,7 @@ #include "cc/test/fake_output_surface.h" #include "cc/test/fake_output_surface_client.h" #include "cc/test/lap_timer.h" +#include "cc/test/test_context_support.h" #include "cc/test/test_web_graphics_context_3d.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/perf/perf_test.h" @@ -21,6 +23,31 @@ namespace cc { namespace { +class PerfContextProvider : public ContextProvider { + public: + PerfContextProvider() : context_gl_(new gpu::gles2::GLES2InterfaceStub) {} + + virtual bool BindToCurrentThread() OVERRIDE { return true; } + virtual Capabilities ContextCapabilities() OVERRIDE { return Capabilities(); } + virtual gpu::gles2::GLES2Interface* ContextGL() OVERRIDE { + return context_gl_.get(); + } + virtual gpu::ContextSupport* ContextSupport() OVERRIDE { return &support_; } + virtual class GrContext* GrContext() OVERRIDE { return NULL; } + virtual bool IsContextLost() OVERRIDE { return false; } + virtual void VerifyContexts() OVERRIDE {} + virtual bool DestroyedOnMainThread() OVERRIDE { return false; } + virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE {} + virtual void SetMemoryPolicyChangedCallback( + const MemoryPolicyChangedCallback& cb) OVERRIDE {} + + private: + virtual ~PerfContextProvider() {} + + scoped_ptr<gpu::gles2::GLES2InterfaceStub> context_gl_; + TestContextSupport support_; +}; + enum RasterWorkerPoolType { RASTER_WORKER_POOL_TYPE_PIXEL_BUFFER, RASTER_WORKER_POOL_TYPE_IMAGE, @@ -135,7 +162,7 @@ class RasterWorkerPoolPerfTestBase { RasterTaskVector; RasterWorkerPoolPerfTestBase() - : context_provider_(TestContextProvider::Create()), + : context_provider_(make_scoped_refptr(new PerfContextProvider)), timer_(kWarmupRuns, base::TimeDelta::FromMilliseconds(kTimeLimitMillis), kTimeCheckInterval) { @@ -182,7 +209,7 @@ class RasterWorkerPoolPerfTestBase { } protected: - scoped_refptr<TestContextProvider> context_provider_; + scoped_refptr<ContextProvider> context_provider_; FakeOutputSurfaceClient output_surface_client_; scoped_ptr<FakeOutputSurface> output_surface_; scoped_ptr<ResourceProvider> resource_provider_; diff --git a/cc/test/fake_output_surface.h b/cc/test/fake_output_surface.h index 1c91338..965f543 100644 --- a/cc/test/fake_output_surface.h +++ b/cc/test/fake_output_surface.h @@ -28,7 +28,7 @@ class FakeOutputSurface : public OutputSurface { } static scoped_ptr<FakeOutputSurface> Create3d( - scoped_refptr<TestContextProvider> context_provider) { + scoped_refptr<ContextProvider> context_provider) { return make_scoped_ptr(new FakeOutputSurface(context_provider, false)); } |