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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « ui/ozone/public/ui_thread_gpu.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/ozone/public/ui_thread_gpu.h"
6
7 #include "ipc/ipc_listener.h"
8 #include "ipc/ipc_message.h"
9 #include "ipc/ipc_sender.h"
10 #include "ui/ozone/public/gpu_platform_support.h"
11 #include "ui/ozone/public/gpu_platform_support_host.h"
12 #include "ui/ozone/public/ozone_platform.h"
13
14 namespace ui {
15
16 class UiThreadGpuForwardingSender : public IPC::Sender {
17 public:
18 explicit UiThreadGpuForwardingSender(IPC::Listener* listener)
19 : listener_(listener) {}
20 virtual ~UiThreadGpuForwardingSender() {}
21
22 // IPC::Sender:
23 virtual bool Send(IPC::Message* msg) OVERRIDE {
24 listener_->OnMessageReceived(*msg);
25 delete msg;
26 return true;
27 }
28
29 private:
30 IPC::Listener* listener_;
31 };
32
33 UiThreadGpu::UiThreadGpu() {
34 }
35
36 UiThreadGpu::~UiThreadGpu() {
37 }
38
39 bool UiThreadGpu::Initialize() {
40 OzonePlatform* platform = ui::OzonePlatform::GetInstance();
41
42 ui_sender_.reset(
43 new UiThreadGpuForwardingSender(platform->GetGpuPlatformSupportHost()));
44 gpu_sender_.reset(
45 new UiThreadGpuForwardingSender(platform->GetGpuPlatformSupport()));
46
47 const int kHostId = 1;
48 platform->GetGpuPlatformSupportHost()->OnChannelEstablished(
49 kHostId, gpu_sender_.get());
50 platform->GetGpuPlatformSupport()->OnChannelEstablished(ui_sender_.get());
51
52 return true;
53 }
54
55 } // namespace ui
OLDNEW
« 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