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

Side by Side Diff: trunk/src/content/gpu/gpu_child_thread.cc

Issue 149953003: Revert 247793 "Ensure GL initialization only happens once, and p..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/threading/worker_pool.h" 9 #include "base/threading/worker_pool.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 GpuChildThread::GpuChildThread(const std::string& channel_id) 58 GpuChildThread::GpuChildThread(const std::string& channel_id)
59 : ChildThread(channel_id), 59 : ChildThread(channel_id),
60 dead_on_arrival_(false), 60 dead_on_arrival_(false),
61 in_browser_process_(true) { 61 in_browser_process_(true) {
62 #if defined(OS_WIN) 62 #if defined(OS_WIN)
63 target_services_ = NULL; 63 target_services_ = NULL;
64 #endif 64 #endif
65 DCHECK( 65 DCHECK(
66 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) || 66 CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) ||
67 CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU)); 67 CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU));
68 #if !defined(OS_ANDROID)
69 // For single process and in-process GPU mode, we need to load and 68 // For single process and in-process GPU mode, we need to load and
70 // initialize the GL implementation and locate the GL entry points here. 69 // initialize the GL implementation and locate the GL entry points here.
71 // On Android, GLSurface::InitializeOneOff() is called from BrowserMainLoop 70 if (!gfx::GLSurface::InitializeOneOff()) {
72 // before getting here. crbug.com/326295 71 VLOG(1) << "gfx::GLSurface::InitializeOneOff()";
73 if (!gfx::GLSurface::InitializeOneOff()) 72 }
74 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed";
75 #endif
76 g_thread_safe_sender.Get() = thread_safe_sender(); 73 g_thread_safe_sender.Get() = thread_safe_sender();
77 } 74 }
78 75
79 GpuChildThread::~GpuChildThread() { 76 GpuChildThread::~GpuChildThread() {
80 } 77 }
81 78
82 void GpuChildThread::Shutdown() { 79 void GpuChildThread::Shutdown() {
83 ChildThread::Shutdown(); 80 ChildThread::Shutdown();
84 logging::SetLogMessageHandler(NULL); 81 logging::SetLogMessageHandler(NULL);
85 } 82 }
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 // the future posting of tasks to the message loop. 231 // the future posting of tasks to the message loop.
235 if (watchdog_thread_->message_loop()) 232 if (watchdog_thread_->message_loop())
236 watchdog_thread_->PostAcknowledge(); 233 watchdog_thread_->PostAcknowledge();
237 // Prevent rearming. 234 // Prevent rearming.
238 watchdog_thread_->Stop(); 235 watchdog_thread_->Stop();
239 } 236 }
240 } 237 }
241 238
242 } // namespace content 239 } // namespace content
243 240
OLDNEW
« no previous file with comments | « trunk/src/content/common/gpu/client/gl_helper_unittest.cc ('k') | trunk/src/content/gpu/gpu_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698