Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "chrome/gpu/gpu_channel.h" | 9 #include "chrome/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 GpuChannel::GpuChannel(GpuThread* gpu_thread, | 25 GpuChannel::GpuChannel(GpuThread* gpu_thread, |
| 26 int renderer_id) | 26 int renderer_id) |
| 27 : gpu_thread_(gpu_thread), | 27 : gpu_thread_(gpu_thread), |
| 28 renderer_id_(renderer_id), | 28 renderer_id_(renderer_id), |
| 29 renderer_process_(NULL), | 29 renderer_process_(NULL), |
| 30 renderer_pid_(NULL) { | 30 renderer_pid_(NULL) { |
| 31 DCHECK(gpu_thread); | 31 DCHECK(gpu_thread); |
| 32 DCHECK(renderer_id); | 32 DCHECK(renderer_id); |
| 33 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 33 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 34 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); | 34 log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages); |
| 35 disallowed_extensions_.multisampling = command_line->HasSwitch(switches::kDisa bleGLMultisampling); | |
|
zmo
2011/03/07 23:34:29
here also: 80 per line.
| |
| 35 } | 36 } |
| 36 | 37 |
| 37 GpuChannel::~GpuChannel() { | 38 GpuChannel::~GpuChannel() { |
| 38 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
| 39 if (renderer_process_) | 40 if (renderer_process_) |
| 40 CloseHandle(renderer_process_); | 41 CloseHandle(renderer_process_); |
| 41 #endif | 42 #endif |
| 42 } | 43 } |
| 43 | 44 |
| 44 bool GpuChannel::OnMessageReceived(const IPC::Message& message) { | 45 bool GpuChannel::OnMessageReceived(const IPC::Message& message) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 void GpuChannel::CreateViewCommandBuffer( | 89 void GpuChannel::CreateViewCommandBuffer( |
| 89 gfx::PluginWindowHandle window, | 90 gfx::PluginWindowHandle window, |
| 90 int32 render_view_id, | 91 int32 render_view_id, |
| 91 const GPUCreateCommandBufferConfig& init_params, | 92 const GPUCreateCommandBufferConfig& init_params, |
| 92 int32* route_id) { | 93 int32* route_id) { |
| 93 *route_id = MSG_ROUTING_NONE; | 94 *route_id = MSG_ROUTING_NONE; |
| 94 | 95 |
| 95 #if defined(ENABLE_GPU) | 96 #if defined(ENABLE_GPU) |
| 96 *route_id = GenerateRouteID(); | 97 *route_id = GenerateRouteID(); |
| 97 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 98 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
| 98 this, window, NULL, gfx::Size(), init_params.allowed_extensions, | 99 this, window, NULL, gfx::Size(), disallowed_extensions_, |
| 100 init_params.allowed_extensions, | |
| 99 init_params.attribs, 0, *route_id, renderer_id_, render_view_id)); | 101 init_params.attribs, 0, *route_id, renderer_id_, render_view_id)); |
| 100 router_.AddRoute(*route_id, stub.get()); | 102 router_.AddRoute(*route_id, stub.get()); |
| 101 stubs_.AddWithID(stub.release(), *route_id); | 103 stubs_.AddWithID(stub.release(), *route_id); |
| 102 #endif // ENABLE_GPU | 104 #endif // ENABLE_GPU |
| 103 } | 105 } |
| 104 | 106 |
| 105 #if defined(OS_MACOSX) | 107 #if defined(OS_MACOSX) |
| 106 void GpuChannel::AcceleratedSurfaceBuffersSwapped( | 108 void GpuChannel::AcceleratedSurfaceBuffersSwapped( |
| 107 int32 route_id, uint64 swap_buffers_count) { | 109 int32 route_id, uint64 swap_buffers_count) { |
| 108 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); | 110 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 *route_id = GenerateRouteID(); | 169 *route_id = GenerateRouteID(); |
| 168 GpuCommandBufferStub* parent_stub = NULL; | 170 GpuCommandBufferStub* parent_stub = NULL; |
| 169 if (parent_route_id != 0) | 171 if (parent_route_id != 0) |
| 170 parent_stub = stubs_.Lookup(parent_route_id); | 172 parent_stub = stubs_.Lookup(parent_route_id); |
| 171 | 173 |
| 172 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 174 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
| 173 this, | 175 this, |
| 174 gfx::kNullPluginWindow, | 176 gfx::kNullPluginWindow, |
| 175 parent_stub, | 177 parent_stub, |
| 176 size, | 178 size, |
| 179 disallowed_extensions_, | |
| 177 init_params.allowed_extensions, | 180 init_params.allowed_extensions, |
| 178 init_params.attribs, | 181 init_params.attribs, |
| 179 parent_texture_id, | 182 parent_texture_id, |
| 180 *route_id, | 183 *route_id, |
| 181 0, 0)); | 184 0, 0)); |
| 182 router_.AddRoute(*route_id, stub.get()); | 185 router_.AddRoute(*route_id, stub.get()); |
| 183 stubs_.AddWithID(stub.release(), *route_id); | 186 stubs_.AddWithID(stub.release(), *route_id); |
| 184 #else | 187 #else |
| 185 *route_id = MSG_ROUTING_NONE; | 188 *route_id = MSG_ROUTING_NONE; |
| 186 #endif | 189 #endif |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 #if defined(OS_POSIX) | 253 #if defined(OS_POSIX) |
| 251 int GpuChannel::GetRendererFileDescriptor() { | 254 int GpuChannel::GetRendererFileDescriptor() { |
| 252 int fd = -1; | 255 int fd = -1; |
| 253 if (channel_.get()) { | 256 if (channel_.get()) { |
| 254 fd = channel_->GetClientFileDescriptor(); | 257 fd = channel_->GetClientFileDescriptor(); |
| 255 } | 258 } |
| 256 return fd; | 259 return fd; |
| 257 } | 260 } |
| 258 #endif // defined(OS_POSIX) | 261 #endif // defined(OS_POSIX) |
| 259 | 262 |
| OLD | NEW |