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 COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ | 5 #ifndef COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ |
6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ | 6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace gles2 { | 24 namespace gles2 { |
25 class GLES2Decoder; | 25 class GLES2Decoder; |
26 } | 26 } |
27 } | 27 } |
28 | 28 |
29 namespace gfx { | 29 namespace gfx { |
30 class GLContext; | 30 class GLContext; |
31 class GLSurface; | 31 class GLSurface; |
32 } | 32 } |
33 | 33 |
34 namespace mus { | 34 namespace gles2 { |
35 | 35 |
36 class CommandBufferLocalClient; | 36 class CommandBufferLocalClient; |
37 class GpuState; | |
38 | 37 |
39 // This class provides a thin wrapper around a CommandBufferService and a | 38 // This class provides a thin wrapper around a CommandBufferService and a |
40 // GpuControl implementation to allow cc::Display to generate GL directly on | 39 // GpuControl implementation to allow cc::Display to generate GL directly on |
41 // the same thread. | 40 // the same thread. |
42 class CommandBufferLocal : public gpu::GpuControl { | 41 class CommandBufferLocal : public gpu::GpuControl { |
43 public: | 42 public: |
44 CommandBufferLocal(CommandBufferLocalClient* client, | 43 CommandBufferLocal(CommandBufferLocalClient* client, |
45 gfx::AcceleratedWidget widget, | 44 gfx::AcceleratedWidget widget, |
46 const scoped_refptr<GpuState>& gpu_state); | 45 const scoped_refptr<gles2::GpuState>& gpu_state); |
47 ~CommandBufferLocal() override; | 46 ~CommandBufferLocal() override; |
48 | 47 |
49 bool Initialize(); | 48 bool Initialize(); |
50 | 49 |
51 gpu::CommandBuffer* GetCommandBuffer(); | 50 gpu::CommandBuffer* GetCommandBuffer(); |
52 | 51 |
53 // gpu::GpuControl implementation: | 52 // gpu::GpuControl implementation: |
54 gpu::Capabilities GetCapabilities() override; | 53 gpu::Capabilities GetCapabilities() override; |
55 int32_t CreateImage(ClientBuffer buffer, | 54 int32_t CreateImage(ClientBuffer buffer, |
56 size_t width, | 55 size_t width, |
(...skipping 20 matching lines...) Expand all Loading... |
77 | 76 |
78 void OnResize(gfx::Size size, float scale_factor); | 77 void OnResize(gfx::Size size, float scale_factor); |
79 void OnUpdateVSyncParameters(const base::TimeTicks timebase, | 78 void OnUpdateVSyncParameters(const base::TimeTicks timebase, |
80 const base::TimeDelta interval); | 79 const base::TimeDelta interval); |
81 bool OnWaitSyncPoint(uint32_t sync_point); | 80 bool OnWaitSyncPoint(uint32_t sync_point); |
82 void OnParseError(); | 81 void OnParseError(); |
83 void OnContextLost(uint32_t reason); | 82 void OnContextLost(uint32_t reason); |
84 void OnSyncPointRetired(); | 83 void OnSyncPointRetired(); |
85 | 84 |
86 gfx::AcceleratedWidget widget_; | 85 gfx::AcceleratedWidget widget_; |
87 scoped_refptr<GpuState> gpu_state_; | 86 scoped_refptr<gles2::GpuState> gpu_state_; |
88 scoped_ptr<gpu::CommandBufferService> command_buffer_; | 87 scoped_ptr<gpu::CommandBufferService> command_buffer_; |
89 scoped_ptr<gpu::GpuScheduler> scheduler_; | 88 scoped_ptr<gpu::GpuScheduler> scheduler_; |
90 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; | 89 scoped_ptr<gpu::gles2::GLES2Decoder> decoder_; |
91 scoped_refptr<gfx::GLContext> context_; | 90 scoped_refptr<gfx::GLContext> context_; |
92 scoped_refptr<gfx::GLSurface> surface_; | 91 scoped_refptr<gfx::GLSurface> surface_; |
93 CommandBufferLocalClient* client_; | 92 CommandBufferLocalClient* client_; |
94 | 93 |
95 base::WeakPtrFactory<CommandBufferLocal> weak_factory_; | 94 base::WeakPtrFactory<CommandBufferLocal> weak_factory_; |
96 | 95 |
97 DISALLOW_COPY_AND_ASSIGN(CommandBufferLocal); | 96 DISALLOW_COPY_AND_ASSIGN(CommandBufferLocal); |
98 }; | 97 }; |
99 | 98 |
100 } // namespace mus | 99 } // namespace gles2 |
101 | 100 |
102 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ | 101 #endif // COMPONENTS_MUS_GLES2_COMMAND_BUFFER_LOCAL_H_ |
OLD | NEW |