OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_GPU_TEST_CONTEXT_PROVIDER_FACTORY_H_ |
| 6 #define WEBKIT_GPU_TEST_CONTEXT_PROVIDER_FACTORY_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "webkit/gpu/webkit_gpu_export.h" |
| 10 #include "webkit/support/webkit_support.h" |
| 11 |
| 12 namespace cc { |
| 13 class ContextProvider; |
| 14 } |
| 15 |
| 16 namespace webkit { |
| 17 namespace gpu { |
| 18 class ContextProviderInProcess; |
| 19 |
| 20 class WEBKIT_GPU_EXPORT TestContextProviderFactory { |
| 21 public: |
| 22 static void SetUpFactoryForTesting( |
| 23 webkit_support::GraphicsContext3DImplementation implementation); |
| 24 |
| 25 // Each call to GetInstance should be matched with a call to DestroyInstance. |
| 26 // SetUpFactoryForTesting() must be called before GetInstance can be called. |
| 27 // The returned pointer is static and should not be deleted by the caller. |
| 28 static TestContextProviderFactory* GetInstance(); |
| 29 static void DestroyInstance(); |
| 30 |
| 31 scoped_refptr<cc::ContextProvider> OffscreenContextProviderForMainThread(); |
| 32 scoped_refptr<cc::ContextProvider> |
| 33 OffscreenContextProviderForCompositorThread(); |
| 34 |
| 35 private: |
| 36 TestContextProviderFactory(); |
| 37 ~TestContextProviderFactory(); |
| 38 |
| 39 scoped_refptr<webkit::gpu::ContextProviderInProcess> main_thread_; |
| 40 scoped_refptr<webkit::gpu::ContextProviderInProcess> compositor_thread_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(TestContextProviderFactory); |
| 43 }; |
| 44 |
| 45 } // namespace gpu |
| 46 } // namespace webkit |
| 47 |
| 48 #endif // WEBKIT_GPU_TEST_WEBKIT_CONTEXT_PROVIDER_FACTORY_H_ |
OLD | NEW |