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

Unified Diff: cc/test/fake_context_provider.h

Issue 12212007: cc: Route offscreen context creation for compositor to the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
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..f7c18398695c0b2b7d2c4872eb30f37ae90a07d6
--- /dev/null
+++ b/cc/test/fake_context_provider.h
@@ -0,0 +1,45 @@
+// 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_;
+ scoped_ptr<WebKit::WebGraphicsContext3D> context3d_;
+
+ base::Lock destroyed_lock_;
+ bool destroyed_;
+};
+
+} // namespace cc
+
+#endif // CC_TEST_FAKE_CONTEXT_PROVIDER_H_
+

Powered by Google App Engine
This is Rietveld 408576698