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

Unified Diff: cc/debug/test_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/debug/fake_web_graphics_context_3d.h ('k') | cc/debug/test_context_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/test_context_provider.h
diff --git a/cc/debug/test_context_provider.h b/cc/debug/test_context_provider.h
index 3a95bfbbcb762ea2c66144989ac1eb84bfa22b11..3e677049e6f9fb2dd1697b56f49861207b7b8a9e 100644
--- a/cc/debug/test_context_provider.h
+++ b/cc/debug/test_context_provider.h
@@ -26,6 +26,8 @@ class CC_EXPORT TestContextProvider
static scoped_refptr<TestContextProvider> Create();
static scoped_refptr<TestContextProvider> Create(
const CreateCallback& create_callback);
+ static scoped_refptr<TestContextProvider> Create(
+ scoped_ptr<TestWebGraphicsContext3D> context);
virtual bool BindToCurrentThread() OVERRIDE;
virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE;
@@ -33,15 +35,25 @@ class CC_EXPORT TestContextProvider
virtual void VerifyContexts() OVERRIDE;
virtual bool DestroyedOnMainThread() OVERRIDE;
virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE;
+ virtual void SetSwapBuffersCompleteCallback(
+ const SwapBuffersCompleteCallback& cb) OVERRIDE;
+ virtual void SetMemoryPolicyChangedCallback(
+ const MemoryPolicyChangedCallback& cb) OVERRIDE;
TestWebGraphicsContext3D* TestContext3d() { return context3d_.get(); }
+ void SetMemoryAllocation(const ManagedMemoryPolicy& policy,
+ bool discard_backbuffer_when_not_visible);
+
protected:
TestContextProvider();
virtual ~TestContextProvider();
bool InitializeOnMainThread(const CreateCallback& create_callback);
+ void OnLostContext();
+ void OnSwapBuffersComplete();
+
scoped_ptr<TestWebGraphicsContext3D> context3d_;
bool bound_;
@@ -50,6 +62,17 @@ class CC_EXPORT TestContextProvider
base::Lock destroyed_lock_;
bool destroyed_;
+
+ LostContextCallback lost_context_callback_;
+ SwapBuffersCompleteCallback swap_buffers_complete_callback_;
+ MemoryPolicyChangedCallback memory_policy_changed_callback_;
+
+ class LostContextCallbackProxy;
+ scoped_ptr<LostContextCallbackProxy> lost_context_callback_proxy_;
+
+ class SwapBuffersCompleteCallbackProxy;
+ scoped_ptr<SwapBuffersCompleteCallbackProxy>
+ swap_buffers_complete_callback_proxy_;
};
} // namespace cc
« no previous file with comments | « cc/debug/fake_web_graphics_context_3d.h ('k') | cc/debug/test_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698