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

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

Issue 5317007: Add flow control between renderer and GPU processes, and, on Mac OS X,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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_processor.h
===================================================================
--- gpu/command_buffer/service/gpu_processor.h (revision 67289)
+++ gpu/command_buffer/service/gpu_processor.h (working copy)
@@ -61,6 +61,9 @@
virtual void ProcessCommands();
+ // Helper which causes a call to ProcessCommands to be scheduled later.
+ void ScheduleProcessCommands();
+
// Implementation of CommandBufferEngine.
virtual Buffer GetSharedMemoryBuffer(int32 shm_id);
virtual void set_token(int32 token);
@@ -85,6 +88,15 @@
Callback1<TransportDIB::Id>::Type* deallocator);
// Returns the id of the current IOSurface, or 0.
virtual uint64 GetSurfaceId();
+ // To prevent the GPU process from overloading the browser process,
+ // we need to track the number of swap buffers calls issued and
+ // acknowledged per on-screen (IOSurface-backed) context, and keep
+ // the GPU from getting too far ahead of the browser. Note that this
+ // is also predicated on a flow control mechanism between the
+ // renderer and GPU processes.
+ uint64 swap_buffers_count() const;
+ void set_acknowledged_swap_buffers_count(
+ uint64 acknowledged_swap_buffers_count);
#endif
// Sets a callback which is called when a SwapBuffers command is processed.
@@ -122,6 +134,8 @@
#if defined(OS_MACOSX)
scoped_ptr<AcceleratedSurface> surface_;
+ uint64 swap_buffers_count_;
+ uint64 acknowledged_swap_buffers_count_;
#endif
ScopedRunnableMethodFactory<GPUProcessor> method_factory_;

Powered by Google App Engine
This is Rietveld 408576698