Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: cc/test/test_context_provider.h

Issue 1336733002: Re-land: cc: Implement shared worker contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostClientTakeAwayOutputSurface test. Content provider is always destroyed on the clie… Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/test_context_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/synchronization/lock.h" 11 #include "base/synchronization/lock.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "cc/output/context_provider.h" 13 #include "cc/output/context_provider.h"
14 #include "cc/test/test_context_support.h" 14 #include "cc/test/test_context_support.h"
15 #include "gpu/command_buffer/client/gles2_interface_stub.h" 15 #include "gpu/command_buffer/client/gles2_interface_stub.h"
16 #include "skia/ext/refptr.h" 16 #include "skia/ext/refptr.h"
17 17
18 namespace cc { 18 namespace cc {
19 class TestWebGraphicsContext3D; 19 class TestWebGraphicsContext3D;
20 class TestGLES2Interface; 20 class TestGLES2Interface;
21 21
22 class TestContextProvider : public ContextProvider { 22 class TestContextProvider : public ContextProvider {
23 public: 23 public:
24 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> 24 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)>
25 CreateCallback; 25 CreateCallback;
26 26
27 static scoped_refptr<TestContextProvider> Create(); 27 static scoped_refptr<TestContextProvider> Create();
28 // Creates a worker context provider that can be used on any thread. This is
29 // equivalent to: Create(); BindToCurrentThread(); SetupLock().
30 static scoped_refptr<TestContextProvider> CreateWorker();
28 static scoped_refptr<TestContextProvider> Create( 31 static scoped_refptr<TestContextProvider> Create(
29 scoped_ptr<TestWebGraphicsContext3D> context); 32 scoped_ptr<TestWebGraphicsContext3D> context);
30 33
31 bool BindToCurrentThread() override; 34 bool BindToCurrentThread() override;
32 void DetachFromThread() override; 35 void DetachFromThread() override;
33 Capabilities ContextCapabilities() override; 36 Capabilities ContextCapabilities() override;
34 gpu::gles2::GLES2Interface* ContextGL() override; 37 gpu::gles2::GLES2Interface* ContextGL() override;
35 gpu::ContextSupport* ContextSupport() override; 38 gpu::ContextSupport* ContextSupport() override;
36 class GrContext* GrContext() override; 39 class GrContext* GrContext() override;
37 void InvalidateGrContext(uint32_t state) override; 40 void InvalidateGrContext(uint32_t state) override;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 88
86 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_; 89 base::WeakPtrFactory<TestContextProvider> weak_ptr_factory_;
87 90
88 DISALLOW_COPY_AND_ASSIGN(TestContextProvider); 91 DISALLOW_COPY_AND_ASSIGN(TestContextProvider);
89 }; 92 };
90 93
91 } // namespace cc 94 } // namespace cc
92 95
93 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_ 96 #endif // CC_TEST_TEST_CONTEXT_PROVIDER_H_
94 97
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/test_context_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698