| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ipc/ipc_listener.h" | 27 #include "ipc/ipc_listener.h" |
| 28 #include "ipc/ipc_sender.h" | 28 #include "ipc/ipc_sender.h" |
| 29 #include "media/video/video_decode_accelerator.h" | 29 #include "media/video/video_decode_accelerator.h" |
| 30 #include "ui/events/latency_info.h" | 30 #include "ui/events/latency_info.h" |
| 31 #include "ui/gfx/geometry/size.h" | 31 #include "ui/gfx/geometry/size.h" |
| 32 #include "ui/gfx/gpu_memory_buffer.h" | 32 #include "ui/gfx/gpu_memory_buffer.h" |
| 33 #include "ui/gfx/native_widget_types.h" | 33 #include "ui/gfx/native_widget_types.h" |
| 34 #include "ui/gfx/swap_result.h" | 34 #include "ui/gfx/swap_result.h" |
| 35 #include "ui/gl/gl_surface.h" | 35 #include "ui/gl/gl_surface.h" |
| 36 #include "ui/gl/gpu_preference.h" | 36 #include "ui/gl/gpu_preference.h" |
| 37 #include "url/gurl.h" | |
| 38 | 37 |
| 39 namespace gpu { | 38 namespace gpu { |
| 40 struct Mailbox; | 39 struct Mailbox; |
| 41 struct SyncToken; | 40 struct SyncToken; |
| 42 class SyncPointClient; | 41 class SyncPointClient; |
| 43 class SyncPointManager; | 42 class SyncPointManager; |
| 44 class ValueStateMap; | 43 class ValueStateMap; |
| 45 namespace gles2 { | 44 namespace gles2 { |
| 46 class MailboxManager; | 45 class MailboxManager; |
| 47 class SubscriptionRefSet; | 46 class SubscriptionRefSet; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 gpu::gles2::SubscriptionRefSet* subscription_ref_set, | 85 gpu::gles2::SubscriptionRefSet* subscription_ref_set, |
| 87 gpu::ValueStateMap* pending_valuebuffer_state, | 86 gpu::ValueStateMap* pending_valuebuffer_state, |
| 88 const gfx::Size& size, | 87 const gfx::Size& size, |
| 89 const gpu::gles2::DisallowedFeatures& disallowed_features, | 88 const gpu::gles2::DisallowedFeatures& disallowed_features, |
| 90 const std::vector<int32_t>& attribs, | 89 const std::vector<int32_t>& attribs, |
| 91 gfx::GpuPreference gpu_preference, | 90 gfx::GpuPreference gpu_preference, |
| 92 int32_t stream_id, | 91 int32_t stream_id, |
| 93 int32_t route_id, | 92 int32_t route_id, |
| 94 bool offscreen, | 93 bool offscreen, |
| 95 GpuWatchdog* watchdog, | 94 GpuWatchdog* watchdog, |
| 96 const GURL& active_url); | 95 const std::string& active_url); |
| 97 | 96 |
| 98 ~GpuCommandBufferStub() override; | 97 ~GpuCommandBufferStub() override; |
| 99 | 98 |
| 100 // IPC::Listener implementation: | 99 // IPC::Listener implementation: |
| 101 bool OnMessageReceived(const IPC::Message& message) override; | 100 bool OnMessageReceived(const IPC::Message& message) override; |
| 102 | 101 |
| 103 // IPC::Sender implementation: | 102 // IPC::Sender implementation: |
| 104 bool Send(IPC::Message* msg) override; | 103 bool Send(IPC::Message* msg) override; |
| 105 | 104 |
| 106 gpu::gles2::MemoryTracker* GetMemoryTracker() const; | 105 gpu::gles2::MemoryTracker* GetMemoryTracker() const; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 void OnCreateImage(const GpuCommandBufferMsg_CreateImage_Params& params); | 208 void OnCreateImage(const GpuCommandBufferMsg_CreateImage_Params& params); |
| 210 void OnDestroyImage(int32_t id); | 209 void OnDestroyImage(int32_t id); |
| 211 void OnCreateStreamTexture(uint32_t texture_id, | 210 void OnCreateStreamTexture(uint32_t texture_id, |
| 212 int32_t stream_id, | 211 int32_t stream_id, |
| 213 bool* succeeded); | 212 bool* succeeded); |
| 214 | 213 |
| 215 void OnCommandProcessed(); | 214 void OnCommandProcessed(); |
| 216 void OnParseError(); | 215 void OnParseError(); |
| 217 void OnSchedulingChanged(bool scheduled); | 216 void OnSchedulingChanged(bool scheduled); |
| 218 | 217 |
| 218 // Shortcuts the expensive call to SetActiveURL when |url| is empty or |
| 219 // |url_hash| matches the current active URL. |
| 220 void FastSetActiveURL(const std::string& url, size_t url_hash); |
| 221 |
| 219 void ReportState(); | 222 void ReportState(); |
| 220 | 223 |
| 221 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. | 224 // Wrapper for GpuScheduler::PutChanged that sets the crash report URL. |
| 222 void PutChanged(); | 225 void PutChanged(); |
| 223 | 226 |
| 224 // Poll the command buffer to execute work. | 227 // Poll the command buffer to execute work. |
| 225 void PollWork(); | 228 void PollWork(); |
| 226 void PerformWork(); | 229 void PerformWork(); |
| 227 | 230 |
| 228 // Schedule processing of delayed work. This updates the time at which | 231 // Schedule processing of delayed work. This updates the time at which |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 bool waiting_for_sync_point_; | 281 bool waiting_for_sync_point_; |
| 279 | 282 |
| 280 base::TimeTicks process_delayed_work_time_; | 283 base::TimeTicks process_delayed_work_time_; |
| 281 uint32_t previous_processed_num_; | 284 uint32_t previous_processed_num_; |
| 282 base::TimeTicks last_idle_time_; | 285 base::TimeTicks last_idle_time_; |
| 283 | 286 |
| 284 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; | 287 scoped_refptr<gpu::PreemptionFlag> preemption_flag_; |
| 285 | 288 |
| 286 LatencyInfoCallback latency_info_callback_; | 289 LatencyInfoCallback latency_info_callback_; |
| 287 | 290 |
| 288 GURL active_url_; | 291 std::string active_url_; |
| 289 size_t active_url_hash_; | 292 size_t active_url_hash_; |
| 290 | 293 |
| 291 scoped_ptr<WaitForCommandState> wait_for_token_; | 294 scoped_ptr<WaitForCommandState> wait_for_token_; |
| 292 scoped_ptr<WaitForCommandState> wait_for_get_offset_; | 295 scoped_ptr<WaitForCommandState> wait_for_get_offset_; |
| 293 | 296 |
| 294 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); | 297 DISALLOW_COPY_AND_ASSIGN(GpuCommandBufferStub); |
| 295 }; | 298 }; |
| 296 | 299 |
| 297 } // namespace content | 300 } // namespace content |
| 298 | 301 |
| 299 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ | 302 #endif // CONTENT_COMMON_GPU_GPU_COMMAND_BUFFER_STUB_H_ |
| OLD | NEW |