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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 } | 651 } |
652 | 652 |
653 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { | 653 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { |
654 return this; | 654 return this; |
655 } | 655 } |
656 | 656 |
657 uint32_t GpuProcessTransportFactory::AllocateSurfaceClientId() { | 657 uint32_t GpuProcessTransportFactory::AllocateSurfaceClientId() { |
658 return next_surface_client_id_++; | 658 return next_surface_client_id_++; |
659 } | 659 } |
660 | 660 |
| 661 void GpuProcessTransportFactory::SetDisplayVisible(ui::Compositor* compositor, |
| 662 bool visible) { |
| 663 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); |
| 664 if (it == per_compositor_data_.end()) |
| 665 return; |
| 666 PerCompositorData* data = it->second; |
| 667 DCHECK(data); |
| 668 // The compositor will always SetVisible on the Display once it is set up, so |
| 669 // do nothing if |display| is null. |
| 670 if (data->display) |
| 671 data->display->SetVisible(visible); |
| 672 } |
| 673 |
661 void GpuProcessTransportFactory::ResizeDisplay(ui::Compositor* compositor, | 674 void GpuProcessTransportFactory::ResizeDisplay(ui::Compositor* compositor, |
662 const gfx::Size& size) { | 675 const gfx::Size& size) { |
663 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); | 676 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); |
664 if (it == per_compositor_data_.end()) | 677 if (it == per_compositor_data_.end()) |
665 return; | 678 return; |
666 PerCompositorData* data = it->second; | 679 PerCompositorData* data = it->second; |
667 DCHECK(data); | 680 DCHECK(data); |
668 if (data->display) | 681 if (data->display) |
669 data->display->Resize(size); | 682 data->display->Resize(size); |
670 } | 683 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 shared_vulkan_context_provider_ = | 874 shared_vulkan_context_provider_ = |
862 cc::VulkanInProcessContextProvider::Create(); | 875 cc::VulkanInProcessContextProvider::Create(); |
863 } | 876 } |
864 | 877 |
865 shared_vulkan_context_provider_initialized_ = true; | 878 shared_vulkan_context_provider_initialized_ = true; |
866 } | 879 } |
867 return shared_vulkan_context_provider_; | 880 return shared_vulkan_context_provider_; |
868 } | 881 } |
869 | 882 |
870 } // namespace content | 883 } // namespace content |
OLD | NEW |