Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: gpu/command_buffer/service/gpu_scheduler.h

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/service/gpu_scheduler.h
===================================================================
--- gpu/command_buffer/service/gpu_scheduler.h (revision 106500)
+++ gpu/command_buffer/service/gpu_scheduler.h (working copy)
@@ -5,9 +5,12 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_
#define GPU_COMMAND_BUFFER_SERVICE_GPU_SCHEDULER_H_
+#include <queue>
+
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/shared_memory.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/service/cmd_buffer_engine.h"
@@ -20,7 +23,9 @@
// a command buffer and forwarded to a command parser. TODO(apatrick): This
// class should not know about the decoder. Do not add additional dependencies
// on it.
-class GpuScheduler : public CommandBufferEngine {
+class GpuScheduler
+ : public CommandBufferEngine,
+ public base::SupportsWeakPtr<GpuScheduler> {
public:
GpuScheduler(CommandBuffer* command_buffer,
gles2::GLES2Decoder* decoder,
@@ -51,6 +56,8 @@
void SetCommandProcessedCallback(Callback0::Type* callback);
+ void DeferToFence(base::Closure task);
+
private:
// The GpuScheduler holds a weak reference to the CommandBuffer. The
@@ -71,6 +78,17 @@
// Greater than zero if this is waiting to be rescheduled before continuing.
int unscheduled_count_;
+ // The GpuScheduler will unschedule itself in the event that further GL calls
+ // are issued to it before all these fences have been crossed by the GPU.
+ struct UnscheduleFence {
+ UnscheduleFence();
+ ~UnscheduleFence();
+
+ uint32 fence;
+ base::Closure task;
+ };
+ std::queue<UnscheduleFence> unschedule_fences_;
+
scoped_ptr<Callback0::Type> scheduled_callback_;
scoped_ptr<Callback0::Type> command_processed_callback_;
};

Powered by Google App Engine
This is Rietveld 408576698