Update broken references to image assets
[chromium-blink-merge.git] / content / test / fake_compositor_dependencies.cc
blob64be5342ba3459b55886deee4fcd5d050b0731cf
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"
13 namespace content {
15 FakeCompositorDependencies::FakeCompositorDependencies() {
18 FakeCompositorDependencies::~FakeCompositorDependencies() {
21 bool FakeCompositorDependencies::IsGpuRasterizationForced() {
22 return false;
25 bool FakeCompositorDependencies::IsGpuRasterizationEnabled() {
26 return false;
29 int FakeCompositorDependencies::GetGpuRasterizationMSAASampleCount() {
30 return 0;
33 bool FakeCompositorDependencies::IsLcdTextEnabled() {
34 return false;
37 bool FakeCompositorDependencies::IsDistanceFieldTextEnabled() {
38 return false;
41 bool FakeCompositorDependencies::IsZeroCopyEnabled() {
42 return true;
45 bool FakeCompositorDependencies::IsOneCopyEnabled() {
46 return false;
49 bool FakeCompositorDependencies::IsPersistentGpuMemoryBufferEnabled() {
50 return false;
53 bool FakeCompositorDependencies::IsElasticOverscrollEnabled() {
54 return false;
56 std::vector<unsigned> FakeCompositorDependencies::GetImageTextureTargets() {
57 return std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1,
58 GL_TEXTURE_2D);
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_;
85 cc::ContextProvider*
86 FakeCompositorDependencies::GetSharedMainThreadContextProvider() {
87 NOTREACHED();
88 return nullptr;
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() {
102 return false;
105 bool FakeCompositorDependencies::IsThreadedAnimationEnabled() {
106 return true;
109 } // namespace content