Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ui/compositor/test/fake_context_factory.h

Issue 2879463002: Initialize RendererSettings in ContextFactory (Closed)
Patch Set: const RendererSettings Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/compositor/compositor_util.cc ('k') | ui/compositor/test/fake_context_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_ 5 #ifndef UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_
6 #define UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_ 6 #define UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_
7 7
8 #include "cc/output/renderer_settings.h"
8 #include "cc/test/test_gpu_memory_buffer_manager.h" 9 #include "cc/test/test_gpu_memory_buffer_manager.h"
9 #include "cc/test/test_task_graph_runner.h" 10 #include "cc/test/test_task_graph_runner.h"
10 #include "ui/compositor/compositor.h" 11 #include "ui/compositor/compositor.h"
11 12
12 namespace cc { 13 namespace cc {
13 class CompositorFrame; 14 class CompositorFrame;
14 class ContextProvider; 15 class ContextProvider;
15 class FakeCompositorFrameSink; 16 class FakeCompositorFrameSink;
16 class TestTaskGraphRunner; 17 class TestTaskGraphRunner;
17 class TestGpuMemoryBufferManager; 18 class TestGpuMemoryBufferManager;
18 } 19 }
19 20
20 namespace ui { 21 namespace ui {
21 22
22 class FakeContextFactory : public ui::ContextFactory { 23 class FakeContextFactory : public ui::ContextFactory {
23 public: 24 public:
24 FakeContextFactory() = default; 25 FakeContextFactory();
25 ~FakeContextFactory() override = default; 26 ~FakeContextFactory() override;
26 27
27 const cc::CompositorFrame& GetLastCompositorFrame() const; 28 const cc::CompositorFrame& GetLastCompositorFrame() const;
28 29
29 // ui::ContextFactory: 30 // ui::ContextFactory:
30 void CreateCompositorFrameSink( 31 void CreateCompositorFrameSink(
31 base::WeakPtr<ui::Compositor> compositor) override; 32 base::WeakPtr<ui::Compositor> compositor) override;
32 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; 33 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
33 void RemoveCompositor(ui::Compositor* compositor) override; 34 void RemoveCompositor(ui::Compositor* compositor) override;
34 double GetRefreshRate() const override; 35 double GetRefreshRate() const override;
35 uint32_t GetImageTextureTarget(gfx::BufferFormat format,
36 gfx::BufferUsage usage) override;
37 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; 36 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
38 cc::TaskGraphRunner* GetTaskGraphRunner() override; 37 cc::TaskGraphRunner* GetTaskGraphRunner() override;
38 const cc::RendererSettings& GetRendererSettings() const override;
39 void AddObserver(ui::ContextFactoryObserver* observer) override {} 39 void AddObserver(ui::ContextFactoryObserver* observer) override {}
40 void RemoveObserver(ui::ContextFactoryObserver* observer) override {} 40 void RemoveObserver(ui::ContextFactoryObserver* observer) override {}
41 41
42 private: 42 private:
43 cc::FakeCompositorFrameSink* frame_sink_ = nullptr; 43 cc::FakeCompositorFrameSink* frame_sink_ = nullptr;
44 cc::TestTaskGraphRunner task_graph_runner_; 44 cc::TestTaskGraphRunner task_graph_runner_;
45 cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_; 45 cc::TestGpuMemoryBufferManager gpu_memory_buffer_manager_;
46 cc::RendererSettings renderer_settings_;
46 47
47 DISALLOW_COPY_AND_ASSIGN(FakeContextFactory); 48 DISALLOW_COPY_AND_ASSIGN(FakeContextFactory);
48 }; 49 };
49 50
50 } // namespace ui 51 } // namespace ui
51 52
52 #endif // UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_ 53 #endif // UI_COMPOSITOR_TEST_FAKE_CONTEXT_FACTORY_H_
OLDNEW
« no previous file with comments | « ui/compositor/compositor_util.cc ('k') | ui/compositor/test/fake_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698