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

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: cc::ContextProvider 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..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_
+

Powered by Google App Engine
This is Rietveld 408576698