Index: webkit/gpu/test_context_provider_factory.h |
diff --git a/webkit/gpu/test_context_provider_factory.h b/webkit/gpu/test_context_provider_factory.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..db1258dd8b52c710c519aadac31899f708e2aad0 |
--- /dev/null |
+++ b/webkit/gpu/test_context_provider_factory.h |
@@ -0,0 +1,46 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef WEBKIT_GPU_TEST_CONTEXT_PROVIDER_FACTORY_H_ |
+#define WEBKIT_GPU_TEST_CONTEXT_PROVIDER_FACTORY_H_ |
+ |
+#include "base/memory/ref_counted.h" |
+#include "webkit/gpu/webkit_gpu_export.h" |
+#include "webkit/support/webkit_support.h" |
+ |
+namespace cc { |
+class ContextProvider; |
+} |
+ |
+namespace webkit { |
+namespace gpu { |
+class ContextProviderInProcess; |
+ |
+class WEBKIT_GPU_EXPORT TestContextProviderFactory { |
+ public: |
+ static void SetUpFactoryForTesting( |
+ webkit_support::GraphicsContext3DImplementation implementation); |
+ |
+ // SetUpFactoryForTesting() must be called before GetInstance can be called. |
+ // The returned pointer is static and should not be deleted by the caller. |
+ static TestContextProviderFactory* GetInstance(); |
+ |
+ scoped_refptr<cc::ContextProvider> OffscreenContextProviderForMainThread(); |
+ scoped_refptr<cc::ContextProvider> |
+ OffscreenContextProviderForCompositorThread(); |
+ |
+ private: |
+ TestContextProviderFactory(); |
+ ~TestContextProviderFactory(); |
+ |
+ scoped_refptr<webkit::gpu::ContextProviderInProcess> main_thread_; |
+ scoped_refptr<webkit::gpu::ContextProviderInProcess> compositor_thread_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(TestContextProviderFactory); |
+}; |
+ |
+} // namespace gpu |
+} // namespace webkit |
+ |
+#endif // WEBKIT_GPU_TEST_WEBKIT_CONTEXT_PROVIDER_FACTORY_H_ |