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

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

Issue 12212100: Provide shared context to Platform API in renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseforreals Created 7 years, 9 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 | Annotate | Revision Log
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_FAKE_CONTEXT_PROVIDER_H_ 5 #ifndef CC_TEST_FAKE_CONTEXT_PROVIDER_H_
6 #define CC_TEST_FAKE_CONTEXT_PROVIDER_H_ 6 #define CC_TEST_FAKE_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/synchronization/lock.h" 10 #include "base/synchronization/lock.h"
11 #include "cc/context_provider.h" 11 #include "cc/context_provider.h"
12 12
13 namespace cc { 13 namespace cc {
14 class TestWebGraphicsContext3D; 14 class TestWebGraphicsContext3D;
15 15
16 class FakeContextProvider : public cc::ContextProvider { 16 class FakeContextProvider : public cc::ContextProvider {
17 public: 17 public:
18 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> 18 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)>
19 CreateCallback; 19 CreateCallback;
20 20
21 FakeContextProvider(); 21 FakeContextProvider();
22 explicit FakeContextProvider(const CreateCallback& create_callback); 22 explicit FakeContextProvider(const CreateCallback& create_callback);
23 23
24 virtual bool InitializeOnMainThread() OVERRIDE; 24 virtual bool InitializeOnMainThread() OVERRIDE;
25 virtual bool BindToCurrentThread() OVERRIDE; 25 virtual bool BindToCurrentThread() OVERRIDE;
26 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; 26 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE;
27 virtual class GrContext* GrContext() OVERRIDE; 27 virtual class GrContext* GrContext() OVERRIDE;
28 virtual void VerifyContexts() OVERRIDE; 28 virtual void VerifyContexts() OVERRIDE;
29 29 virtual bool DestroyedOnMainThread() OVERRIDE;
30 bool DestroyedOnMainThread();
31 30
32 protected: 31 protected:
33 virtual ~FakeContextProvider(); 32 virtual ~FakeContextProvider();
34 33
35 CreateCallback create_callback_; 34 CreateCallback create_callback_;
36 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; 35 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
37 36
38 base::Lock destroyed_lock_; 37 base::Lock destroyed_lock_;
39 bool destroyed_; 38 bool destroyed_;
40 }; 39 };
41 40
42 } // namespace cc 41 } // namespace cc
43 42
44 #endif // CC_TEST_FAKE_CONTEXT_PROVIDER_H_ 43 #endif // CC_TEST_FAKE_CONTEXT_PROVIDER_H_
45 44
OLDNEW
« no previous file with comments | « cc/context_provider.h ('k') | content/browser/in_process_webkit/browser_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698