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 bool FakeCompositorDependencies::IsImplSidePaintingEnabled() {
21 bool FakeCompositorDependencies::IsGpuRasterizationForced() {
25 bool FakeCompositorDependencies::IsGpuRasterizationEnabled() {
29 bool FakeCompositorDependencies::IsThreadedGpuRasterizationEnabled() {
33 int FakeCompositorDependencies::GetGpuRasterizationMSAASampleCount() {
37 bool FakeCompositorDependencies::IsLcdTextEnabled() {
41 bool FakeCompositorDependencies::IsDistanceFieldTextEnabled() {
45 bool FakeCompositorDependencies::IsZeroCopyEnabled() {
49 bool FakeCompositorDependencies::IsOneCopyEnabled() {
53 bool FakeCompositorDependencies::IsElasticOverscrollEnabled() {
57 bool FakeCompositorDependencies::UseSingleThreadScheduler() {
58 return use_single_thread_scheduler_
;
61 uint32
FakeCompositorDependencies::GetImageTextureTarget() {
65 scoped_refptr
<base::SingleThreadTaskRunner
>
66 FakeCompositorDependencies::GetCompositorMainThreadTaskRunner() {
67 return base::MessageLoopProxy::current();
70 scoped_refptr
<base::SingleThreadTaskRunner
>
71 FakeCompositorDependencies::GetCompositorImplThreadTaskRunner() {
72 return nullptr; // Currently never threaded compositing in unit tests.
75 cc::SharedBitmapManager
* FakeCompositorDependencies::GetSharedBitmapManager() {
76 return &shared_bitmap_manager_
;
79 gpu::GpuMemoryBufferManager
*
80 FakeCompositorDependencies::GetGpuMemoryBufferManager() {
81 return &gpu_memory_buffer_manager_
;
84 RendererScheduler
* FakeCompositorDependencies::GetRendererScheduler() {
85 return &renderer_scheduler_
;
89 FakeCompositorDependencies::GetSharedMainThreadContextProvider() {
94 scoped_ptr
<cc::BeginFrameSource
>
95 FakeCompositorDependencies::CreateExternalBeginFrameSource(int routing_id
) {
96 double refresh_rate
= 200.0;
97 return make_scoped_ptr(new cc::FakeExternalBeginFrameSource(refresh_rate
));
100 } // namespace content