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

Side by Side Diff: ui/ozone/public/ui_thread_gpu.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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') | ui/ozone/run_all_unittests.cc » ('j') | 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') | ui/ozone/run_all_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698