Roll src/third_party/WebKit e0eac24:489c548 (svn 193311:193320)
[chromium-blink-merge.git] / content / test / fake_compositor_dependencies.h
blob7c6606b4918dde0893b8a4b7e9a8a488de51e510
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_TEST_FAKE_COMPOSITOR_DEPENDENCIES_H_
6 #define CONTENT_TEST_FAKE_COMPOSITOR_DEPENDENCIES_H_
8 #include "cc/test/test_gpu_memory_buffer_manager.h"
9 #include "cc/test/test_shared_bitmap_manager.h"
10 #include "cc/test/test_task_graph_runner.h"
11 #include "content/renderer/gpu/compositor_dependencies.h"
12 #include "content/test/fake_renderer_scheduler.h"
14 namespace content {
16 class FakeCompositorDependencies : public CompositorDependencies {
17 public:
18 FakeCompositorDependencies();
19 ~FakeCompositorDependencies() override;
21 // CompositorDependencies implementation.
22 bool IsImplSidePaintingEnabled() override;
23 bool IsGpuRasterizationForced() override;
24 bool IsGpuRasterizationEnabled() override;
25 int GetGpuRasterizationMSAASampleCount() override;
26 bool IsLcdTextEnabled() override;
27 bool IsDistanceFieldTextEnabled() override;
28 bool IsZeroCopyEnabled() override;
29 bool IsOneCopyEnabled() override;
30 bool IsElasticOverscrollEnabled() override;
31 bool UseSingleThreadScheduler() override;
32 uint32 GetImageTextureTarget() override;
33 scoped_refptr<base::SingleThreadTaskRunner>
34 GetCompositorMainThreadTaskRunner() override;
35 scoped_refptr<base::SingleThreadTaskRunner>
36 GetCompositorImplThreadTaskRunner() override;
37 cc::SharedBitmapManager* GetSharedBitmapManager() override;
38 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
39 RendererScheduler* GetRendererScheduler() override;
40 cc::ContextProvider* GetSharedMainThreadContextProvider() override;
41 scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource(
42 int routing_id) override;
43 cc::TaskGraphRunner* GetTaskGraphRunner() override;
44 bool IsGatherPixelRefsEnabled() override;
46 void set_use_single_thread_scheduler(bool use) {
47 use_single_thread_scheduler_ = use;
50 private:
51 cc::TestSharedBitmapManager shared_bitmap_manager_;
52 cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
53 cc::TestTaskGraphRunner task_graph_runner_;
54 FakeRendererScheduler renderer_scheduler_;
55 bool use_single_thread_scheduler_;
57 DISALLOW_COPY_AND_ASSIGN(FakeCompositorDependencies);
60 } // namespace content
62 #endif // CONTENT_TEST_FAKE_COMPOSITOR_DEPENDENCIES_H_