$OpenBSD: patch-content_gpu_gpu_main_cc,v 1.2 2015/02/15 19:51:28 robert Exp $
--- content/gpu/gpu_main.cc.orig.port	Wed Feb 11 08:15:35 2015
+++ content/gpu/gpu_main.cc	Sun Feb 15 10:55:08 2015
@@ -77,7 +77,7 @@ bool WarmUpSandbox(const CommandLine& command_line);
 bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info);
 #endif
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
 #if !defined(OS_CHROMEOS)
 bool CanAccessNvidiaDeviceFile();
 #endif
@@ -162,13 +162,13 @@ int GpuMain(const MainFunctionParams& parameters) {
     message_loop_type = base::MessageLoop::TYPE_UI;
   }
   base::MessageLoop main_message_loop(message_loop_type);
-#elif defined(OS_LINUX) && defined(USE_X11)
+#elif (defined(OS_BSD) || defined(OS_LINUX)) && defined(USE_X11)
   // We need a UI loop so that we can grab the Expose events. See GLSurfaceGLX
   // and https://crbug.com/326995.
   base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI);
   scoped_ptr<ui::PlatformEventSource> event_source =
       ui::PlatformEventSource::CreateDefault();
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_BSD)
   base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT);
 #elif defined(OS_MACOSX)
   // This is necessary for CoreAnimation layers hosted in the GPU process to be
@@ -216,7 +216,7 @@ int GpuMain(const MainFunctionParams& parameters) {
   // Temporarily disable DRI3 on desktop Linux.
   // The GPU process is crashing on DRI3-enabled desktop Linux systems.
   // TODO(jorgelo): remove this when crbug.com/415681 is fixed.
-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if (defined(OS_BSD) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
   {
     scoped_ptr<base::Environment> env(base::Environment::Create());
     env->SetVar("LIBGL_DRI3_DISABLE", "1");
@@ -245,6 +245,10 @@ int GpuMain(const MainFunctionParams& parameters) {
       initialized_sandbox = true;
     }
 #endif  // defined(OS_LINUX)
+#if defined(OS_BSD)
+    bool initialized_gl_context = false;
+    bool should_initialize_gl_context = false;
+#endif
 
     base::TimeTicks before_initialize_one_off = base::TimeTicks::Now();
 
@@ -292,7 +296,7 @@ int GpuMain(const MainFunctionParams& parameters) {
       }
 #endif
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
       initialized_gl_context = true;
 #if !defined(OS_CHROMEOS)
       if (gpu_info.gpu.vendor_id == 0x10de &&  // NVIDIA
@@ -327,14 +331,16 @@ int GpuMain(const MainFunctionParams& parameters) {
       watchdog_thread = NULL;
     }
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
     should_initialize_gl_context = !initialized_gl_context &&
                                    !dead_on_arrival;
 
+#if !defined(OS_BSD)
     if (!initialized_sandbox) {
       gpu_info.sandboxed = StartSandboxLinux(gpu_info, watchdog_thread.get(),
                                              should_initialize_gl_context);
     }
+#endif
 #elif defined(OS_WIN)
     gpu_info.sandboxed = StartSandboxWindows(parameters.sandbox_info);
 #elif defined(OS_MACOSX)
@@ -435,7 +441,7 @@ bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info) {
 }
 #endif
 
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_BSD)
 #if !defined(OS_CHROMEOS)
 bool CanAccessNvidiaDeviceFile() {
   bool res = true;
