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

Unified Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 470973002: gpu: Remove WebGraphicsContext3D::makeContextCurrent() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix in unittests Created 6 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
Index: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index 093fbe95f933468fc581ecb3fb150cbfd9011af7..9b8ca6a63a32cc46b80448599e9e544d99c5392f 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -28,7 +28,6 @@
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
-#include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/client/gles2_trace_implementation.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "gpu/command_buffer/common/constants.h"
@@ -65,28 +64,6 @@ scoped_refptr<WebGraphicsContext3DCommandBufferImpl::ShareGroup>
return it->second;
}
-// Singleton used to initialize and terminate the gles2 library.
-class GLES2Initializer {
- public:
- GLES2Initializer() {
- gles2::Initialize();
- }
-
- ~GLES2Initializer() {
- gles2::Terminate();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(GLES2Initializer);
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-base::LazyInstance<GLES2Initializer> g_gles2_initializer =
- LAZY_INSTANCE_INITIALIZER;
-
-////////////////////////////////////////////////////////////////////////////////
-
} // namespace anonymous
WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits::SharedMemoryLimits()
@@ -226,9 +203,6 @@ bool WebGraphicsContext3DCommandBufferImpl::InitializeCommandBuffer(
bool WebGraphicsContext3DCommandBufferImpl::CreateContext(bool onscreen) {
TRACE_EVENT0("gpu", "WebGfxCtx3DCmdBfrImpl::CreateContext");
- // Ensure the gles2 library is initialized first in a thread safe way.
- g_gles2_initializer.Get();
-
scoped_refptr<gpu::gles2::ShareGroup> gles2_share_group;
scoped_ptr<base::AutoLock> share_group_lock;
@@ -296,12 +270,11 @@ bool WebGraphicsContext3DCommandBufferImpl::CreateContext(bool onscreen) {
return true;
}
-bool WebGraphicsContext3DCommandBufferImpl::makeContextCurrent() {
+bool WebGraphicsContext3DCommandBufferImpl::InitializeOnCurrentThread() {
if (!MaybeInitializeGL()) {
DLOG(ERROR) << "Failed to initialize context.";
return false;
}
- gles2::SetGLContext(GetGLInterface());
if (gpu::error::IsError(command_buffer_->GetLastError())) {
LOG(ERROR) << "Context dead on arrival. Last error: "
<< command_buffer_->GetLastError();

Powered by Google App Engine
This is Rietveld 408576698