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

Unified Diff: webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 135213003: Ensure GL initialization only happens once, and provide common init path (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initgl: Created 6 years, 11 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
« ui/gl/gl_surface.cc ('K') | « ui/keyboard/test/run_all_unittests.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
diff --git a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index 3cf44a19322e01bb8c754e4d63c11fc9142422e9..96bd1ae5e4453c39c454b358ca05fb21ef6fab78 100644
--- a/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -24,7 +24,7 @@
#include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
#include "ui/gfx/size.h"
-#include "ui/gl/gl_surface.h"
+#include "ui/gl/gl_implementation.h"
using gpu::gles2::GLES2Implementation;
using gpu::GLInProcessContext;
@@ -74,12 +74,9 @@ scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>
WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext(
const blink::WebGraphicsContext3D::Attributes& attributes,
gfx::AcceleratedWidget window) {
- scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context;
- if (gfx::GLSurface::InitializeOneOff()) {
- context.reset(new WebGraphicsContext3DInProcessCommandBufferImpl(
+ DCHECK_NE(gfx::GetGLImplementation(), gfx::kGLImplementationNone);
+ return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl(
scoped_ptr< ::gpu::GLInProcessContext>(), attributes, false, window));
- }
- return context.Pass();
}
// static
@@ -87,24 +84,21 @@ scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>
WebGraphicsContext3DInProcessCommandBufferImpl::CreateOffscreenContext(
const blink::WebGraphicsContext3D::Attributes& attributes) {
return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl(
- scoped_ptr< ::gpu::GLInProcessContext>(),
- attributes,
- true,
- gfx::kNullAcceleratedWidget))
- .Pass();
+ scoped_ptr< ::gpu::GLInProcessContext>(),
+ attributes,
+ true,
+ gfx::kNullAcceleratedWidget));
}
scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl>
WebGraphicsContext3DInProcessCommandBufferImpl::WrapContext(
scoped_ptr< ::gpu::GLInProcessContext> context,
const blink::WebGraphicsContext3D::Attributes& attributes) {
- return make_scoped_ptr(
- new WebGraphicsContext3DInProcessCommandBufferImpl(
- context.Pass(),
- attributes,
- true /* is_offscreen. Not used. */,
- gfx::kNullAcceleratedWidget /* window. Not used. */))
- .Pass();
+ return make_scoped_ptr(new WebGraphicsContext3DInProcessCommandBufferImpl(
+ context.Pass(),
+ attributes,
+ true /* is_offscreen. Not used. */,
+ gfx::kNullAcceleratedWidget /* window. Not used. */));
}
WebGraphicsContext3DInProcessCommandBufferImpl::
« ui/gl/gl_surface.cc ('K') | « ui/keyboard/test/run_all_unittests.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698