Index: gpu/command_buffer/service/in_process_command_buffer.h |
diff --git a/gpu/command_buffer/service/in_process_command_buffer.h b/gpu/command_buffer/service/in_process_command_buffer.h |
index 18c919ff1ca4a552ec208f1b5585166aa966a5c7..8f1749b4e2c7b01271f32ecc1e33c4f92a7a2048 100644 |
--- a/gpu/command_buffer/service/in_process_command_buffer.h |
+++ b/gpu/command_buffer/service/in_process_command_buffer.h |
@@ -17,8 +17,13 @@ |
#include "gpu/gpu_export.h" |
#include "ui/gfx/gpu_memory_buffer.h" |
#include "ui/gfx/native_widget_types.h" |
+#include "ui/gl/gl_surface.h" |
#include "ui/gl/gpu_preference.h" |
+namespace base { |
+class SequenceChecker; |
+} |
+ |
namespace gfx { |
class GLContext; |
class GLImage; |
@@ -57,7 +62,11 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer { |
static void EnableVirtualizedContext(); |
- bool Initialize(bool is_offscreen, |
+ // If |surface| is not NULL, use it directly; in this case, the command |
+ // buffer gpu thread must be the same as the client thread. Otherwise create |
+ // a new GLSurface. |
+ bool Initialize(scoped_refptr<gfx::GLSurface> surface, |
+ bool is_offscreen, |
bool share_resources, |
gfx::AcceleratedWidget window, |
const gfx::Size& size, |
@@ -118,6 +127,7 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer { |
base::Closure WrapCallback(const base::Closure& callback); |
State GetStateFast(); |
void QueueTask(const base::Closure& task) { queue_->QueueTask(task); } |
+ void CheckSequencedThread(); |
// Callbacks: |
void OnContextLost(); |
@@ -147,6 +157,10 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer { |
base::WaitableEvent flush_event_; |
scoped_ptr<SchedulerClient> queue_; |
+ // Only used with explicit scheduling and the gpu thread is the same as |
+ // the client thread. |
+ scoped_ptr<base::SequenceChecker> sequence_checker_; |
+ |
DISALLOW_COPY_AND_ASSIGN(InProcessCommandBuffer); |
}; |