| Index: ui/gl/gl_gl_api_implementation.cc
|
| diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
|
| index 7d2210a548e1efe5a13cdb44f081976d9a11d71d..3ef10a54dc51cd73f82aa9c15d88535e3f1f98fa 100644
|
| --- a/ui/gl/gl_gl_api_implementation.cc
|
| +++ b/ui/gl/gl_gl_api_implementation.cc
|
| @@ -521,14 +521,6 @@ const GLubyte* RealGLApi::glGetStringiFn(GLenum name, GLuint index) {
|
| return GLApiBase::glGetStringiFn(name, index);
|
| }
|
|
|
| -void RealGLApi::glFlushFn() {
|
| - GLApiBase::glFlushFn();
|
| -}
|
| -
|
| -void RealGLApi::glFinishFn() {
|
| - GLApiBase::glFinishFn();
|
| -}
|
| -
|
| void RealGLApi::InitializeFilteredExtensions() {
|
| if (disabled_exts_.size()) {
|
| filtered_exts_.clear();
|
| @@ -566,126 +558,4 @@ NoContextGLApi::NoContextGLApi() {
|
| NoContextGLApi::~NoContextGLApi() {
|
| }
|
|
|
| -VirtualGLApi::VirtualGLApi()
|
| - : real_context_(NULL),
|
| - current_context_(NULL) {
|
| -}
|
| -
|
| -VirtualGLApi::~VirtualGLApi() {
|
| -}
|
| -
|
| -void VirtualGLApi::Initialize(DriverGL* driver, GLContext* real_context) {
|
| - InitializeBase(driver);
|
| - real_context_ = real_context;
|
| -
|
| - DCHECK(real_context->IsCurrent(NULL));
|
| - extensions_ = real_context->GetExtensions();
|
| - extensions_vec_ = base::SplitString(extensions_, " ", base::TRIM_WHITESPACE,
|
| - base::SPLIT_WANT_ALL);
|
| -}
|
| -
|
| -bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
|
| - bool switched_contexts = g_current_gl_context_tls->Get() != this;
|
| - GLSurface* current_surface = GLSurface::GetCurrent();
|
| - if (switched_contexts || surface != current_surface) {
|
| - // MakeCurrent 'lite' path that avoids potentially expensive MakeCurrent()
|
| - // calls if the GLSurface uses the same underlying surface or renders to
|
| - // an FBO.
|
| - if (switched_contexts || !current_surface ||
|
| - !virtual_context->IsCurrent(surface)) {
|
| - if (!real_context_->MakeCurrent(surface)) {
|
| - return false;
|
| - }
|
| - }
|
| - }
|
| -
|
| - DCHECK_EQ(real_context_, GLContext::GetRealCurrent());
|
| - DCHECK(real_context_->IsCurrent(NULL));
|
| - DCHECK(virtual_context->IsCurrent(surface));
|
| -
|
| - if (switched_contexts || virtual_context != current_context_) {
|
| -#if DCHECK_IS_ON()
|
| - GLenum error = glGetErrorFn();
|
| - // Accepting a context loss error here enables using debug mode to work on
|
| - // context loss handling in virtual context mode.
|
| - // There should be no other errors from the previous context leaking into
|
| - // the new context.
|
| - DCHECK(error == GL_NO_ERROR || error == GL_CONTEXT_LOST_KHR) <<
|
| - "GL error was: " << error;
|
| -#endif
|
| -
|
| - // Set all state that is different from the real state
|
| - GLApi* temp = GetCurrentGLApi();
|
| - SetGLToRealGLApi();
|
| - if (virtual_context->GetGLStateRestorer()->IsInitialized()) {
|
| - GLStateRestorer* virtual_state = virtual_context->GetGLStateRestorer();
|
| - GLStateRestorer* current_state = current_context_ ?
|
| - current_context_->GetGLStateRestorer() :
|
| - nullptr;
|
| - if (switched_contexts || virtual_context != current_context_) {
|
| - if (current_state)
|
| - current_state->PauseQueries();
|
| - virtual_state->ResumeQueries();
|
| - }
|
| -
|
| - virtual_state->RestoreState(
|
| - (current_state && !switched_contexts) ? current_state : NULL);
|
| - }
|
| - SetGLApi(temp);
|
| - current_context_ = virtual_context;
|
| - }
|
| - SetGLApi(this);
|
| -
|
| - virtual_context->SetCurrent(surface);
|
| - if (!surface->OnMakeCurrent(virtual_context)) {
|
| - LOG(ERROR) << "Could not make GLSurface current.";
|
| - return false;
|
| - }
|
| - return true;
|
| -}
|
| -
|
| -void VirtualGLApi::OnReleaseVirtuallyCurrent(GLContext* virtual_context) {
|
| - if (current_context_ == virtual_context)
|
| - current_context_ = NULL;
|
| -}
|
| -
|
| -void VirtualGLApi::glGetIntegervFn(GLenum pname, GLint* params) {
|
| - switch (pname) {
|
| - case GL_NUM_EXTENSIONS:
|
| - *params = static_cast<GLint>(extensions_vec_.size());
|
| - break;
|
| - default:
|
| - driver_->fn.glGetIntegervFn(pname, params);
|
| - break;
|
| - }
|
| -}
|
| -
|
| -const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) {
|
| - switch (name) {
|
| - case GL_EXTENSIONS:
|
| - return reinterpret_cast<const GLubyte*>(extensions_.c_str());
|
| - default:
|
| - return driver_->fn.glGetStringFn(name);
|
| - }
|
| -}
|
| -
|
| -const GLubyte* VirtualGLApi::glGetStringiFn(GLenum name, GLuint index) {
|
| - switch (name) {
|
| - case GL_EXTENSIONS:
|
| - if (index >= extensions_vec_.size())
|
| - return NULL;
|
| - return reinterpret_cast<const GLubyte*>(extensions_vec_[index].c_str());
|
| - default:
|
| - return driver_->fn.glGetStringiFn(name, index);
|
| - }
|
| -}
|
| -
|
| -void VirtualGLApi::glFlushFn() {
|
| - GLApiBase::glFlushFn();
|
| -}
|
| -
|
| -void VirtualGLApi::glFinishFn() {
|
| - GLApiBase::glFinishFn();
|
| -}
|
| -
|
| } // namespace gl
|
|
|