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

Side by Side Diff: content/browser/media/capture/aura_window_capture_machine.h

Issue 1412173003: cast: support cursor rendering for tab capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing cursor renderer files in repo Created 5 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/timer/timer.h" 10 #include "base/timer/timer.h"
11 #include "content/browser/media/capture/cursor_renderer_aura.h"
11 #include "media/capture/content/screen_capture_device_core.h" 12 #include "media/capture/content/screen_capture_device_core.h"
12 #include "ui/aura/window.h" 13 #include "ui/aura/window.h"
13 #include "ui/aura/window_observer.h" 14 #include "ui/aura/window_observer.h"
14 #include "ui/base/cursor/cursors_aura.h" 15 #include "ui/base/cursor/cursors_aura.h"
15 #include "ui/compositor/compositor.h" 16 #include "ui/compositor/compositor.h"
16 17
17 namespace cc { 18 namespace cc {
18 19
19 class CopyOutputResult; 20 class CopyOutputResult;
20 21
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 scoped_ptr<cc::CopyOutputResult> result); 85 scoped_ptr<cc::CopyOutputResult> result);
85 86
86 // A helper which does the real work for DidCopyOutput. Returns true if 87 // A helper which does the real work for DidCopyOutput. Returns true if
87 // succeeded. 88 // succeeded.
88 bool ProcessCopyOutputResponse( 89 bool ProcessCopyOutputResponse(
89 scoped_refptr<media::VideoFrame> video_frame, 90 scoped_refptr<media::VideoFrame> video_frame,
90 base::TimeTicks start_time, 91 base::TimeTicks start_time,
91 const CaptureFrameCallback& capture_frame_cb, 92 const CaptureFrameCallback& capture_frame_cb,
92 scoped_ptr<cc::CopyOutputResult> result); 93 scoped_ptr<cc::CopyOutputResult> result);
93 94
94 // Helper function to update cursor state.
95 // |region_in_frame| defines where the desktop is rendered in the captured
96 // frame.
97 // Returns the current cursor position in captured frame.
98 gfx::Point UpdateCursorState(const gfx::Rect& region_in_frame);
99
100 // Clears cursor state.
101 void ClearCursorState();
102
103 // The window associated with the desktop. 95 // The window associated with the desktop.
104 aura::Window* desktop_window_; 96 aura::Window* desktop_window_;
105 97
106 // The timer that kicks off period captures. 98 // The timer that kicks off period captures.
107 base::Timer timer_; 99 base::Timer timer_;
108 100
109 // Whether screen capturing or window capture. 101 // Whether screen capturing or window capture.
110 bool screen_capture_; 102 bool screen_capture_;
111 103
112 // Makes all the decisions about which frames to copy, and how. 104 // Makes all the decisions about which frames to copy, and how.
113 scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_; 105 scoped_refptr<media::ThreadSafeCaptureOracle> oracle_proxy_;
114 106
115 // The capture parameters for this capture. 107 // The capture parameters for this capture.
116 media::VideoCaptureParams capture_params_; 108 media::VideoCaptureParams capture_params_;
117 109
118 // YUV readback pipeline. 110 // YUV readback pipeline.
119 scoped_ptr<content::ReadbackYUVInterface> yuv_readback_pipeline_; 111 scoped_ptr<content::ReadbackYUVInterface> yuv_readback_pipeline_;
120 112
121 // Cursor state. 113 // Renders mouse cursor on frame
122 ui::Cursor last_cursor_; 114 scoped_ptr<content::CursorRenderer> cursor_renderer_;
miu 2015/10/23 01:55:12 IMO, the type should be scoped_ptr<CursorRendererA
Irfan 2015/10/26 23:10:31 Done.
123 gfx::Size window_size_when_cursor_last_updated_;
124 SkBitmap scaled_cursor_bitmap_;
125 115
126 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the 116 // TODO(jiayl): Remove power_save_blocker_ when there is an API to keep the
127 // screen from sleeping for the drive-by web. 117 // screen from sleeping for the drive-by web.
128 scoped_ptr<PowerSaveBlocker> power_save_blocker_; 118 scoped_ptr<PowerSaveBlocker> power_save_blocker_;
129 119
130 // WeakPtrs are used for the asynchronous capture callbacks passed to external 120 // WeakPtrs are used for the asynchronous capture callbacks passed to external
131 // modules. They are only valid on the UI thread and become invalidated 121 // modules. They are only valid on the UI thread and become invalidated
132 // immediately when InternalStop() is called to ensure that no more captured 122 // immediately when InternalStop() is called to ensure that no more captured
133 // frames will be delivered to the client. 123 // frames will be delivered to the client.
134 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_; 124 base::WeakPtrFactory<AuraWindowCaptureMachine> weak_factory_;
135 125
136 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine); 126 DISALLOW_COPY_AND_ASSIGN(AuraWindowCaptureMachine);
137 }; 127 };
138 128
139 } // namespace content 129 } // namespace content
140 130
141 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_ 131 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_AURA_WINDOW_CAPTURE_MACHINE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698