OLD | NEW |
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 #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 "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 false, | 189 false, |
190 shutdown_event)); | 190 shutdown_event)); |
191 | 191 |
192 base::WeakPtr<GpuChannel>* weak_ptr(new base::WeakPtr<GpuChannel>( | 192 base::WeakPtr<GpuChannel>* weak_ptr(new base::WeakPtr<GpuChannel>( |
193 weak_factory_.GetWeakPtr())); | 193 weak_factory_.GetWeakPtr())); |
194 scoped_refptr<SyncPointMessageFilter> filter(new SyncPointMessageFilter( | 194 scoped_refptr<SyncPointMessageFilter> filter(new SyncPointMessageFilter( |
195 weak_ptr, | 195 weak_ptr, |
196 gpu_channel_manager_->sync_point_manager(), | 196 gpu_channel_manager_->sync_point_manager(), |
197 base::MessageLoopProxy::current(), | 197 base::MessageLoopProxy::current(), |
198 unprocessed_messages_)); | 198 unprocessed_messages_)); |
199 channel_->AddFilter(filter); | 199 channel_->AddFilter(filter.get()); |
200 | 200 |
201 return true; | 201 return true; |
202 } | 202 } |
203 | 203 |
204 std::string GpuChannel::GetChannelName() { | 204 std::string GpuChannel::GetChannelName() { |
205 return channel_id_; | 205 return channel_id_; |
206 } | 206 } |
207 | 207 |
208 #if defined(OS_POSIX) | 208 #if defined(OS_POSIX) |
209 int GpuChannel::TakeRendererFileDescriptor() { | 209 int GpuChannel::TakeRendererFileDescriptor() { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 319 |
320 #if defined(ENABLE_GPU) | 320 #if defined(ENABLE_GPU) |
321 | 321 |
322 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); | 322 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); |
323 | 323 |
324 *route_id = GenerateRouteID(); | 324 *route_id = GenerateRouteID(); |
325 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 325 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
326 this, | 326 this, |
327 share_group, | 327 share_group, |
328 window, | 328 window, |
329 mailbox_manager_, | 329 mailbox_manager_.get(), |
330 image_manager_, | 330 image_manager_.get(), |
331 gfx::Size(), | 331 gfx::Size(), |
332 disallowed_features_, | 332 disallowed_features_, |
333 init_params.allowed_extensions, | 333 init_params.allowed_extensions, |
334 init_params.attribs, | 334 init_params.attribs, |
335 init_params.gpu_preference, | 335 init_params.gpu_preference, |
336 *route_id, | 336 *route_id, |
337 surface_id, | 337 surface_id, |
338 watchdog_, | 338 watchdog_, |
339 software_, | 339 software_, |
340 init_params.active_url)); | 340 init_params.active_url)); |
(...skipping 18 matching lines...) Expand all Loading... |
359 image_id); | 359 image_id); |
360 | 360 |
361 *size = gfx::Size(); | 361 *size = gfx::Size(); |
362 | 362 |
363 if (image_manager_->LookupImage(image_id)) { | 363 if (image_manager_->LookupImage(image_id)) { |
364 LOG(ERROR) << "CreateImage failed, image_id already in use."; | 364 LOG(ERROR) << "CreateImage failed, image_id already in use."; |
365 return; | 365 return; |
366 } | 366 } |
367 | 367 |
368 scoped_refptr<gfx::GLImage> image = gfx::GLImage::CreateGLImage(window); | 368 scoped_refptr<gfx::GLImage> image = gfx::GLImage::CreateGLImage(window); |
369 if (!image) | 369 if (!image.get()) |
370 return; | 370 return; |
371 | 371 |
372 image_manager_->AddImage(image.get(), image_id); | 372 image_manager_->AddImage(image.get(), image_id); |
373 *size = image->GetSize(); | 373 *size = image->GetSize(); |
374 } | 374 } |
375 | 375 |
376 void GpuChannel::DeleteImage(int32 image_id) { | 376 void GpuChannel::DeleteImage(int32 image_id) { |
377 TRACE_EVENT1("gpu", | 377 TRACE_EVENT1("gpu", |
378 "GpuChannel::DeleteImage", | 378 "GpuChannel::DeleteImage", |
379 "image_id", | 379 "image_id", |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 } | 603 } |
604 } | 604 } |
605 | 605 |
606 GpuChannelMsg_CollectRenderingStatsForSurface::WriteReplyParams( | 606 GpuChannelMsg_CollectRenderingStatsForSurface::WriteReplyParams( |
607 reply_message, | 607 reply_message, |
608 stats); | 608 stats); |
609 Send(reply_message); | 609 Send(reply_message); |
610 } | 610 } |
611 | 611 |
612 } // namespace content | 612 } // namespace content |
OLD | NEW |