| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "base/threading/thread_checker.h" | 17 #include "base/threading/thread_checker.h" |
| 18 #include "cc/output/context_provider.h" | 18 #include "cc/output/context_provider.h" |
| 19 #include "cc/test/test_context_support.h" | 19 #include "cc/test/test_context_support.h" |
| 20 #include "gpu/command_buffer/client/gles2_interface_stub.h" | 20 #include "gpu/command_buffer/client/gles2_interface_stub.h" |
| 21 #include "skia/ext/refptr.h" | 21 #include "skia/ext/refptr.h" |
| 22 | 22 |
| 23 namespace skia_bindings { |
| 24 class GrContextForGLES2Interface; |
| 25 } |
| 26 |
| 23 namespace cc { | 27 namespace cc { |
| 24 class TestWebGraphicsContext3D; | 28 class TestWebGraphicsContext3D; |
| 25 class TestGLES2Interface; | 29 class TestGLES2Interface; |
| 26 | 30 |
| 27 class TestContextProvider : public ContextProvider { | 31 class TestContextProvider : public ContextProvider { |
| 28 public: | 32 public: |
| 29 typedef base::Callback<std::unique_ptr<TestWebGraphicsContext3D>(void)> | 33 typedef base::Callback<std::unique_ptr<TestWebGraphicsContext3D>(void)> |
| 30 CreateCallback; | 34 CreateCallback; |
| 31 | 35 |
| 32 static scoped_refptr<TestContextProvider> Create(); | 36 static scoped_refptr<TestContextProvider> Create(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 std::unique_ptr<TestWebGraphicsContext3D> context3d_; | 77 std::unique_ptr<TestWebGraphicsContext3D> context3d_; |
| 74 std::unique_ptr<TestGLES2Interface> context_gl_; | 78 std::unique_ptr<TestGLES2Interface> context_gl_; |
| 75 bool bound_; | 79 bool bound_; |
| 76 | 80 |
| 77 base::ThreadChecker main_thread_checker_; | 81 base::ThreadChecker main_thread_checker_; |
| 78 base::ThreadChecker context_thread_checker_; | 82 base::ThreadChecker context_thread_checker_; |
| 79 | 83 |
| 80 base::Lock context_lock_; | 84 base::Lock context_lock_; |
| 81 | 85 |
| 82 LostContextCallback lost_context_callback_; | 86 LostContextCallback lost_context_callback_; |
| 83 skia::RefPtr<class GrContext> gr_context_; | 87 std::unique_ptr<skia_bindings::GrContextForGLES2Interface> gr_context_; |
| 84 | 88 |
| 85 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; | 89 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; |
| 86 | 90 |
| 87 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); | 91 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); |
| 88 }; | 92 }; |
| 89 | 93 |
| 90 } // namespace cc | 94 } // namespace cc |
| 91 | 95 |
| 92 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ | 96 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ |
| 93 | 97 |
| OLD | NEW |