summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/common/sandbox_mac.mm4
-rw-r--r--content/gpu/gpu_child_thread.cc4
-rw-r--r--content/gpu/gpu_info_collector.cc31
3 files changed, 24 insertions, 15 deletions
diff --git a/content/common/sandbox_mac.mm b/content/common/sandbox_mac.mm
index 723a55a..59d4871 100644
--- a/content/common/sandbox_mac.mm
+++ b/content/common/sandbox_mac.mm
@@ -28,7 +28,7 @@ extern "C" {
#include "content/common/chrome_application_mac.h"
#include "content/common/content_switches.h"
#include "unicode/uchar.h"
-#include "ui/gfx/gl/gl_context.h"
+#include "ui/gfx/gl/gl_surface.h"
namespace {
@@ -252,7 +252,7 @@ void Sandbox::SandboxWarmup(SandboxProcessType sandbox_type) {
{
// Preload either the desktop GL or the osmesa so, depending on the
// --use-gl flag.
- gfx::GLContext::InitializeOneOff();
+ gfx::GLSurface::InitializeOneOff();
}
break;
diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc
index c9a5acd..8612a66 100644
--- a/content/gpu/gpu_child_thread.cc
+++ b/content/gpu/gpu_child_thread.cc
@@ -18,8 +18,8 @@
#include "content/gpu/gpu_info_collector.h"
#include "content/gpu/gpu_watchdog_thread.h"
#include "ipc/ipc_channel_handle.h"
-#include "ui/gfx/gl/gl_context.h"
#include "ui/gfx/gl/gl_implementation.h"
+#include "ui/gfx/gl/gl_surface.h"
#if defined(OS_MACOSX)
#include "content/common/sandbox_init_wrapper.h"
@@ -121,7 +121,7 @@ void GpuChildThread::OnInitialize() {
// Load the GL implementation and locate the bindings before starting the GPU
// watchdog because this can take a lot of time and the GPU watchdog might
// terminate the GPU process.
- if (!gfx::GLContext::InitializeOneOff()) {
+ if (!gfx::GLSurface::InitializeOneOff()) {
LOG(INFO) << "GLContext::InitializeOneOff failed";
MessageLoop::current()->Quit();
return;
diff --git a/content/gpu/gpu_info_collector.cc b/content/gpu/gpu_info_collector.cc
index 6b37c27..d3492fd 100644
--- a/content/gpu/gpu_info_collector.cc
+++ b/content/gpu/gpu_info_collector.cc
@@ -7,34 +7,45 @@
#include <string>
#include <vector>
+#include "base/memory/scoped_ptr.h"
#include "base/logging.h"
#include "base/string_number_conversions.h"
#include "base/string_piece.h"
#include "base/string_split.h"
#include "ui/gfx/gl/gl_bindings.h"
#include "ui/gfx/gl/gl_context.h"
+#include "ui/gfx/gl/gl_surface.h"
namespace {
// This creates an offscreen GL context for gl queries. Returned GLContext
// should be deleted in FinalizeGLContext.
gfx::GLContext* InitializeGLContext() {
- if (!gfx::GLContext::InitializeOneOff()) {
+ if (!gfx::GLSurface::InitializeOneOff()) {
LOG(ERROR) << "gfx::GLContext::InitializeOneOff() failed";
return NULL;
}
- gfx::GLContext* context = gfx::GLContext::CreateOffscreenGLContext(NULL);
- if (context == NULL) {
- LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLContext(NULL) failed";
+ scoped_ptr<gfx::GLSurface> surface(gfx::GLSurface::CreateOffscreenGLSurface(
+ gfx::Size(1, 1)));
+ if (!surface.get()) {
+ LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLSurface failed";
return NULL;
}
+
+ scoped_ptr<gfx::GLContext> context(gfx::GLContext::CreateGLContext(
+ surface.release(),
+ NULL));
+ if (!context.get()) {
+ LOG(ERROR) << "gfx::GLContext::CreateGLContext failed";
+ return NULL;
+ }
+
if (!context->MakeCurrent()) {
LOG(ERROR) << "gfx::GLContext::MakeCurrent() failed";
- context->Destroy();
- delete context;
return NULL;
}
- return context;
+
+ return context.release();
}
// This destroy and delete the GL context.
@@ -80,8 +91,8 @@ namespace gpu_info_collector {
bool CollectGraphicsInfoGL(GPUInfo* gpu_info) {
DCHECK(gpu_info);
- gfx::GLContext* context = InitializeGLContext();
- if (context == NULL)
+ scoped_ptr<gfx::GLContext> context(InitializeGLContext());
+ if (!context.get())
return false;
gpu_info->gl_renderer = GetGLString(GL_RENDERER);
@@ -93,8 +104,6 @@ bool CollectGraphicsInfoGL(GPUInfo* gpu_info) {
bool validVideoCardInfo = CollectVideoCardInfo(gpu_info);
bool validDriverInfo = CollectDriverInfoGL(gpu_info);
- FinalizeGLContext(&context);
-
return (validGLVersionInfo && validVideoCardInfo && validDriverInfo);
}