Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 2791723003: Update GpuSurfaceTracker to include Android surfaces. (Closed)
Patch Set: rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 gfx::AcceleratedWidget widget = compositor->widget(); 876 gfx::AcceleratedWidget widget = compositor->widget();
877 877
878 auto data = base::MakeUnique<PerCompositorData>(); 878 auto data = base::MakeUnique<PerCompositorData>();
879 if (widget == gfx::kNullAcceleratedWidget) { 879 if (widget == gfx::kNullAcceleratedWidget) {
880 data->surface_handle = gpu::kNullSurfaceHandle; 880 data->surface_handle = gpu::kNullSurfaceHandle;
881 } else { 881 } else {
882 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW) 882 #if defined(GPU_SURFACE_HANDLE_IS_ACCELERATED_WINDOW)
883 data->surface_handle = widget; 883 data->surface_handle = widget;
884 #else 884 #else
885 gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get(); 885 gpu::GpuSurfaceTracker* tracker = gpu::GpuSurfaceTracker::Get();
886 data->surface_handle = tracker->AddSurfaceForNativeWidget(widget); 886 data->surface_handle = tracker->AddSurfaceForNativeWidget(
887 gpu::GpuSurfaceTracker::SurfaceRecord(widget));
887 #endif 888 #endif
888 } 889 }
889 890
890 PerCompositorData* return_ptr = data.get(); 891 PerCompositorData* return_ptr = data.get();
891 per_compositor_data_[compositor] = std::move(data); 892 per_compositor_data_[compositor] = std::move(data);
892 return return_ptr; 893 return return_ptr;
893 } 894 }
894 895
895 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() { 896 void GpuProcessTransportFactory::OnLostMainThreadSharedContextInsideCallback() {
896 base::ThreadTaskRunnerHandle::Get()->PostTask( 897 base::ThreadTaskRunnerHandle::Get()->PostTask(
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 shared_vulkan_context_provider_ = 930 shared_vulkan_context_provider_ =
930 cc::VulkanInProcessContextProvider::Create(); 931 cc::VulkanInProcessContextProvider::Create();
931 } 932 }
932 933
933 shared_vulkan_context_provider_initialized_ = true; 934 shared_vulkan_context_provider_initialized_ = true;
934 } 935 }
935 return shared_vulkan_context_provider_; 936 return shared_vulkan_context_provider_;
936 } 937 }
937 938
938 } // namespace content 939 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698