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

Unified Diff: cc/test/fake_context_provider.cc

Issue 21026005: aura: Remove CreateOffscreenContext from ui::ContextFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: offscreencontext: clang-format Created 7 years, 4 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
« no previous file with comments | « cc/test/fake_context_provider.h ('k') | cc/test/fake_layer_tree_host_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_context_provider.cc
diff --git a/cc/test/fake_context_provider.cc b/cc/test/fake_context_provider.cc
deleted file mode 100644
index d49fa8978ec7131ef84e9ad34a084ccc115aaa68..0000000000000000000000000000000000000000
--- a/cc/test/fake_context_provider.cc
+++ /dev/null
@@ -1,93 +0,0 @@
-// 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.
-
-#include "cc/test/fake_context_provider.h"
-
-#include "cc/test/test_web_graphics_context_3d.h"
-
-namespace cc {
-
-FakeContextProvider::FakeContextProvider()
- : bound_(false),
- destroyed_(false) {
- DCHECK(main_thread_checker_.CalledOnValidThread());
- context_thread_checker_.DetachFromThread();
-}
-
-FakeContextProvider::~FakeContextProvider() {
- DCHECK(main_thread_checker_.CalledOnValidThread() ||
- context_thread_checker_.CalledOnValidThread());
-}
-
-bool FakeContextProvider::InitializeOnMainThread(
- const CreateCallback& create_callback) {
- DCHECK(main_thread_checker_.CalledOnValidThread());
-
- DCHECK(!context3d_);
- if (create_callback.is_null())
- context3d_ = TestWebGraphicsContext3D::Create().Pass();
- else
- context3d_ = create_callback.Run();
- return context3d_;
-}
-
-bool FakeContextProvider::BindToCurrentThread() {
- DCHECK(context3d_);
-
- // This is called on the thread the context will be used.
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- if (bound_)
- return true;
-
- bound_ = true;
- if (!context3d_->makeContextCurrent()) {
- base::AutoLock lock(destroyed_lock_);
- destroyed_ = true;
- return false;
- }
- return true;
-}
-
-WebKit::WebGraphicsContext3D* FakeContextProvider::Context3d() {
- DCHECK(context3d_);
- DCHECK(bound_);
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- return context3d_.get();
-}
-class GrContext* FakeContextProvider::GrContext() {
- DCHECK(context3d_);
- DCHECK(bound_);
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- // TODO(danakj): Make a fake GrContext.
- return NULL;
-}
-
-void FakeContextProvider::VerifyContexts() {
- DCHECK(context3d_);
- DCHECK(bound_);
- DCHECK(context_thread_checker_.CalledOnValidThread());
-
- if (context3d_->isContextLost()) {
- base::AutoLock lock(destroyed_lock_);
- destroyed_ = true;
- }
-}
-
-bool FakeContextProvider::DestroyedOnMainThread() {
- DCHECK(main_thread_checker_.CalledOnValidThread());
-
- base::AutoLock lock(destroyed_lock_);
- return destroyed_;
-}
-
-void FakeContextProvider::SetLostContextCallback(
- const LostContextCallback& cb) {
- DCHECK(context_thread_checker_.CalledOnValidThread());
- NOTIMPLEMENTED();
-}
-
-} // namespace cc
« no previous file with comments | « cc/test/fake_context_provider.h ('k') | cc/test/fake_layer_tree_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698