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

Unified Diff: services/ui/gpu/gpu_service.cc

Issue 2764753004: mus-gpu: Talk to the GpuHost from the IO thread. (Closed)
Patch Set: . Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/gpu/gpu_service.cc
diff --git a/services/ui/gpu/gpu_service.cc b/services/ui/gpu/gpu_service.cc
index 496de6b841a54d77a620665d22881efc0b79644f..75a81a656cc896852571152417eac520c40b91e7 100644
--- a/services/ui/gpu/gpu_service.cc
+++ b/services/ui/gpu/gpu_service.cc
@@ -76,7 +76,6 @@ void GpuService::InitializeWithHost(mojom::GpuHostPtr gpu_host,
base::WaitableEvent* shutdown_event) {
DCHECK(CalledOnValidThread());
DCHECK(!gpu_host_);
- gpu_host_ = std::move(gpu_host);
gpu_preferences_ = preferences;
gpu_info_.video_decode_accelerator_capabilities =
media::GpuVideoDecodeAccelerator::GetCapabilities(gpu_preferences_);
@@ -85,8 +84,9 @@ void GpuService::InitializeWithHost(mojom::GpuHostPtr gpu_host,
gpu_info_.jpeg_decode_accelerator_supported =
media::GpuJpegDecodeAcceleratorFactoryProvider::
IsAcceleratedJpegDecodeSupported();
- gpu_host_->DidInitialize(gpu_info_);
-
+ gpu_host->DidInitialize(gpu_info_);
+ gpu_host_ =
+ mojom::ThreadSafeGpuHostPtr::Create(gpu_host.PassInterface(), io_runner_);
sync_point_manager_ = sync_point_manager;
if (!sync_point_manager_) {
owned_sync_point_manager_ = base::MakeUnique<gpu::SyncPointManager>();
@@ -143,35 +143,35 @@ void GpuService::GetVideoMemoryUsageStats(
}
void GpuService::DidCreateOffscreenContext(const GURL& active_url) {
- gpu_host_->DidCreateOffscreenContext(active_url);
+ (*gpu_host_)->DidCreateOffscreenContext(active_url);
}
void GpuService::DidDestroyChannel(int client_id) {
media_gpu_channel_manager_->RemoveChannel(client_id);
- gpu_host_->DidDestroyChannel(client_id);
+ (*gpu_host_)->DidDestroyChannel(client_id);
}
void GpuService::DidDestroyOffscreenContext(const GURL& active_url) {
- gpu_host_->DidDestroyOffscreenContext(active_url);
+ (*gpu_host_)->DidDestroyOffscreenContext(active_url);
}
void GpuService::DidLoseContext(bool offscreen,
gpu::error::ContextLostReason reason,
const GURL& active_url) {
- gpu_host_->DidLoseContext(offscreen, reason, active_url);
+ (*gpu_host_)->DidLoseContext(offscreen, reason, active_url);
}
void GpuService::StoreShaderToDisk(int client_id,
const std::string& key,
const std::string& shader) {
- gpu_host_->StoreShaderToDisk(client_id, key, shader);
+ (*gpu_host_)->StoreShaderToDisk(client_id, key, shader);
}
#if defined(OS_WIN)
void GpuService::SendAcceleratedSurfaceCreatedChildWindow(
gpu::SurfaceHandle parent_window,
gpu::SurfaceHandle child_window) {
- gpu_host_->SetChildSurface(parent_window, child_window);
+ (*gpu_host_)->SetChildSurface(parent_window, child_window);
}
#endif
« no previous file with comments | « services/ui/gpu/gpu_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698