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

Unified Diff: gpu/command_buffer/client/context_support.h

Issue 2257533006: Free worker context resources on idle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-cleanup2
Patch Set: fixes Created 4 years, 4 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/client/context_support.h
diff --git a/gpu/command_buffer/client/context_support.h b/gpu/command_buffer/client/context_support.h
index ada0eb136e8bf18507f15582be1cba671b950e77..7a2c2634ed51561c51099d560a1510a97395bb75 100644
--- a/gpu/command_buffer/client/context_support.h
+++ b/gpu/command_buffer/client/context_support.h
@@ -10,6 +10,10 @@
#include "base/callback.h"
#include "ui/gfx/overlay_transform.h"
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace gfx {
class Rect;
class RectF;
@@ -35,6 +39,10 @@ class ContextSupport {
virtual void SetAggressivelyFreeResources(
bool aggressively_free_resources) = 0;
+ // Similar to temporarily calling SetAggressivelyFreeResources(true), this
danakj 2016/08/23 01:26:24 We now have 3 functions we can call to free things
+ // causes a one-time purge of all temporary resources.
+ virtual void TrimResources() = 0;
+
virtual void Swap() = 0;
virtual void PartialSwapBuffers(const gfx::Rect& sub_buffer) = 0;
virtual void CommitOverlayPlanes() = 0;
@@ -62,6 +70,16 @@ class ContextSupport {
std::unique_ptr<ScopedVisibility> visibility) = 0;
virtual bool AnyClientsVisible() const = 0;
+ class ScopedBusy {};
+ virtual std::unique_ptr<ScopedBusy> ClientBecameBusy() = 0;
+ virtual void ClientBecameNotBusy(std::unique_ptr<ScopedBusy> busy) = 0;
+
+ // A callback which will be invoked when the context is considered idle. The
+ // callback will be invoked on the provided callback_task_runner.
+ virtual void SetIdleCallback(
+ const base::Closure& callback,
+ scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner) = 0;
+
protected:
ContextSupport() {}
virtual ~ContextSupport() {}

Powered by Google App Engine
This is Rietveld 408576698