Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_TEST_FAKE_CONTEXT_PROVIDER_H_ | |
| 6 #define CC_TEST_FAKE_CONTEXT_PROVIDER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/synchronization/lock.h" | |
| 11 #include "cc/context_provider.h" | |
| 12 | |
| 13 namespace cc { | |
| 14 class TestWebGraphicsContext3D; | |
| 15 | |
| 16 class FakeContextProvider : public cc::ContextProvider { | |
| 17 public: | |
| 18 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> | |
| 19 CreateCallback; | |
| 20 | |
| 21 FakeContextProvider(); | |
| 22 explicit FakeContextProvider(const CreateCallback& create_callback); | |
| 23 | |
| 24 virtual bool InitializeOnMainThread() OVERRIDE; | |
| 25 virtual bool BindToCurrentThread() OVERRIDE; | |
| 26 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; | |
| 27 virtual class GrContext* GrContext() OVERRIDE; | |
| 28 virtual void VerifyContexts() OVERRIDE; | |
| 29 | |
| 30 bool DestroyedOnMainThread(); | |
| 31 | |
| 32 protected: | |
| 33 virtual ~FakeContextProvider(); | |
| 34 | |
| 35 CreateCallback create_callback_; | |
| 36 bool destroyed_; | |
| 37 base::Lock destroyed_lock_; | |
|
piman
2013/02/22 02:54:07
nit: in this case it's pretty explicit, but it's u
danakj
2013/02/22 03:04:49
Ah I had started this way and then later moved all
| |
| 38 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | |
| 39 }; | |
| 40 | |
| 41 } // namespace cc | |
| 42 | |
| 43 #endif // CC_TEST_FAKE_CONTEXT_PROVIDER_H_ | |
| 44 | |
| OLD | NEW |