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> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // GpuMemoryManagerClient implementation: | 97 // GpuMemoryManagerClient implementation: |
98 gfx::Size GetSurfaceSize() const override; | 98 gfx::Size GetSurfaceSize() const override; |
99 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; | 99 gpu::gles2::MemoryTracker* GetMemoryTracker() const override; |
100 void SetMemoryAllocation(const gpu::MemoryAllocation& allocation) override; | 100 void SetMemoryAllocation(const gpu::MemoryAllocation& allocation) override; |
101 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; | 101 void SuggestHaveFrontBuffer(bool suggest_have_frontbuffer) override; |
102 bool GetTotalGpuMemory(uint64* bytes) override; | 102 bool GetTotalGpuMemory(uint64* bytes) override; |
103 | 103 |
104 // Whether this command buffer can currently handle IPC messages. | 104 // Whether this command buffer can currently handle IPC messages. |
105 bool IsScheduled(); | 105 bool IsScheduled(); |
106 | 106 |
107 // If the command buffer is pre-empted and cannot process commands. | |
108 bool IsPreempted() const { | |
109 return scheduler_.get() && scheduler_->IsPreempted(); | |
110 } | |
111 | |
112 // Whether there are commands in the buffer that haven't been processed. | 107 // Whether there are commands in the buffer that haven't been processed. |
113 bool HasUnprocessedCommands(); | 108 bool HasUnprocessedCommands(); |
114 | 109 |
115 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } | 110 gpu::gles2::GLES2Decoder* decoder() const { return decoder_.get(); } |
116 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } | 111 gpu::GpuScheduler* scheduler() const { return scheduler_.get(); } |
117 GpuChannel* channel() const { return channel_; } | 112 GpuChannel* channel() const { return channel_; } |
118 | 113 |
119 // Identifies the target surface. | 114 // Identifies the target surface. |
120 int32 surface_id() const { return surface_id_; } | 115 int32 surface_id() const { return surface_id_; } |
121 | 116 |
(...skipping 13 matching lines...) Expand all Loading... |
135 | 130 |
136 void SendCachedShader(const std::string& key, const std::string& shader); | 131 void SendCachedShader(const std::string& key, const std::string& shader); |
137 | 132 |
138 gfx::GLSurface* surface() const { return surface_.get(); } | 133 gfx::GLSurface* surface() const { return surface_.get(); } |
139 | 134 |
140 void AddDestructionObserver(DestructionObserver* observer); | 135 void AddDestructionObserver(DestructionObserver* observer); |
141 void RemoveDestructionObserver(DestructionObserver* observer); | 136 void RemoveDestructionObserver(DestructionObserver* observer); |
142 | 137 |
143 // Associates a sync point to this stub. When the stub is destroyed, it will | 138 // Associates a sync point to this stub. When the stub is destroyed, it will |
144 // retire all sync points that haven't been previously retired. | 139 // retire all sync points that haven't been previously retired. |
145 void AddSyncPoint(uint32 sync_point); | 140 void AddSyncPoint(uint32 sync_point, bool retire); |
146 | 141 |
147 void SetPreemptByFlag(scoped_refptr<gpu::PreemptionFlag> flag); | 142 void SetPreemptByFlag(scoped_refptr<gpu::PreemptionFlag> flag); |
148 | 143 |
149 void SetLatencyInfoCallback(const LatencyInfoCallback& callback); | 144 void SetLatencyInfoCallback(const LatencyInfoCallback& callback); |
150 | 145 |
151 void MarkContextLost(); | 146 void MarkContextLost(); |
152 | 147 |
153 const gpu::gles2::FeatureInfo* GetFeatureInfo() const; | 148 const gpu::gles2::FeatureInfo* GetFeatureInfo() const; |
154 | 149 |
155 void SendSwapBuffersCompleted( | 150 void SendSwapBuffersCompleted( |
(...skipping 19 matching lines...) Expand all Loading... |
175 void OnProduceFrontBuffer(const gpu::Mailbox& mailbox); | 170 void OnProduceFrontBuffer(const gpu::Mailbox& mailbox); |
176 void OnGetState(IPC::Message* reply_message); | 171 void OnGetState(IPC::Message* reply_message); |
177 void OnWaitForTokenInRange(int32 start, | 172 void OnWaitForTokenInRange(int32 start, |
178 int32 end, | 173 int32 end, |
179 IPC::Message* reply_message); | 174 IPC::Message* reply_message); |
180 void OnWaitForGetOffsetInRange(int32 start, | 175 void OnWaitForGetOffsetInRange(int32 start, |
181 int32 end, | 176 int32 end, |
182 IPC::Message* reply_message); | 177 IPC::Message* reply_message); |
183 void OnAsyncFlush(int32 put_offset, uint32 flush_count, | 178 void OnAsyncFlush(int32 put_offset, uint32 flush_count, |
184 const std::vector<ui::LatencyInfo>& latency_info); | 179 const std::vector<ui::LatencyInfo>& latency_info); |
185 void OnRescheduled(); | |
186 void OnRegisterTransferBuffer(int32 id, | 180 void OnRegisterTransferBuffer(int32 id, |
187 base::SharedMemoryHandle transfer_buffer, | 181 base::SharedMemoryHandle transfer_buffer, |
188 uint32 size); | 182 uint32 size); |
189 void OnDestroyTransferBuffer(int32 id); | 183 void OnDestroyTransferBuffer(int32 id); |
190 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message); | 184 void OnGetTransferBuffer(int32 id, IPC::Message* reply_message); |
191 | 185 |
192 void OnCreateVideoDecoder(media::VideoCodecProfile profile, | 186 void OnCreateVideoDecoder(media::VideoCodecProfile profile, |
193 int32 route_id, | 187 int32 route_id, |
194 IPC::Message* reply_message); | 188 IPC::Message* reply_message); |
195 void OnCreateVideoEncoder(media::VideoPixelFormat input_format, | 189 void OnCreateVideoEncoder(media::VideoPixelFormat input_format, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 size_t total_gpu_memory_; | 292 size_t total_gpu_memory_; |
299 scoped_ptr<WaitForCommandState> wait_for_token_; | 293 scoped_ptr<WaitForCommandState> wait_for_token_; |
300 scoped_ptr<WaitForCommandState> wait_for_get_offset_; | 294 scoped_ptr<WaitForCommandState> wait_for_get_offset_; |
301 | 295 |
302 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 296 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
303 }; | 297 }; |
304 | 298 |
305 } // namespace content | 299 } // namespace content |
306 | 300 |
307 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 301 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
OLD | NEW |