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/message_loop/message_loop_proxy.h"
8 #include "cc/test/fake_external_begin_frame_source.h"
9 #include "third_party/khronos/GLES2/gl2.h"
13 FakeCompositorDependencies::FakeCompositorDependencies()
14 : use_single_thread_scheduler_(true) {
17 FakeCompositorDependencies::~FakeCompositorDependencies() {
20 bool FakeCompositorDependencies::IsImplSidePaintingEnabled() {
24 bool FakeCompositorDependencies::IsGpuRasterizationForced() {
28 bool FakeCompositorDependencies::IsGpuRasterizationEnabled() {
32 int FakeCompositorDependencies::GetGpuRasterizationMSAASampleCount() {
36 bool FakeCompositorDependencies::IsLcdTextEnabled() {
40 bool FakeCompositorDependencies::IsDistanceFieldTextEnabled() {
44 bool FakeCompositorDependencies::IsZeroCopyEnabled() {
48 bool FakeCompositorDependencies::IsOneCopyEnabled() {
52 bool FakeCompositorDependencies::IsElasticOverscrollEnabled() {
56 bool FakeCompositorDependencies::UseSingleThreadScheduler() {
57 return use_single_thread_scheduler_
;
60 uint32
FakeCompositorDependencies::GetImageTextureTarget() {
64 scoped_refptr
<base::SingleThreadTaskRunner
>
65 FakeCompositorDependencies::GetCompositorMainThreadTaskRunner() {
66 return base::MessageLoopProxy::current();
69 scoped_refptr
<base::SingleThreadTaskRunner
>
70 FakeCompositorDependencies::GetCompositorImplThreadTaskRunner() {
71 return nullptr; // Currently never threaded compositing in unit tests.
74 cc::SharedBitmapManager
* FakeCompositorDependencies::GetSharedBitmapManager() {
75 return &shared_bitmap_manager_
;
78 gpu::GpuMemoryBufferManager
*
79 FakeCompositorDependencies::GetGpuMemoryBufferManager() {
80 return &gpu_memory_buffer_manager_
;
83 RendererScheduler
* FakeCompositorDependencies::GetRendererScheduler() {
84 return &renderer_scheduler_
;
88 FakeCompositorDependencies::GetSharedMainThreadContextProvider() {
93 scoped_ptr
<cc::BeginFrameSource
>
94 FakeCompositorDependencies::CreateExternalBeginFrameSource(int routing_id
) {
95 double refresh_rate
= 200.0;
96 return make_scoped_ptr(new cc::FakeExternalBeginFrameSource(refresh_rate
));
99 cc::TaskGraphRunner
* FakeCompositorDependencies::GetTaskGraphRunner() {
100 return &task_graph_runner_
;
103 bool FakeCompositorDependencies::IsGatherPixelRefsEnabled() {
107 } // namespace content