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 d2e103a890eab6fe3b605592605d6efbed178fc8..9bdbd49616d2797d382f53b900ae419802a4ddb7 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(); |
@@ -149,6 +159,10 @@ class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer { |
State state_after_last_flush_; |
base::Lock state_after_last_flush_lock_; |
+ // 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); |
}; |