| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 if (!gpu_channel_host) | 433 if (!gpu_channel_host) |
| 434 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 434 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
| 435 GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon"); | 435 GURL url("chrome://gpu/GpuProcessTransportFactory::CreateContextCommon"); |
| 436 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 436 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
| 437 new WebGraphicsContext3DCommandBufferImpl( | 437 new WebGraphicsContext3DCommandBufferImpl( |
| 438 surface_id, | 438 surface_id, |
| 439 url, | 439 url, |
| 440 gpu_channel_host.get(), | 440 gpu_channel_host.get(), |
| 441 attrs, | 441 attrs, |
| 442 false, | 442 false, |
| 443 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits())); | 443 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits(), |
| 444 NULL)); |
| 444 return context.Pass(); | 445 return context.Pass(); |
| 445 } | 446 } |
| 446 | 447 |
| 447 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() { | 448 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() { |
| 448 base::MessageLoop::current()->PostTask( | 449 base::MessageLoop::current()->PostTask( |
| 449 FROM_HERE, | 450 FROM_HERE, |
| 450 base::Bind(&GpuProcessTransportFactory::OnLostMainThreadSharedContext, | 451 base::Bind(&GpuProcessTransportFactory::OnLostMainThreadSharedContext, |
| 451 callback_factory_.GetWeakPtr())); | 452 callback_factory_.GetWeakPtr())); |
| 452 } | 453 } |
| 453 | 454 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 471 observer_list_, | 472 observer_list_, |
| 472 OnLostResources()); | 473 OnLostResources()); |
| 473 | 474 |
| 474 // Kill things that use the shared context before killing the shared context. | 475 // Kill things that use the shared context before killing the shared context. |
| 475 lost_gl_helper.reset(); | 476 lost_gl_helper.reset(); |
| 476 lost_offscreen_compositor_contexts = NULL; | 477 lost_offscreen_compositor_contexts = NULL; |
| 477 lost_shared_main_thread_contexts = NULL; | 478 lost_shared_main_thread_contexts = NULL; |
| 478 } | 479 } |
| 479 | 480 |
| 480 } // namespace content | 481 } // namespace content |
| OLD | NEW |