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

Unified Diff: ui/compositor/context_provider_from_context_factory.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 | « ui/compositor/context_provider_from_context_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/context_provider_from_context_factory.cc
diff --git a/ui/compositor/context_provider_from_context_factory.cc b/ui/compositor/context_provider_from_context_factory.cc
deleted file mode 100644
index 262998a886ad138285cf8878b9fb40c51d199bc8..0000000000000000000000000000000000000000
--- a/ui/compositor/context_provider_from_context_factory.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 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 "context_provider_from_context_factory.h"
-
-#include "base/logging.h"
-
-namespace ui {
-
-// static
-scoped_refptr<ContextProviderFromContextFactory>
-ContextProviderFromContextFactory::CreateForOffscreen(ContextFactory* factory) {
- scoped_refptr<ContextProviderFromContextFactory> provider =
- new ContextProviderFromContextFactory(factory);
- if (!provider->InitializeOnMainThread())
- return NULL;
- return provider;
-}
-
-ContextProviderFromContextFactory::ContextProviderFromContextFactory(
- ContextFactory* factory)
- : factory_(factory),
- destroyed_(false) {
-}
-
-ContextProviderFromContextFactory::~ContextProviderFromContextFactory() {
-}
-
-bool ContextProviderFromContextFactory::BindToCurrentThread() {
- DCHECK(context3d_);
- return context3d_->makeContextCurrent();
-}
-
-WebKit::WebGraphicsContext3D* ContextProviderFromContextFactory::Context3d() {
- DCHECK(context3d_);
- return context3d_.get();
-}
-
-class GrContext* ContextProviderFromContextFactory::GrContext() {
- DCHECK(context3d_);
-
- if (!gr_context_) {
- gr_context_.reset(
- new webkit::gpu::GrContextForWebGraphicsContext3D(context3d_.get()));
- }
- return gr_context_->get();
-}
-
-void ContextProviderFromContextFactory::VerifyContexts() {
- DCHECK(context3d_);
-
- if (context3d_->isContextLost()) {
- base::AutoLock lock(destroyed_lock_);
- destroyed_ = true;
- }
-}
-
-bool ContextProviderFromContextFactory::DestroyedOnMainThread() {
- base::AutoLock lock(destroyed_lock_);
- return destroyed_;
-}
-
-void ContextProviderFromContextFactory::SetLostContextCallback(
- const LostContextCallback& cb) {
- NOTIMPLEMENTED();
-}
-
-bool ContextProviderFromContextFactory::InitializeOnMainThread() {
- if (context3d_)
- return true;
- context3d_ = factory_->CreateOffscreenContext();
- return !!context3d_;
-}
-
-} // namespace ui
« no previous file with comments | « ui/compositor/context_provider_from_context_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698