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

Side by Side Diff: ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc

Issue 2088533002: Refactor ozone drm cursor code for mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 4 years, 6 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/platform/drm/host/drm_cursor.cc ('k') | ui/ozone/platform/drm/mus_thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h" 5 #include "ui/ozone/platform/drm/host/drm_gpu_platform_support_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h" 10 #include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
(...skipping 15 matching lines...) Expand all
26 CursorIPC(scoped_refptr<base::SingleThreadTaskRunner> send_runner, 26 CursorIPC(scoped_refptr<base::SingleThreadTaskRunner> send_runner,
27 const base::Callback<void(IPC::Message*)>& send_callback); 27 const base::Callback<void(IPC::Message*)>& send_callback);
28 ~CursorIPC() override; 28 ~CursorIPC() override;
29 29
30 // DrmCursorProxy implementation. 30 // DrmCursorProxy implementation.
31 void CursorSet(gfx::AcceleratedWidget window, 31 void CursorSet(gfx::AcceleratedWidget window,
32 const std::vector<SkBitmap>& bitmaps, 32 const std::vector<SkBitmap>& bitmaps,
33 const gfx::Point& point, 33 const gfx::Point& point,
34 int frame_delay_ms) override; 34 int frame_delay_ms) override;
35 void Move(gfx::AcceleratedWidget window, const gfx::Point& point) override; 35 void Move(gfx::AcceleratedWidget window, const gfx::Point& point) override;
36 void InitializeOnEvdev() override;
36 37
37 private: 38 private:
38 bool IsConnected(); 39 bool IsConnected();
39 void Send(IPC::Message* message); 40 void Send(IPC::Message* message);
40 41
41 scoped_refptr<base::SingleThreadTaskRunner> send_runner_; 42 scoped_refptr<base::SingleThreadTaskRunner> send_runner_;
42 base::Callback<void(IPC::Message*)> send_callback_; 43 base::Callback<void(IPC::Message*)> send_callback_;
43 44
44 DISALLOW_COPY_AND_ASSIGN(CursorIPC); 45 DISALLOW_COPY_AND_ASSIGN(CursorIPC);
45 }; 46 };
(...skipping 12 matching lines...) Expand all
58 const std::vector<SkBitmap>& bitmaps, 59 const std::vector<SkBitmap>& bitmaps,
59 const gfx::Point& point, 60 const gfx::Point& point,
60 int frame_delay_ms) { 61 int frame_delay_ms) {
61 Send(new OzoneGpuMsg_CursorSet(window, bitmaps, point, frame_delay_ms)); 62 Send(new OzoneGpuMsg_CursorSet(window, bitmaps, point, frame_delay_ms));
62 } 63 }
63 64
64 void CursorIPC::Move(gfx::AcceleratedWidget window, const gfx::Point& point) { 65 void CursorIPC::Move(gfx::AcceleratedWidget window, const gfx::Point& point) {
65 Send(new OzoneGpuMsg_CursorMove(window, point)); 66 Send(new OzoneGpuMsg_CursorMove(window, point));
66 } 67 }
67 68
69 void CursorIPC::InitializeOnEvdev() {}
70
68 void CursorIPC::Send(IPC::Message* message) { 71 void CursorIPC::Send(IPC::Message* message) {
69 if (IsConnected() && 72 if (IsConnected() &&
70 send_runner_->PostTask(FROM_HERE, base::Bind(send_callback_, message))) 73 send_runner_->PostTask(FROM_HERE, base::Bind(send_callback_, message)))
71 return; 74 return;
72 75
73 // Drop disconnected updates. DrmWindowHost will call 76 // Drop disconnected updates. DrmWindowHost will call
74 // CommitBoundsChange() when we connect to initialize the cursor 77 // CommitBoundsChange() when we connect to initialize the cursor
75 // location. 78 // location.
76 delete message; 79 delete message;
77 } 80 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 return Send(new OzoneGpuMsg_CreateWindow(widget)); 311 return Send(new OzoneGpuMsg_CreateWindow(widget));
309 } 312 }
310 313
311 bool DrmGpuPlatformSupportHost::GpuWindowBoundsChanged( 314 bool DrmGpuPlatformSupportHost::GpuWindowBoundsChanged(
312 gfx::AcceleratedWidget widget, 315 gfx::AcceleratedWidget widget,
313 const gfx::Rect& bounds) { 316 const gfx::Rect& bounds) {
314 return Send(new OzoneGpuMsg_WindowBoundsChanged(widget, bounds)); 317 return Send(new OzoneGpuMsg_WindowBoundsChanged(widget, bounds));
315 } 318 }
316 319
317 } // namespace ui 320 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/host/drm_cursor.cc ('k') | ui/ozone/platform/drm/mus_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698