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

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

Issue 2723163002: gpu: Replace more chrome ipc with mojom api. (Closed)
Patch Set: . Created 3 years, 10 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
Index: services/ui/gpu/gpu_service.cc
diff --git a/services/ui/gpu/gpu_service.cc b/services/ui/gpu/gpu_service.cc
index c0e224eae456aa9f08042ec1ce96d7f701213a35..bbddc6becacc6a004457900fdd8c72d3795d4216 100644
--- a/services/ui/gpu/gpu_service.cc
+++ b/services/ui/gpu/gpu_service.cc
@@ -35,6 +35,10 @@
#include "ui/gl/init/gl_factory.h"
#include "url/gurl.h"
+#if defined(OS_ANDROID)
+#include "media/gpu/avda_codec_allocator.h"
+#endif
+
namespace ui {
GpuService::GpuService(const gpu::GPUInfo& gpu_info,
@@ -199,4 +203,37 @@ void GpuService::EstablishGpuChannel(
callback.Run(std::move(channel_handle));
}
+void GpuService::CloseChannel(int32_t client_id) {
+ if (!gpu_channel_manager_)
+ return;
+ gpu_channel_manager_->RemoveChannel(client_id);
+}
+
+void GpuService::LoadedShader(const std::string& data) {
+ if (!gpu_channel_manager_)
+ return;
+ gpu_channel_manager_->PopulateShaderCache(data);
+}
+
+void GpuService::DestroyingVideoSurface(
+ int32_t surface_id,
+ const DestroyingVideoSurfaceCallback& callback) {
+#if defined(OS_ANDROID)
+ media::AVDACodecAllocator::Instance()->OnSurfaceDestroyed(surface_id);
+#else
+ NOTREACHED() << "DestroyingVideoSurface() not supoprted on this platform.";
jbauman 2017/03/01 22:44:25 "supported"
sadrul 2017/03/02 00:34:28 Done.
+#endif
+ callback.Run();
+}
+
+void GpuService::WakeUpGpu() {
+#if defined(OS_ANDROID)
+ if (!gpu_channel_manager_)
+ return;
+ gpu_channel_manager_->WakeUpGpu();
+#else
+ NOTREACHED() << "WakeUpGpu() not supported on this platform.";
+#endif
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698