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 #include "content/test/fake_compositor_dependencies.h"
7 #include "base/single_thread_task_runner.h"
8 #include "base/thread_task_runner_handle.h"
9 #include "cc/test/fake_external_begin_frame_source.h"
10 #include "third_party/khronos/GLES2/gl2.h"
11 #include "ui/gfx/buffer_types.h"
15 FakeCompositorDependencies::FakeCompositorDependencies() {
18 FakeCompositorDependencies::~FakeCompositorDependencies() {
21 bool FakeCompositorDependencies::IsGpuRasterizationForced() {
25 bool FakeCompositorDependencies::IsGpuRasterizationEnabled() {
29 int FakeCompositorDependencies::GetGpuRasterizationMSAASampleCount() {
33 bool FakeCompositorDependencies::IsLcdTextEnabled() {
37 bool FakeCompositorDependencies::IsDistanceFieldTextEnabled() {
41 bool FakeCompositorDependencies::IsZeroCopyEnabled() {
45 bool FakeCompositorDependencies::IsOneCopyEnabled() {
49 bool FakeCompositorDependencies::IsPersistentGpuMemoryBufferEnabled() {
53 bool FakeCompositorDependencies::IsElasticOverscrollEnabled() {
56 std::vector
<unsigned> FakeCompositorDependencies::GetImageTextureTargets() {
57 return std::vector
<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST
) + 1,
61 scoped_refptr
<base::SingleThreadTaskRunner
>
62 FakeCompositorDependencies::GetCompositorMainThreadTaskRunner() {
63 return base::ThreadTaskRunnerHandle::Get();
66 scoped_refptr
<base::SingleThreadTaskRunner
>
67 FakeCompositorDependencies::GetCompositorImplThreadTaskRunner() {
68 return nullptr; // Currently never threaded compositing in unit tests.
71 cc::SharedBitmapManager
* FakeCompositorDependencies::GetSharedBitmapManager() {
72 return &shared_bitmap_manager_
;
75 gpu::GpuMemoryBufferManager
*
76 FakeCompositorDependencies::GetGpuMemoryBufferManager() {
77 return &gpu_memory_buffer_manager_
;
80 scheduler::RendererScheduler
*
81 FakeCompositorDependencies::GetRendererScheduler() {
82 return &renderer_scheduler_
;
86 FakeCompositorDependencies::GetSharedMainThreadContextProvider() {
91 scoped_ptr
<cc::BeginFrameSource
>
92 FakeCompositorDependencies::CreateExternalBeginFrameSource(int routing_id
) {
93 double refresh_rate
= 200.0;
94 return make_scoped_ptr(new cc::FakeExternalBeginFrameSource(refresh_rate
));
97 cc::TaskGraphRunner
* FakeCompositorDependencies::GetTaskGraphRunner() {
98 return &task_graph_runner_
;
101 bool FakeCompositorDependencies::IsGatherPixelRefsEnabled() {
105 bool FakeCompositorDependencies::IsThreadedAnimationEnabled() {
109 } // namespace content