| 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..9200aa3c9b0258f097925f38c5578639fe157d7b
|
| --- /dev/null
|
| +++ b/cc/test/fake_context_provider.h
|
| @@ -0,0 +1,42 @@
|
| +// 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 "ui/gl/context_provider.h"
|
| +
|
| +namespace cc {
|
| +class TestWebGraphicsContext3D;
|
| +
|
| +class FakeContextProvider : public ui::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 destroyed() const { return destroyed_; }
|
| +
|
| + protected:
|
| + virtual ~FakeContextProvider();
|
| +
|
| + CreateCallback create_callback_;
|
| + bool destroyed_;
|
| + scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
|
| +};
|
| +
|
| +} // namespace cc
|
| +
|
| +#endif // CC_TEST_FAKE_CONTEXT_PROVIDER_H_
|
| +
|
|
|