| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DRIVER_H_ | 5 #ifndef COMPONENTS_MUS_GLES2_COMMAND_BUFFER_DRIVER_H_ |
| 6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_DRIVER_H_ | 6 #define COMPONENTS_MUS_GLES2_COMMAND_BUFFER_DRIVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "gpu/command_buffer/common/capabilities.h" | 17 #include "gpu/command_buffer/common/capabilities.h" |
| 18 #include "gpu/command_buffer/common/command_buffer.h" | 18 #include "gpu/command_buffer/common/command_buffer.h" |
| 19 #include "gpu/command_buffer/common/command_buffer_id.h" | 19 #include "gpu/command_buffer/common/command_buffer_id.h" |
| 20 #include "gpu/command_buffer/common/constants.h" | 20 #include "gpu/command_buffer/common/constants.h" |
| 21 #include "mojo/public/cpp/bindings/array.h" | 21 #include "mojo/public/cpp/bindings/array.h" |
| 22 #include "mojo/public/cpp/system/buffer.h" | 22 #include "mojo/public/cpp/system/buffer.h" |
| 23 #include "ui/gfx/buffer_types.h" |
| 24 #include "ui/gfx/geometry/size.h" |
| 23 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
| 24 #include "ui/gfx/swap_result.h" | 26 #include "ui/gfx/swap_result.h" |
| 25 #include "ui/mojo/geometry/geometry.mojom.h" | 27 #include "ui/mojo/geometry/geometry.mojom.h" |
| 26 | 28 |
| 29 namespace gfx { |
| 30 class GLContext; |
| 31 class GLSurface; |
| 32 } |
| 33 |
| 27 namespace gpu { | 34 namespace gpu { |
| 28 class CommandBufferService; | 35 class CommandBufferService; |
| 29 class CommandExecutor; | 36 class CommandExecutor; |
| 30 class SyncPointClient; | 37 class SyncPointClient; |
| 31 class SyncPointOrderData; | 38 class SyncPointOrderData; |
| 39 |
| 32 namespace gles2 { | 40 namespace gles2 { |
| 33 class GLES2Decoder; | 41 class GLES2Decoder; |
| 34 } | 42 } // namespace gles2 |
| 35 } | |
| 36 | 43 |
| 37 namespace gfx { | 44 } // namespace gpu |
| 38 class GLContext; | 45 |
| 39 class GLSurface; | 46 namespace ui { |
| 47 class NativePixmap; |
| 40 } | 48 } |
| 41 | 49 |
| 42 namespace mus { | 50 namespace mus { |
| 43 | 51 |
| 44 class GpuState; | 52 class GpuState; |
| 45 | 53 |
| 46 // This class receives CommandBuffer messages on the same thread as the native | 54 // This class receives CommandBuffer messages on the same thread as the native |
| 47 // viewport. | 55 // viewport. |
| 48 class CommandBufferDriver : base::NonThreadSafe { | 56 class CommandBufferDriver : base::NonThreadSafe { |
| 49 public: | 57 public: |
| (...skipping 22 matching lines...) Expand all Loading... |
| 72 void RegisterTransferBuffer(int32_t id, | 80 void RegisterTransferBuffer(int32_t id, |
| 73 mojo::ScopedSharedBufferHandle transfer_buffer, | 81 mojo::ScopedSharedBufferHandle transfer_buffer, |
| 74 uint32_t size); | 82 uint32_t size); |
| 75 void DestroyTransferBuffer(int32_t id); | 83 void DestroyTransferBuffer(int32_t id); |
| 76 void CreateImage(int32_t id, | 84 void CreateImage(int32_t id, |
| 77 mojo::ScopedHandle memory_handle, | 85 mojo::ScopedHandle memory_handle, |
| 78 int32_t type, | 86 int32_t type, |
| 79 mojo::SizePtr size, | 87 mojo::SizePtr size, |
| 80 int32_t format, | 88 int32_t format, |
| 81 int32_t internal_format); | 89 int32_t internal_format); |
| 90 void CreateImageNativeOzone(int32_t id, |
| 91 int32_t type, |
| 92 gfx::Size size, |
| 93 gfx::BufferFormat format, |
| 94 uint32_t internal_format, |
| 95 ui::NativePixmap* pixmap); |
| 82 void DestroyImage(int32_t id); | 96 void DestroyImage(int32_t id); |
| 83 bool IsScheduled() const; | 97 bool IsScheduled() const; |
| 84 bool HasUnprocessedCommands() const; | 98 bool HasUnprocessedCommands() const; |
| 85 gpu::Capabilities GetCapabilities() const; | 99 gpu::Capabilities GetCapabilities() const; |
| 86 gpu::CommandBuffer::State GetLastState() const; | 100 gpu::CommandBuffer::State GetLastState() const; |
| 87 gpu::CommandBufferNamespace GetNamespaceID() const { | 101 gpu::CommandBufferNamespace GetNamespaceID() const { |
| 88 return command_buffer_namespace_; | 102 return command_buffer_namespace_; |
| 89 } | 103 } |
| 90 gpu::CommandBufferId GetCommandBufferID() const { return command_buffer_id_; } | 104 gpu::CommandBufferId GetCommandBufferID() const { return command_buffer_id_; } |
| 91 gpu::SyncPointOrderData* sync_point_order_data() { | 105 gpu::SyncPointOrderData* sync_point_order_data() { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 base::TimeTicks last_idle_time_; | 160 base::TimeTicks last_idle_time_; |
| 147 | 161 |
| 148 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; | 162 base::WeakPtrFactory<CommandBufferDriver> weak_factory_; |
| 149 | 163 |
| 150 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); | 164 DISALLOW_COPY_AND_ASSIGN(CommandBufferDriver); |
| 151 }; | 165 }; |
| 152 | 166 |
| 153 } // namespace mus | 167 } // namespace mus |
| 154 | 168 |
| 155 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_H_ | 169 #endif // COMPONENTS_GLES2_COMMAND_BUFFER_DRIVER_H_ |
| OLD | NEW |