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 "ui/gl/context_provider.h" |
| 11 |
| 12 namespace cc { |
| 13 class TestWebGraphicsContext3D; |
| 14 |
| 15 class FakeContextProvider : public ui::ContextProvider { |
| 16 public: |
| 17 typedef base::Callback<scoped_ptr<TestWebGraphicsContext3D>(void)> |
| 18 CreateCallback; |
| 19 |
| 20 FakeContextProvider(); |
| 21 explicit FakeContextProvider(const CreateCallback& create_callback); |
| 22 |
| 23 virtual bool InitializeOnMainThread() OVERRIDE; |
| 24 virtual bool BindToCurrentThread() OVERRIDE; |
| 25 virtual WebKit::WebGraphicsContext3D* Context3d() OVERRIDE; |
| 26 virtual class GrContext* GrContext() OVERRIDE; |
| 27 virtual void VerifyContexts() OVERRIDE; |
| 28 |
| 29 bool destroyed() const { return destroyed_; } |
| 30 |
| 31 protected: |
| 32 virtual ~FakeContextProvider(); |
| 33 |
| 34 CreateCallback create_callback_; |
| 35 bool destroyed_; |
| 36 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
| 37 }; |
| 38 |
| 39 } // namespace cc |
| 40 |
| 41 #endif // CC_TEST_FAKE_CONTEXT_PROVIDER_H_ |
| 42 |
OLD | NEW |