Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/aura/gpu_process_transport_factory.h" | 5 #include "content/browser/aura/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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 | 281 |
| 282 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { | 282 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { |
| 283 return this; | 283 return this; |
| 284 } | 284 } |
| 285 | 285 |
| 286 gfx::GLSurfaceHandle GpuProcessTransportFactory::CreateSharedSurfaceHandle() { | 286 gfx::GLSurfaceHandle GpuProcessTransportFactory::CreateSharedSurfaceHandle() { |
| 287 scoped_refptr<cc::ContextProvider> provider = | 287 scoped_refptr<cc::ContextProvider> provider = |
| 288 SharedMainThreadContextProvider(); | 288 SharedMainThreadContextProvider(); |
| 289 if (!provider.get()) | 289 if (!provider.get()) |
| 290 return gfx::GLSurfaceHandle(); | 290 return gfx::GLSurfaceHandle(); |
| 291 typedef WebGraphicsContext3DCommandBufferImpl WGC3DCBI; | 291 ContextProviderCommandBuffer* provider_cb = |
|
danakj
2014/01/06 20:59:37
provider_command_buffer?
| |
| 292 WGC3DCBI* context = static_cast<WGC3DCBI*>(provider->Context3d()); | 292 static_cast<ContextProviderCommandBuffer*>(provider.get()); |
| 293 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( | 293 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( |
| 294 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); | 294 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); |
| 295 handle.parent_gpu_process_id = context->GetGPUProcessID(); | 295 handle.parent_gpu_process_id = provider_cb->GetGPUProcessID(); |
| 296 handle.parent_client_id = | 296 handle.parent_client_id = |
| 297 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); | 297 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); |
| 298 return handle; | 298 return handle; |
| 299 } | 299 } |
| 300 | 300 |
| 301 void GpuProcessTransportFactory::DestroySharedSurfaceHandle( | 301 void GpuProcessTransportFactory::DestroySharedSurfaceHandle( |
| 302 gfx::GLSurfaceHandle surface) {} | 302 gfx::GLSurfaceHandle surface) {} |
| 303 | 303 |
| 304 scoped_refptr<ui::Texture> GpuProcessTransportFactory::CreateTransportClient( | 304 scoped_refptr<ui::Texture> GpuProcessTransportFactory::CreateTransportClient( |
| 305 float device_scale_factor) { | 305 float device_scale_factor) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 337 provider->ContextSupport())); | 337 provider->ContextSupport())); |
| 338 } | 338 } |
| 339 return gl_helper_.get(); | 339 return gl_helper_.get(); |
| 340 } | 340 } |
| 341 | 341 |
| 342 uint32 GpuProcessTransportFactory::InsertSyncPoint() { | 342 uint32 GpuProcessTransportFactory::InsertSyncPoint() { |
| 343 scoped_refptr<cc::ContextProvider> provider = | 343 scoped_refptr<cc::ContextProvider> provider = |
| 344 SharedMainThreadContextProvider(); | 344 SharedMainThreadContextProvider(); |
| 345 if (!provider.get()) | 345 if (!provider.get()) |
| 346 return 0; | 346 return 0; |
| 347 return provider->Context3d()->insertSyncPoint(); | 347 return provider->ContextGL()->InsertSyncPointCHROMIUM(); |
| 348 } | 348 } |
| 349 | 349 |
| 350 void GpuProcessTransportFactory::WaitSyncPoint(uint32 sync_point) { | 350 void GpuProcessTransportFactory::WaitSyncPoint(uint32 sync_point) { |
| 351 scoped_refptr<cc::ContextProvider> provider = | 351 scoped_refptr<cc::ContextProvider> provider = |
| 352 SharedMainThreadContextProvider(); | 352 SharedMainThreadContextProvider(); |
| 353 if (!provider.get()) | 353 if (!provider.get()) |
| 354 return; | 354 return; |
| 355 provider->Context3d()->waitSyncPoint(sync_point); | 355 provider->ContextGL()->WaitSyncPointCHROMIUM(sync_point); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void GpuProcessTransportFactory::AddObserver( | 358 void GpuProcessTransportFactory::AddObserver( |
| 359 ImageTransportFactoryObserver* observer) { | 359 ImageTransportFactoryObserver* observer) { |
| 360 observer_list_.AddObserver(observer); | 360 observer_list_.AddObserver(observer); |
| 361 } | 361 } |
| 362 | 362 |
| 363 void GpuProcessTransportFactory::RemoveObserver( | 363 void GpuProcessTransportFactory::RemoveObserver( |
| 364 ImageTransportFactoryObserver* observer) { | 364 ImageTransportFactoryObserver* observer) { |
| 365 observer_list_.RemoveObserver(observer); | 365 observer_list_.RemoveObserver(observer); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 492 observer_list_, | 492 observer_list_, |
| 493 OnLostResources()); | 493 OnLostResources()); |
| 494 | 494 |
| 495 // Kill things that use the shared context before killing the shared context. | 495 // Kill things that use the shared context before killing the shared context. |
| 496 lost_gl_helper.reset(); | 496 lost_gl_helper.reset(); |
| 497 lost_offscreen_compositor_contexts = NULL; | 497 lost_offscreen_compositor_contexts = NULL; |
| 498 lost_shared_main_thread_contexts = NULL; | 498 lost_shared_main_thread_contexts = NULL; |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace content | 501 } // namespace content |
| OLD | NEW |