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

Unified Diff: cc/output/context_provider.h

Issue 20185002: ContextProvider in OutputSurface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: contextprovider: don't access Context3d() in OutputSurface contructors, it's not bound yet Created 7 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 | « cc/layers/video_layer_impl.cc ('k') | cc/output/delegating_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/context_provider.h
diff --git a/cc/output/context_provider.h b/cc/output/context_provider.h
index 13b7df5948bc5995a50e33dcceaec7e59c6588db..7d61763d108899def1d1293992f9b7a993e80ff2 100644
--- a/cc/output/context_provider.h
+++ b/cc/output/context_provider.h
@@ -12,6 +12,7 @@ class GrContext;
namespace WebKit { class WebGraphicsContext3D; }
namespace cc {
+struct ManagedMemoryPolicy;
class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> {
public:
@@ -41,6 +42,20 @@ class ContextProvider : public base::RefCountedThreadSafe<ContextProvider> {
virtual void SetLostContextCallback(
const LostContextCallback& lost_context_callback) = 0;
+ // Sets a callback to be called when the context is lost. This should be
+ // called from the same thread that the context is bound to.
+ typedef base::Closure SwapBuffersCompleteCallback;
+ virtual void SetSwapBuffersCompleteCallback(
+ const SwapBuffersCompleteCallback& swap_buffers_complete_callback) = 0;
+
+ // Sets a callback to be called when the memory policy changes. This should be
+ // called from the same thread that the context is bound to.
+ typedef base::Callback<void(
+ const cc::ManagedMemoryPolicy& policy,
+ bool discard_backbuffer_when_not_visible)> MemoryPolicyChangedCallback;
+ virtual void SetMemoryPolicyChangedCallback(
+ const MemoryPolicyChangedCallback& memory_policy_changed_callback) = 0;
+
protected:
friend class base::RefCountedThreadSafe<ContextProvider>;
virtual ~ContextProvider() {}
« no previous file with comments | « cc/layers/video_layer_impl.cc ('k') | cc/output/delegating_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698