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

Unified Diff: components/surfaces/surfaces_context_provider.cc

Issue 1150093003: Move GLES2, GPU & Surfaces into the ViewManager directory. This does not merge the applications, th… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 7 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 | « components/surfaces/surfaces_context_provider.h ('k') | components/surfaces/surfaces_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/surfaces/surfaces_context_provider.cc
diff --git a/components/surfaces/surfaces_context_provider.cc b/components/surfaces/surfaces_context_provider.cc
deleted file mode 100644
index 41ab76cd4842715a292df28f07fbd4315acc3edb..0000000000000000000000000000000000000000
--- a/components/surfaces/surfaces_context_provider.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright 2014 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 "components/surfaces/surfaces_context_provider.h"
-
-#include "base/logging.h"
-#include "third_party/mojo/src/mojo/public/cpp/environment/environment.h"
-
-namespace surfaces {
-
-SurfacesContextProvider::SurfacesContextProvider(
- mojo::ScopedMessagePipeHandle command_buffer_handle)
- : command_buffer_handle_(command_buffer_handle.Pass()),
- context_(nullptr),
- context_lost_(false) {
-}
-
-bool SurfacesContextProvider::BindToCurrentThread() {
- DCHECK(command_buffer_handle_.is_valid());
- context_ = MojoGLES2CreateContext(command_buffer_handle_.release().value(),
- &ContextLostThunk, this,
- mojo::Environment::GetDefaultAsyncWaiter());
- DCHECK(context_);
- return !!context_;
-}
-
-gpu::gles2::GLES2Interface* SurfacesContextProvider::ContextGL() {
- if (!context_)
- return nullptr;
- return static_cast<gpu::gles2::GLES2Interface*>(
- MojoGLES2GetGLES2Interface(context_));
-}
-
-gpu::ContextSupport* SurfacesContextProvider::ContextSupport() {
- if (!context_)
- return nullptr;
- return static_cast<gpu::ContextSupport*>(
- MojoGLES2GetContextSupport(context_));
-}
-
-class GrContext* SurfacesContextProvider::GrContext() {
- return NULL;
-}
-
-void SurfacesContextProvider::InvalidateGrContext(uint32_t state) {
-}
-
-cc::ContextProvider::Capabilities
-SurfacesContextProvider::ContextCapabilities() {
- return capabilities_;
-}
-
-void SurfacesContextProvider::SetupLock() {
-}
-
-base::Lock* SurfacesContextProvider::GetLock() {
- return &context_lock_;
-}
-
-bool SurfacesContextProvider::IsContextLost() {
- return context_lost_;
-}
-bool SurfacesContextProvider::DestroyedOnMainThread() {
- return !context_;
-}
-
-void SurfacesContextProvider::SetLostContextCallback(
- const LostContextCallback& lost_context_callback) {
- lost_context_callback_ = lost_context_callback;
-}
-
-SurfacesContextProvider::~SurfacesContextProvider() {
- if (context_)
- MojoGLES2DestroyContext(context_);
-}
-
-void SurfacesContextProvider::ContextLost() {
- context_lost_ = true;
- if (!lost_context_callback_.is_null())
- lost_context_callback_.Run();
-}
-
-} // namespace surfaces
« no previous file with comments | « components/surfaces/surfaces_context_provider.h ('k') | components/surfaces/surfaces_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698