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"
14 FakeCompositorDependencies::FakeCompositorDependencies() {
17 FakeCompositorDependencies::~FakeCompositorDependencies() {
20 bool FakeCompositorDependencies::IsGpuRasterizationForced() {
24 bool FakeCompositorDependencies::IsGpuRasterizationEnabled() {
28 int FakeCompositorDependencies::GetGpuRasterizationMSAASampleCount() {
32 bool FakeCompositorDependencies::IsLcdTextEnabled() {
36 bool FakeCompositorDependencies::IsDistanceFieldTextEnabled() {
40 bool FakeCompositorDependencies::IsZeroCopyEnabled() {
44 bool FakeCompositorDependencies::IsOneCopyEnabled() {
48 bool FakeCompositorDependencies::IsElasticOverscrollEnabled() {
52 uint32
FakeCompositorDependencies::GetImageTextureTarget() {
56 scoped_refptr
<base::SingleThreadTaskRunner
>
57 FakeCompositorDependencies::GetCompositorMainThreadTaskRunner() {
58 return base::ThreadTaskRunnerHandle::Get();
61 scoped_refptr
<base::SingleThreadTaskRunner
>
62 FakeCompositorDependencies::GetCompositorImplThreadTaskRunner() {
63 return nullptr; // Currently never threaded compositing in unit tests.
66 cc::SharedBitmapManager
* FakeCompositorDependencies::GetSharedBitmapManager() {
67 return &shared_bitmap_manager_
;
70 gpu::GpuMemoryBufferManager
*
71 FakeCompositorDependencies::GetGpuMemoryBufferManager() {
72 return &gpu_memory_buffer_manager_
;
75 scheduler::RendererScheduler
*
76 FakeCompositorDependencies::GetRendererScheduler() {
77 return &renderer_scheduler_
;
81 FakeCompositorDependencies::GetSharedMainThreadContextProvider() {
86 scoped_ptr
<cc::BeginFrameSource
>
87 FakeCompositorDependencies::CreateExternalBeginFrameSource(int routing_id
) {
88 double refresh_rate
= 200.0;
89 return make_scoped_ptr(new cc::FakeExternalBeginFrameSource(refresh_rate
));
92 cc::TaskGraphRunner
* FakeCompositorDependencies::GetTaskGraphRunner() {
93 return &task_graph_runner_
;
96 bool FakeCompositorDependencies::IsGatherPixelRefsEnabled() {
100 } // namespace content