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::IsPersistentGpuMemoryBufferEnabled() {
49 bool FakeCompositorDependencies::IsElasticOverscrollEnabled() {
52 std::vector
<unsigned> FakeCompositorDependencies::GetImageTextureTargets() {
53 return std::vector
<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST
) + 1,
57 scoped_refptr
<base::SingleThreadTaskRunner
>
58 FakeCompositorDependencies::GetCompositorMainThreadTaskRunner() {
59 return base::ThreadTaskRunnerHandle::Get();
62 scoped_refptr
<base::SingleThreadTaskRunner
>
63 FakeCompositorDependencies::GetCompositorImplThreadTaskRunner() {
64 return nullptr; // Currently never threaded compositing in unit tests.
67 cc::SharedBitmapManager
* FakeCompositorDependencies::GetSharedBitmapManager() {
68 return &shared_bitmap_manager_
;
71 gpu::GpuMemoryBufferManager
*
72 FakeCompositorDependencies::GetGpuMemoryBufferManager() {
73 return &gpu_memory_buffer_manager_
;
76 scheduler::RendererScheduler
*
77 FakeCompositorDependencies::GetRendererScheduler() {
78 return &renderer_scheduler_
;
82 FakeCompositorDependencies::GetSharedMainThreadContextProvider() {
87 scoped_ptr
<cc::BeginFrameSource
>
88 FakeCompositorDependencies::CreateExternalBeginFrameSource(int routing_id
) {
89 double refresh_rate
= 200.0;
90 return make_scoped_ptr(new cc::FakeExternalBeginFrameSource(refresh_rate
));
93 cc::TaskGraphRunner
* FakeCompositorDependencies::GetTaskGraphRunner() {
94 return &task_graph_runner_
;
97 bool FakeCompositorDependencies::IsGatherPixelRefsEnabled() {
101 bool FakeCompositorDependencies::IsThreadedAnimationEnabled() {
105 } // namespace content