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/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/gpu/gpu_memory_manager.h" | 16 #include "content/common/gpu/gpu_memory_manager.h" |
17 #include "content/common/gpu/gpu_memory_manager_client.h" | |
18 #include "gpu/command_buffer/common/constants.h" | 17 #include "gpu/command_buffer/common/constants.h" |
19 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 18 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
20 #include "gpu/command_buffer/service/command_buffer_service.h" | 19 #include "gpu/command_buffer/service/command_buffer_service.h" |
21 #include "gpu/command_buffer/service/context_group.h" | 20 #include "gpu/command_buffer/service/context_group.h" |
22 #include "gpu/command_buffer/service/gpu_scheduler.h" | 21 #include "gpu/command_buffer/service/gpu_scheduler.h" |
23 #include "ipc/ipc_listener.h" | 22 #include "ipc/ipc_listener.h" |
24 #include "ipc/ipc_sender.h" | 23 #include "ipc/ipc_sender.h" |
25 #include "media/base/video_decoder_config.h" | 24 #include "media/base/video_decoder_config.h" |
26 #include "ui/events/latency_info.h" | 25 #include "ui/events/latency_info.h" |
27 #include "ui/gfx/geometry/size.h" | 26 #include "ui/gfx/geometry/size.h" |
(...skipping 20 matching lines...) Expand all Loading... | |
48 | 47 |
49 namespace content { | 48 namespace content { |
50 | 49 |
51 class GpuChannel; | 50 class GpuChannel; |
52 class GpuVideoDecodeAccelerator; | 51 class GpuVideoDecodeAccelerator; |
53 class GpuVideoEncodeAccelerator; | 52 class GpuVideoEncodeAccelerator; |
54 class GpuWatchdog; | 53 class GpuWatchdog; |
55 struct WaitForCommandState; | 54 struct WaitForCommandState; |
56 | 55 |
57 class GpuCommandBufferStub | 56 class GpuCommandBufferStub |
58 : public GpuMemoryManagerClient, | 57 : public IPC::Listener, |
59 public IPC::Listener, | |
60 public IPC::Sender, | 58 public IPC::Sender, |
61 public base::SupportsWeakPtr<GpuCommandBufferStub> { | 59 public base::SupportsWeakPtr<GpuCommandBufferStub> { |
62 public: | 60 public: |
63 class DestructionObserver { | 61 class DestructionObserver { |
64 public: | 62 public: |
65 // Called in Destroy(), before the context/surface are released. | 63 // Called in Destroy(), before the context/surface are released. |
66 virtual void OnWillDestroyStub() = 0; | 64 virtual void OnWillDestroyStub() = 0; |
67 | 65 |
68 protected: | 66 protected: |
69 virtual ~DestructionObserver() {} | 67 virtual ~DestructionObserver() {} |
(...skipping 23 matching lines...) Expand all Loading... | |
93 const GURL& active_url); | 91 const GURL& active_url); |
94 | 92 |
95 ~GpuCommandBufferStub() override; | 93 ~GpuCommandBufferStub() override; |
96 | 94 |
97 // IPC::Listener implementation: | 95 // IPC::Listener implementation: |
98 bool OnMessageReceived(const IPC::Message& message) override; | 96 bool OnMessageReceived(const IPC::Message& message) override; |
99 | 97 |
100 // IPC::Sender implementation: | 98 // IPC::Sender implementation: |
101 bool Send(IPC::Message* msg) override; | 99 bool Send(IPC::Message* msg) override; |
102 | 100 |
103 // GpuMemoryManagerClient implementation: | 101 gfx::Size GetSurfaceSize() const; |
piman
2015/11/10 23:34:48
This doesn't look like it's called any more. Remov
sohanjg
2015/11/13 07:30:44
Done.
| |
104 gfx::Size GetSurfaceSize() const override; | 102 gpu::gles2::MemoryTracker* GetMemoryTracker() const; |
105 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; | 103 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer); |
piman
2015/11/10 23:34:49
Same here.
sohanjg
2015/11/13 07:30:44
Done.
| |
106 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; | 104 bool GetTotalGpuMemory(uint64* bytes); |
piman
2015/11/10 23:34:48
Same here, and can remove total_gpu_memory_.
I th
sohanjg
2015/11/13 07:30:44
Done.
| |
107 bool GetTotalGpuMemory(uint64* bytes) override; | |
108 | 105 |
109 // Whether this command buffer can currently handle IPC messages. | 106 // Whether this command buffer can currently handle IPC messages. |
110 bool IsScheduled(); | 107 bool IsScheduled(); |
111 | 108 |
112 // Whether there are commands in the buffer that haven't been processed. | 109 // Whether there are commands in the buffer that haven't been processed. |
113 bool HasUnprocessedCommands(); | 110 bool HasUnprocessedCommands(); |
114 | 111 |
115 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 112 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
116 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } | 113 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } |
117 GpuChannel* channel() const { return channel_; } | 114 GpuChannel* channel() const { return channel_; } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 size_t total_gpu_memory_; | 299 size_t total_gpu_memory_; |
303 scoped_ptr<WaitForCommandState> wait_for_token_; | 300 scoped_ptr<WaitForCommandState> wait_for_token_; |
304 scoped_ptr<WaitForCommandState> wait_for_get_offset_; | 301 scoped_ptr<WaitForCommandState> wait_for_get_offset_; |
305 | 302 |
306 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 303 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
307 }; | 304 }; |
308 | 305 |
309 } // namespace content | 306 } // namespace content |
310 | 307 |
311 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 308 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |