Chromium Code Reviews| Index: cc/test/fake_context_provider.h |
| diff --git a/cc/test/fake_context_provider.h b/cc/test/fake_context_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bea05145788bdda342dda7a4971d61fcb62a35af |
| --- /dev/null |
| +++ b/cc/test/fake_context_provider.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 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 CC_TEST_FAKE_CONTEXT_PROVIDER_H_ |
| +#define CC_TEST_FAKE_CONTEXT_PROVIDER_H_ |
| + |
| +#include "base/callback.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/synchronization/lock.h" |
| +#include "cc/context_provider.h" |
| + |
| +namespace cc { |
| +class TestWebGraphicsContext3D; |
| + |
| +class FakeContextProvider : public cc::ContextProvider { |
| + public: |
| + typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> |
| + CreateCallback; |
| + |
| + FakeContextProvider(); |
| + explicit FakeContextProvider(const CreateCallback& create_callback); |
| + |
| + virtual bool InitializeOnMainThread() OVERRIDE; |
| + virtual bool BindToCurrentThread() OVERRIDE; |
| + virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| + virtual class GrContext* GrContext() OVERRIDE; |
| + virtual void VerifyContexts() OVERRIDE; |
| + |
| + bool DestroyedOnMainThread(); |
| + |
| + protected: |
| + virtual ~FakeContextProvider(); |
| + |
| + CreateCallback create_callback_; |
| + bool destroyed_; |
| + 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
|
| + scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
| +}; |
| + |
| +} // namespace cc |
| + |
| +#endif // CC_TEST_FAKE_CONTEXT_PROVIDER_H_ |
| + |