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 // SetUpFactoryForTesting() must be called before GetInstance can be called. |
| 26 // The returned pointer is static and should not be deleted by the caller. |
| 27 static TestContextProviderFactory* GetInstance(); |
| 28 |
| 29 scoped_refptr<cc::ContextProvider> OffscreenContextProviderForMainThread(); |
| 30 scoped_refptr<cc::ContextProvider> |
| 31 OffscreenContextProviderForCompositorThread(); |
| 32 |
| 33 private: |
| 34 TestContextProviderFactory(); |
| 35 ~TestContextProviderFactory(); |
| 36 |
| 37 scoped_refptr<webkit::gpu::ContextProviderInProcess> main_thread_; |
| 38 scoped_refptr<webkit::gpu::ContextProviderInProcess> compositor_thread_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(TestContextProviderFactory); |
| 41 }; |
| 42 |
| 43 } // namespace gpu |
| 44 } // namespace webkit |
| 45 |
| 46 #endif // WEBKIT_GPU_TEST_WEBKIT_CONTEXT_PROVIDER_FACTORY_H_ |
OLD | NEW |