| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 6 #define CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
| 15 #include "cc/debug/latency_info.h" | |
| 16 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
| 17 #include "content/common/gpu/gpu_memory_allocation.h" | 16 #include "content/common/gpu/gpu_memory_allocation.h" |
| 18 #include "content/common/gpu/gpu_memory_manager.h" | 17 #include "content/common/gpu/gpu_memory_manager.h" |
| 19 #include "content/common/gpu/gpu_memory_manager_client.h" | 18 #include "content/common/gpu/gpu_memory_manager_client.h" |
| 20 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 21 #include "gpu/command_buffer/common/constants.h" | 20 #include "gpu/command_buffer/common/constants.h" |
| 22 #include "gpu/command_buffer/service/command_buffer_service.h" | 21 #include "gpu/command_buffer/service/command_buffer_service.h" |
| 23 #include "gpu/command_buffer/service/context_group.h" | 22 #include "gpu/command_buffer/service/context_group.h" |
| 24 #include "gpu/command_buffer/service/gpu_scheduler.h" | 23 #include "gpu/command_buffer/service/gpu_scheduler.h" |
| 25 #include "ipc/ipc_listener.h" | 24 #include "ipc/ipc_listener.h" |
| 26 #include "ipc/ipc_sender.h" | 25 #include "ipc/ipc_sender.h" |
| 27 #include "media/base/video_decoder_config.h" | 26 #include "media/base/video_decoder_config.h" |
| 27 #include "ui/base/latency_info.h" |
| 28 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
| 29 #include "ui/gfx/size.h" | 29 #include "ui/gfx/size.h" |
| 30 #include "ui/gl/gl_surface.h" | 30 #include "ui/gl/gl_surface.h" |
| 31 #include "ui/gl/gpu_preference.h" | 31 #include "ui/gl/gpu_preference.h" |
| 32 #include "ui/surface/transport_dib.h" | 32 #include "ui/surface/transport_dib.h" |
| 33 | 33 |
| 34 namespace gpu { | 34 namespace gpu { |
| 35 namespace gles2 { | 35 namespace gles2 { |
| 36 class ImageManager; | 36 class ImageManager; |
| 37 class MailboxManager; | 37 class MailboxManager; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 public: | 52 public: |
| 53 class DestructionObserver { | 53 class DestructionObserver { |
| 54 public: | 54 public: |
| 55 // Called in Destroy(), before the context/surface are released. | 55 // Called in Destroy(), before the context/surface are released. |
| 56 virtual void OnWillDestroyStub() = 0; | 56 virtual void OnWillDestroyStub() = 0; |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 virtual ~DestructionObserver() {} | 59 virtual ~DestructionObserver() {} |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 typedef base::Callback<void(const cc::LatencyInfo&)> | 62 typedef base::Callback<void(const ui::LatencyInfo&)> |
| 63 LatencyInfoCallback; | 63 LatencyInfoCallback; |
| 64 | 64 |
| 65 GpuCommandBufferStub( | 65 GpuCommandBufferStub( |
| 66 GpuChannel* channel, | 66 GpuChannel* channel, |
| 67 GpuCommandBufferStub* share_group, | 67 GpuCommandBufferStub* share_group, |
| 68 const gfx::GLSurfaceHandle& handle, | 68 const gfx::GLSurfaceHandle& handle, |
| 69 gpu::gles2::MailboxManager* mailbox_manager, | 69 gpu::gles2::MailboxManager* mailbox_manager, |
| 70 gpu::gles2::ImageManager* image_manager, | 70 gpu::gles2::ImageManager* image_manager, |
| 71 const gfx::Size& size, | 71 const gfx::Size& size, |
| 72 const gpu::gles2::DisallowedFeatures& disallowed_features, | 72 const gpu::gles2::DisallowedFeatures& disallowed_features, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 bool OnWaitSyncPoint(uint32 sync_point); | 176 bool OnWaitSyncPoint(uint32 sync_point); |
| 177 void OnSyncPointRetired(); | 177 void OnSyncPointRetired(); |
| 178 void OnSignalSyncPoint(uint32 sync_point, uint32 id); | 178 void OnSignalSyncPoint(uint32 sync_point, uint32 id); |
| 179 void OnSignalSyncPointAck(uint32 id); | 179 void OnSignalSyncPointAck(uint32 id); |
| 180 | 180 |
| 181 void OnReceivedClientManagedMemoryStats(const GpuManagedMemoryStats& stats); | 181 void OnReceivedClientManagedMemoryStats(const GpuManagedMemoryStats& stats); |
| 182 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback); | 182 void OnSetClientHasMemoryAllocationChangedCallback(bool has_callback); |
| 183 | 183 |
| 184 void OnCommandProcessed(); | 184 void OnCommandProcessed(); |
| 185 void OnParseError(); | 185 void OnParseError(); |
| 186 void OnSetLatencyInfo(const cc::LatencyInfo& latency_info); | 186 void OnSetLatencyInfo(const ui::LatencyInfo& latency_info); |
| 187 | 187 |
| 188 void ReportState(); | 188 void ReportState(); |
| 189 | 189 |
| 190 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. | 190 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. |
| 191 void PutChanged(); | 191 void PutChanged(); |
| 192 | 192 |
| 193 // Poll the command buffer to execute work. | 193 // Poll the command buffer to execute work. |
| 194 void PollWork(); | 194 void PollWork(); |
| 195 | 195 |
| 196 // Whether this command buffer needs to be polled again in the future. | 196 // Whether this command buffer needs to be polled again in the future. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 size_t active_url_hash_; | 254 size_t active_url_hash_; |
| 255 | 255 |
| 256 size_t total_gpu_memory_; | 256 size_t total_gpu_memory_; |
| 257 | 257 |
| 258 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 258 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
| 259 }; | 259 }; |
| 260 | 260 |
| 261 } // namespace content | 261 } // namespace content |
| 262 | 262 |
| 263 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 263 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| OLD | NEW |