Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / content / renderer / gpu / compositor_dependencies.h
blob5c72ee7c2306576586ed7b06e8c520e79b6ef1df
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 #ifndef CONTENT_RENDERER_GPU_COMPOSITOR_DEPENDENCIES_H_
6 #define CONTENT_RENDERER_GPU_COMPOSITOR_DEPENDENCIES_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
11 namespace base {
12 class SingleThreadTaskRunner;
15 namespace cc {
16 class BeginFrameSource;
17 class ContextProvider;
18 class SharedBitmapManager;
19 class TaskGraphRunner;
22 namespace gpu {
23 class GpuMemoryBufferManager;
26 namespace content {
27 class RendererScheduler;
29 class CompositorDependencies {
30 public:
31 virtual bool IsImplSidePaintingEnabled() = 0;
32 virtual bool IsGpuRasterizationForced() = 0;
33 virtual bool IsGpuRasterizationEnabled() = 0;
34 virtual int GetGpuRasterizationMSAASampleCount() = 0;
35 virtual bool IsLcdTextEnabled() = 0;
36 virtual bool IsDistanceFieldTextEnabled() = 0;
37 virtual bool IsZeroCopyEnabled() = 0;
38 virtual bool IsOneCopyEnabled() = 0;
39 virtual bool IsElasticOverscrollEnabled() = 0;
40 // Only valid in single threaded mode.
41 virtual bool UseSingleThreadScheduler() = 0;
42 virtual uint32 GetImageTextureTarget() = 0;
43 virtual scoped_refptr<base::SingleThreadTaskRunner>
44 GetCompositorMainThreadTaskRunner() = 0;
45 // Returns null if the compositor is in single-threaded mode (ie. there is no
46 // compositor thread).
47 virtual scoped_refptr<base::SingleThreadTaskRunner>
48 GetCompositorImplThreadTaskRunner() = 0;
49 virtual cc::SharedBitmapManager* GetSharedBitmapManager() = 0;
50 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0;
51 virtual RendererScheduler* GetRendererScheduler() = 0;
52 virtual cc::ContextProvider* GetSharedMainThreadContextProvider() = 0;
53 virtual scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource(
54 int routing_id) = 0;
55 virtual cc::TaskGraphRunner* GetTaskGraphRunner() = 0;
56 virtual bool IsGatherPixelRefsEnabled() = 0;
58 virtual ~CompositorDependencies() {}
61 } // namespace content
63 #endif // CONTENT_RENDERER_GPU_COMPOSITOR_DEPENDENCIES_H_