| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_DEBUG_TEST_CONTEXT_PROVIDER_H_ | 5 #ifndef CC_DEBUG_TEST_CONTEXT_PROVIDER_H_ |
| 6 #define CC_DEBUG_TEST_CONTEXT_PROVIDER_H_ | 6 #define CC_DEBUG_TEST_CONTEXT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | 33 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| 34 virtual class GrContext* GrContext() OVERRIDE; | 34 virtual class GrContext* GrContext() OVERRIDE; |
| 35 virtual void VerifyContexts() OVERRIDE; | 35 virtual void VerifyContexts() OVERRIDE; |
| 36 virtual bool DestroyedOnMainThread() OVERRIDE; | 36 virtual bool DestroyedOnMainThread() OVERRIDE; |
| 37 virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE; | 37 virtual void SetLostContextCallback(const LostContextCallback& cb) OVERRIDE; |
| 38 virtual void SetSwapBuffersCompleteCallback( | 38 virtual void SetSwapBuffersCompleteCallback( |
| 39 const SwapBuffersCompleteCallback& cb) OVERRIDE; | 39 const SwapBuffersCompleteCallback& cb) OVERRIDE; |
| 40 virtual void SetMemoryPolicyChangedCallback( | 40 virtual void SetMemoryPolicyChangedCallback( |
| 41 const MemoryPolicyChangedCallback& cb) OVERRIDE; | 41 const MemoryPolicyChangedCallback& cb) OVERRIDE; |
| 42 | 42 |
| 43 TestWebGraphicsContext3D* TestContext3d() { return context3d_.get(); } | 43 TestWebGraphicsContext3D* TestContext3d(); |
| 44 |
| 45 // This returns the TestWebGraphicsContext3D but is valid to call |
| 46 // before the context is bound to a thread. This is needed to set up |
| 47 // state on the test context before binding. Don't call |
| 48 // makeContextCurrent on the context returned from this method. |
| 49 TestWebGraphicsContext3D* UnboundTestContext3d(); |
| 44 | 50 |
| 45 void SetMemoryAllocation(const ManagedMemoryPolicy& policy, | 51 void SetMemoryAllocation(const ManagedMemoryPolicy& policy, |
| 46 bool discard_backbuffer_when_not_visible); | 52 bool discard_backbuffer_when_not_visible); |
| 47 | 53 |
| 48 protected: | 54 protected: |
| 49 TestContextProvider(); | 55 TestContextProvider(); |
| 50 virtual ~TestContextProvider(); | 56 virtual ~TestContextProvider(); |
| 51 | 57 |
| 52 bool InitializeOnMainThread(const CreateCallback& create_callback); | 58 bool InitializeOnMainThread(const CreateCallback& create_callback); |
| 53 | 59 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 72 | 78 |
| 73 class SwapBuffersCompleteCallbackProxy; | 79 class SwapBuffersCompleteCallbackProxy; |
| 74 scoped_ptr<SwapBuffersCompleteCallbackProxy> | 80 scoped_ptr<SwapBuffersCompleteCallbackProxy> |
| 75 swap_buffers_complete_callback_proxy_; | 81 swap_buffers_complete_callback_proxy_; |
| 76 }; | 82 }; |
| 77 | 83 |
| 78 } // namespace cc | 84 } // namespace cc |
| 79 | 85 |
| 80 #endif // CC_DEBUG_TEST_CONTEXT_PROVIDER_H_ | 86 #endif // CC_DEBUG_TEST_CONTEXT_PROVIDER_H_ |
| 81 | 87 |
| OLD | NEW |