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_TEST_TEST_CONTEXT_PROVIDER_H_ | 5 #ifndef CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
6 #define CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 6 #define CC_TEST_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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // This returns the TestWebGraphicsContext3D but is valid to call | 49 // This returns the TestWebGraphicsContext3D but is valid to call |
50 // before the context is bound to a thread. This is needed to set up | 50 // before the context is bound to a thread. This is needed to set up |
51 // state on the test context before binding. Don't call | 51 // state on the test context before binding. Don't call |
52 // InitializeOnCurrentThread on the context returned from this method. | 52 // InitializeOnCurrentThread on the context returned from this method. |
53 TestWebGraphicsContext3D* UnboundTestContext3d(); | 53 TestWebGraphicsContext3D* UnboundTestContext3d(); |
54 | 54 |
55 TestContextSupport* support() { return &support_; } | 55 TestContextSupport* support() { return &support_; } |
56 | 56 |
57 void SetMemoryAllocation(const ManagedMemoryPolicy& policy); | 57 void SetMemoryAllocation(const ManagedMemoryPolicy& policy); |
58 | 58 |
59 void SetMaxTransferBufferUsageBytes(size_t max_transfer_buffer_usage_bytes); | |
60 | |
61 protected: | 59 protected: |
62 explicit TestContextProvider(scoped_ptr<TestWebGraphicsContext3D> context); | 60 explicit TestContextProvider(scoped_ptr<TestWebGraphicsContext3D> context); |
63 ~TestContextProvider() override; | 61 ~TestContextProvider() override; |
64 | 62 |
65 private: | 63 private: |
66 void OnLostContext(); | 64 void OnLostContext(); |
67 | 65 |
68 TestContextSupport support_; | 66 TestContextSupport support_; |
69 | 67 |
70 scoped_ptr<TestWebGraphicsContext3D> context3d_; | 68 scoped_ptr<TestWebGraphicsContext3D> context3d_; |
(...skipping 14 matching lines...) Expand all Loading... |
85 | 83 |
86 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; | 84 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; |
87 | 85 |
88 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); | 86 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); |
89 }; | 87 }; |
90 | 88 |
91 } // namespace cc | 89 } // namespace cc |
92 | 90 |
93 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 91 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
94 | 92 |
OLD | NEW |