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

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

Issue 2257533006: Free worker context resources on idle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-cleanup2
Patch Set: rebase 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
« no previous file with comments | « gpu/command_buffer/client/context_support.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.h
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index b997ea13f1b44c9edd7156360371c1ab23174da2..2a966fa2494472b4b003115adfa5283e85629925 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -212,6 +212,10 @@ class GLES2_IMPL_EXPORT GLES2Implementation
std::unique_ptr<ScopedVisibility> visibility) override;
bool AnyClientsVisible() const override;
+ std::unique_ptr<ScopedBusy> ClientBecameBusy() override;
+ void ClientBecameNotBusy(std::unique_ptr<ScopedBusy> busy) override;
+ void SetIdleCallback(const base::Closure& callback) override;
+
// TODO(danakj): Move to ContextSupport once ContextProvider doesn't need to
// intercept it.
void SetLostContextCallback(const base::Closure& callback);
@@ -696,6 +700,9 @@ class GLES2_IMPL_EXPORT GLES2Implementation
PixelStoreParams GetUnpackParameters(Dimension dimension);
+ void RunIdleCallback(uint32_t callback_generation) const;
+ void CancelIdleCallback();
+
GLES2Util util_;
GLES2CmdHelper* helper_;
TransferBufferInterface* transfer_buffer_;
@@ -823,10 +830,19 @@ class GLES2_IMPL_EXPORT GLES2Implementation
base::Closure lost_context_callback_;
bool lost_context_callback_run_ = false;
+ // |idle_lock_| must be held while accessing |idle_callback_|, |is_idle_| or
+ // |current_idle_callback_generation_|.
+ mutable base::Lock idle_lock_;
+ base::Closure idle_callback_;
+ bool is_idle_ = true;
+ uint32_t current_idle_callback_generation_ = 0;
+
int current_trace_stack_;
GpuControl* gpu_control_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+
Capabilities capabilities_;
// Flag to indicate whether the implementation can retain resources, or
« no previous file with comments | « gpu/command_buffer/client/context_support.h ('k') | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698