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

Side by Side Diff: content/gpu/in_process_gpu_thread.cc

Issue 1210073003: Revert of content: Fix single process support for native GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « content/gpu/in_process_gpu_thread.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/in_process_gpu_thread.h" 5 #include "content/gpu/in_process_gpu_thread.h"
6 6
7 #include "content/common/gpu/gpu_memory_buffer_factory.h"
8 #include "content/gpu/gpu_child_thread.h" 7 #include "content/gpu/gpu_child_thread.h"
9 #include "content/gpu/gpu_process.h" 8 #include "content/gpu/gpu_process.h"
10 9
11 namespace content { 10 namespace content {
12 11
13 InProcessGpuThread::InProcessGpuThread(const InProcessChildThreadParams& params) 12 InProcessGpuThread::InProcessGpuThread(const InProcessChildThreadParams& params)
14 : base::Thread("Chrome_InProcGpuThread"), 13 : base::Thread("Chrome_InProcGpuThread"),
15 params_(params), 14 params_(params),
16 gpu_process_(NULL), 15 gpu_process_(NULL) {
17 gpu_memory_buffer_factory_(GpuMemoryBufferFactory::Create(
18 GpuChildThread::GetGpuMemoryBufferFactoryType())) {
19 } 16 }
20 17
21 InProcessGpuThread::~InProcessGpuThread() { 18 InProcessGpuThread::~InProcessGpuThread() {
22 Stop(); 19 Stop();
23 } 20 }
24 21
25 void InProcessGpuThread::Init() { 22 void InProcessGpuThread::Init() {
26 gpu_process_ = new GpuProcess(); 23 gpu_process_ = new GpuProcess();
27 // The process object takes ownership of the thread object, so do not 24 // The process object takes ownership of the thread object, so do not
28 // save and delete the pointer. 25 // save and delete the pointer.
29 gpu_process_->set_main_thread( 26 gpu_process_->set_main_thread(new GpuChildThread(params_));
30 new GpuChildThread(params_, gpu_memory_buffer_factory_.get()));
31 } 27 }
32 28
33 void InProcessGpuThread::CleanUp() { 29 void InProcessGpuThread::CleanUp() {
34 SetThreadWasQuitProperly(true); 30 SetThreadWasQuitProperly(true);
35 delete gpu_process_; 31 delete gpu_process_;
36 } 32 }
37 33
38 base::Thread* CreateInProcessGpuThread( 34 base::Thread* CreateInProcessGpuThread(
39 const InProcessChildThreadParams& params) { 35 const InProcessChildThreadParams& params) {
40 return new InProcessGpuThread(params); 36 return new InProcessGpuThread(params);
41 } 37 }
42 38
43 } // namespace content 39 } // namespace content
OLDNEW
« no previous file with comments | « content/gpu/in_process_gpu_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698