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