OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_AURA_MUS_MUS_CONTEXT_FACTORY_H_ | 5 #ifndef UI_AURA_MUS_MUS_CONTEXT_FACTORY_H_ |
6 #define UI_AURA_MUS_MUS_CONTEXT_FACTORY_H_ | 6 #define UI_AURA_MUS_MUS_CONTEXT_FACTORY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 class AURA_EXPORT MusContextFactory : public ui::ContextFactory { | 31 class AURA_EXPORT MusContextFactory : public ui::ContextFactory { |
32 public: | 32 public: |
33 explicit MusContextFactory(ui::Gpu* gpu); | 33 explicit MusContextFactory(ui::Gpu* gpu); |
34 ~MusContextFactory() override; | 34 ~MusContextFactory() override; |
35 | 35 |
36 private: | 36 private: |
37 // Callback function for Gpu::EstablishGpuChannel(). | 37 // Callback function for Gpu::EstablishGpuChannel(). |
38 void OnEstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, | 38 void OnEstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor, |
39 scoped_refptr<gpu::GpuChannelHost> gpu_channel); | 39 scoped_refptr<gpu::GpuChannelHost> gpu_channel); |
40 | 40 |
41 void OnCompositorFrameSinkAvailable( | |
42 base::WeakPtr<ui::Compositor> compositor, | |
43 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink); | |
44 | |
45 // ContextFactory: | 41 // ContextFactory: |
46 void CreateCompositorFrameSink( | 42 void CreateCompositorFrameSink( |
47 base::WeakPtr<ui::Compositor> compositor) override; | 43 base::WeakPtr<ui::Compositor> compositor) override; |
48 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; | 44 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; |
49 void RemoveCompositor(ui::Compositor* compositor) override; | 45 void RemoveCompositor(ui::Compositor* compositor) override; |
50 double GetRefreshRate() const override; | 46 double GetRefreshRate() const override; |
51 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; | 47 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
52 cc::TaskGraphRunner* GetTaskGraphRunner() override; | 48 cc::TaskGraphRunner* GetTaskGraphRunner() override; |
53 const cc::RendererSettings& GetRendererSettings() const override; | 49 const cc::RendererSettings& GetRendererSettings() const override; |
54 void AddObserver(ui::ContextFactoryObserver* observer) override {} | 50 void AddObserver(ui::ContextFactoryObserver* observer) override {} |
55 void RemoveObserver(ui::ContextFactoryObserver* observer) override {} | 51 void RemoveObserver(ui::ContextFactoryObserver* observer) override {} |
56 | 52 |
57 ui::RasterThreadHelper raster_thread_helper_; | 53 ui::RasterThreadHelper raster_thread_helper_; |
58 ui::Gpu* gpu_; | 54 ui::Gpu* gpu_; |
59 const cc::RendererSettings renderer_settings_; | 55 const cc::RendererSettings renderer_settings_; |
60 base::WeakPtrFactory<MusContextFactory> weak_ptr_factory_; | 56 base::WeakPtrFactory<MusContextFactory> weak_ptr_factory_; |
61 | 57 |
62 DISALLOW_COPY_AND_ASSIGN(MusContextFactory); | 58 DISALLOW_COPY_AND_ASSIGN(MusContextFactory); |
63 }; | 59 }; |
64 | 60 |
65 } // namespace aura | 61 } // namespace aura |
66 | 62 |
67 #endif // UI_AURA_MUS_MUS_CONTEXT_FACTORY_H_ | 63 #endif // UI_AURA_MUS_MUS_CONTEXT_FACTORY_H_ |
OLD | NEW |