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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
682 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { | 682 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { |
683 return this; | 683 return this; |
684 } | 684 } |
685 | 685 |
686 ui::ContextFactoryPrivate* | 686 ui::ContextFactoryPrivate* |
687 GpuProcessTransportFactory::GetContextFactoryPrivate() { | 687 GpuProcessTransportFactory::GetContextFactoryPrivate() { |
688 return this; | 688 return this; |
689 } | 689 } |
690 | 690 |
691 cc::FrameSinkId GpuProcessTransportFactory::AllocateFrameSinkId() { | 691 cc::FrameSinkId GpuProcessTransportFactory::AllocateFrameSinkId() { |
692 // The FrameSinkId generated here must be unique with | 692 return frame_sink_id_allocator_.NextFrameSinkId(); |
danakj
2017/02/15 20:18:10
This comment goes away, but we lose any notion of
xlai (Olivia)
2017/02/15 22:38:36
Done. I added the comment back in places where Fra
| |
693 // RenderWidgetHostViewAura's | |
694 // and RenderWidgetHostViewMac's FrameSinkId allocation. | |
695 // TODO(crbug.com/685777): Centralize allocation in one place for easier | |
696 // maintenance. | |
697 return cc::FrameSinkId(0, next_sink_id_++); | |
698 } | 693 } |
699 | 694 |
700 void GpuProcessTransportFactory::SetDisplayVisible(ui::Compositor* compositor, | 695 void GpuProcessTransportFactory::SetDisplayVisible(ui::Compositor* compositor, |
701 bool visible) { | 696 bool visible) { |
702 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); | 697 PerCompositorDataMap::iterator it = per_compositor_data_.find(compositor); |
703 if (it == per_compositor_data_.end()) | 698 if (it == per_compositor_data_.end()) |
704 return; | 699 return; |
705 PerCompositorData* data = it->second.get(); | 700 PerCompositorData* data = it->second.get(); |
706 DCHECK(data); | 701 DCHECK(data); |
707 // The compositor will always SetVisible on the Display once it is set up, so | 702 // The compositor will always SetVisible on the Display once it is set up, so |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
914 shared_vulkan_context_provider_ = | 909 shared_vulkan_context_provider_ = |
915 cc::VulkanInProcessContextProvider::Create(); | 910 cc::VulkanInProcessContextProvider::Create(); |
916 } | 911 } |
917 | 912 |
918 shared_vulkan_context_provider_initialized_ = true; | 913 shared_vulkan_context_provider_initialized_ = true; |
919 } | 914 } |
920 return shared_vulkan_context_provider_; | 915 return shared_vulkan_context_provider_; |
921 } | 916 } |
922 | 917 |
923 } // namespace content | 918 } // namespace content |
OLD | NEW |