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

Unified Diff: ui/ozone/public/ui_thread_gpu.cc

Issue 533803003: ozone: Add UiThreadGpu for applications that do UI thread GL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix components Created 6 years, 3 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 | « ui/ozone/public/ui_thread_gpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/public/ui_thread_gpu.cc
diff --git a/ui/ozone/public/ui_thread_gpu.cc b/ui/ozone/public/ui_thread_gpu.cc
new file mode 100644
index 0000000000000000000000000000000000000000..68b260e3eaae6f8601f505cc9794904de9af17de
--- /dev/null
+++ b/ui/ozone/public/ui_thread_gpu.cc
@@ -0,0 +1,55 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/public/ui_thread_gpu.h"
+
+#include "ipc/ipc_listener.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_sender.h"
+#include "ui/ozone/public/gpu_platform_support.h"
+#include "ui/ozone/public/gpu_platform_support_host.h"
+#include "ui/ozone/public/ozone_platform.h"
+
+namespace ui {
+
+class UiThreadGpuForwardingSender : public IPC::Sender {
+ public:
+ explicit UiThreadGpuForwardingSender(IPC::Listener* listener)
+ : listener_(listener) {}
+ virtual ~UiThreadGpuForwardingSender() {}
+
+ // IPC::Sender:
+ virtual bool Send(IPC::Message* msg) OVERRIDE {
+ listener_->OnMessageReceived(*msg);
+ delete msg;
+ return true;
+ }
+
+ private:
+ IPC::Listener* listener_;
+};
+
+UiThreadGpu::UiThreadGpu() {
+}
+
+UiThreadGpu::~UiThreadGpu() {
+}
+
+bool UiThreadGpu::Initialize() {
+ OzonePlatform* platform = ui::OzonePlatform::GetInstance();
+
+ ui_sender_.reset(
+ new UiThreadGpuForwardingSender(platform->GetGpuPlatformSupportHost()));
+ gpu_sender_.reset(
+ new UiThreadGpuForwardingSender(platform->GetGpuPlatformSupport()));
+
+ const int kHostId = 1;
+ platform->GetGpuPlatformSupportHost()->OnChannelEstablished(
+ kHostId, gpu_sender_.get());
+ platform->GetGpuPlatformSupport()->OnChannelEstablished(ui_sender_.get());
+
+ return true;
+}
+
+} // namespace ui
« no previous file with comments | « ui/ozone/public/ui_thread_gpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698