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

Side by Side Diff: ui/aura/mus/mus_context_factory.h

Issue 2586323002: mus: Use ui::ContextProviderCommandBuffer. (Closed)
Patch Set: async Created 4 years 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
OLDNEW
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"
11 #include "cc/surfaces/surface_manager.h" 11 #include "cc/surfaces/surface_manager.h"
12 #include "services/ui/public/cpp/raster_thread_helper.h" 12 #include "services/ui/public/cpp/raster_thread_helper.h"
13 #include "services/ui/public/interfaces/window_tree.mojom.h" 13 #include "services/ui/public/interfaces/window_tree.mojom.h"
14 #include "ui/aura/aura_export.h" 14 #include "ui/aura/aura_export.h"
15 #include "ui/compositor/compositor.h" 15 #include "ui/compositor/compositor.h"
16 16
17 namespace gpu {
18 class GpuChannelHost;
19 }
20
17 namespace ui { 21 namespace ui {
18 class Gpu; 22 class Gpu;
19 } 23 }
20 24
21 namespace aura { 25 namespace aura {
22 26
23 // ContextFactory implementation that can be used with Mus. 27 // ContextFactory implementation that can be used with Mus.
24 class AURA_EXPORT MusContextFactory : public ui::ContextFactory { 28 class AURA_EXPORT MusContextFactory : public ui::ContextFactory {
25 public: 29 public:
26 explicit MusContextFactory(ui::Gpu* gpu); 30 explicit MusContextFactory(ui::Gpu* gpu);
27 ~MusContextFactory() override; 31 ~MusContextFactory() override;
28 32
29 private: 33 private:
34 void OnEstablishedGpuChannel(base::WeakPtr<ui::Compositor> compositor,
msw 2016/12/19 21:33:33 optional nit: comment?
sadrul 2016/12/20 03:53:20 Done.
35 scoped_refptr<gpu::GpuChannelHost> gpu_channel);
msw 2016/12/19 21:33:33 nit: include base/memory/ref_counted.h and base/me
sadrul 2016/12/20 03:53:20 Done.
36
30 // ContextFactory: 37 // ContextFactory:
31 void CreateCompositorFrameSink( 38 void CreateCompositorFrameSink(
32 base::WeakPtr<ui::Compositor> compositor) override; 39 base::WeakPtr<ui::Compositor> compositor) override;
33 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; 40 scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override;
34 void RemoveCompositor(ui::Compositor* compositor) override; 41 void RemoveCompositor(ui::Compositor* compositor) override;
35 bool DoesCreateTestContexts() override; 42 bool DoesCreateTestContexts() override;
36 uint32_t GetImageTextureTarget(gfx::BufferFormat format, 43 uint32_t GetImageTextureTarget(gfx::BufferFormat format,
37 gfx::BufferUsage usage) override; 44 gfx::BufferUsage usage) override;
38 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; 45 gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override;
39 cc::TaskGraphRunner* GetTaskGraphRunner() override; 46 cc::TaskGraphRunner* GetTaskGraphRunner() override;
40 void AddObserver(ui::ContextFactoryObserver* observer) override {} 47 void AddObserver(ui::ContextFactoryObserver* observer) override {}
41 void RemoveObserver(ui::ContextFactoryObserver* observer) override {} 48 void RemoveObserver(ui::ContextFactoryObserver* observer) override {}
42 49
43 ui::RasterThreadHelper raster_thread_helper_; 50 ui::RasterThreadHelper raster_thread_helper_;
44 ui::Gpu* gpu_; 51 ui::Gpu* gpu_;
52 base::WeakPtrFactory<MusContextFactory> weak_ptr_factory_;
45 53
46 DISALLOW_COPY_AND_ASSIGN(MusContextFactory); 54 DISALLOW_COPY_AND_ASSIGN(MusContextFactory);
47 }; 55 };
48 56
49 } // namespace aura 57 } // namespace aura
50 58
51 #endif // UI_AURA_MUS_MUS_CONTEXT_FACTORY_H_ 59 #endif // UI_AURA_MUS_MUS_CONTEXT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698