| 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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 402 |
| 403 helper.reset(); | 403 helper.reset(); |
| 404 DCHECK(!gl_helper_) << "Destroying the GLHelper should not cause a new " | 404 DCHECK(!gl_helper_) << "Destroying the GLHelper should not cause a new " |
| 405 "GLHelper to be created."; | 405 "GLHelper to be created."; |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 | 408 |
| 409 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } | 409 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } |
| 410 | 410 |
| 411 uint32 GpuProcessTransportFactory::GetImageTextureTarget() { | 411 uint32 GpuProcessTransportFactory::GetImageTextureTarget() { |
| 412 return BrowserGpuChannelHostFactory::GetImageTextureTarget(); | 412 // TODO(reveman): We currently assume that the compositor will use BGRA_8888 |
| 413 // if it's able to, and RGBA_8888 otherwise. Since we don't know what it will |
| 414 // use we hardcode BGRA_8888 here for now. We should instead |
| 415 // move decisions about GpuMemoryBuffer format to the browser embedder so we |
| 416 // know it here, and pass that decision to the compositor for each usage. |
| 417 // crbug.com/490362 |
| 418 gfx::GpuMemoryBuffer::Format format = gfx::GpuMemoryBuffer::BGRA_8888; |
| 419 |
| 420 // TODO(danakj): When one-copy uploads support partial update, change this |
| 421 // usage to PERSISTENT_MAP for one-copy. |
| 422 gfx::GpuMemoryBuffer::Usage usage = gfx::GpuMemoryBuffer::MAP; |
| 423 |
| 424 return BrowserGpuChannelHostFactory::GetImageTextureTarget(format, usage); |
| 413 } | 425 } |
| 414 | 426 |
| 415 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() { | 427 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() { |
| 416 return HostSharedBitmapManager::current(); | 428 return HostSharedBitmapManager::current(); |
| 417 } | 429 } |
| 418 | 430 |
| 419 gpu::GpuMemoryBufferManager* | 431 gpu::GpuMemoryBufferManager* |
| 420 GpuProcessTransportFactory::GetGpuMemoryBufferManager() { | 432 GpuProcessTransportFactory::GetGpuMemoryBufferManager() { |
| 421 return BrowserGpuMemoryBufferManager::current(); | 433 return BrowserGpuMemoryBufferManager::current(); |
| 422 } | 434 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 624 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 613 observer_list_, | 625 observer_list_, |
| 614 OnLostResources()); | 626 OnLostResources()); |
| 615 | 627 |
| 616 // Kill things that use the shared context before killing the shared context. | 628 // Kill things that use the shared context before killing the shared context. |
| 617 lost_gl_helper.reset(); | 629 lost_gl_helper.reset(); |
| 618 lost_shared_main_thread_contexts = NULL; | 630 lost_shared_main_thread_contexts = NULL; |
| 619 } | 631 } |
| 620 | 632 |
| 621 } // namespace content | 633 } // namespace content |
| OLD | NEW |