OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/capturer.h" | 5 #include "remoting/host/capturer.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 // CapturerGdi is double-buffered as required by Capturer. See | 34 // CapturerGdi is double-buffered as required by Capturer. See |
35 // remoting/host/capturer.h. | 35 // remoting/host/capturer.h. |
36 class CapturerGdi : public Capturer { | 36 class CapturerGdi : public Capturer { |
37 public: | 37 public: |
38 CapturerGdi(); | 38 CapturerGdi(); |
39 virtual ~CapturerGdi(); | 39 virtual ~CapturerGdi(); |
40 | 40 |
41 // Capturer interface. | 41 // Capturer interface. |
42 virtual void Start() OVERRIDE; | 42 virtual void Start() OVERRIDE; |
43 virtual void Stop() OVERRIDE; | 43 virtual void Stop() OVERRIDE; |
44 virtual void SetCursorShapeChangedCallback( | |
45 const CursorShapeChangedCallback& callback); | |
44 virtual void ScreenConfigurationChanged() OVERRIDE; | 46 virtual void ScreenConfigurationChanged() OVERRIDE; |
45 virtual media::VideoFrame::Format pixel_format() const OVERRIDE; | 47 virtual media::VideoFrame::Format pixel_format() const OVERRIDE; |
46 virtual void ClearInvalidRegion() OVERRIDE; | 48 virtual void ClearInvalidRegion() OVERRIDE; |
47 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; | 49 virtual void InvalidateRegion(const SkRegion& invalid_region) OVERRIDE; |
48 virtual void InvalidateScreen(const SkISize& size) OVERRIDE; | 50 virtual void InvalidateScreen(const SkISize& size) OVERRIDE; |
49 virtual void InvalidateFullScreen() OVERRIDE; | 51 virtual void InvalidateFullScreen() OVERRIDE; |
50 virtual void CaptureInvalidRegion( | 52 virtual void CaptureInvalidRegion( |
51 const CaptureCompletedCallback& callback) OVERRIDE; | 53 const CaptureCompletedCallback& callback) OVERRIDE; |
52 virtual const SkISize& size_most_recent() const OVERRIDE; | 54 virtual const SkISize& size_most_recent() const OVERRIDE; |
53 | 55 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 } | 238 } |
237 } | 239 } |
238 | 240 |
239 void CapturerGdi::Stop() { | 241 void CapturerGdi::Stop() { |
240 // Restore Aero. | 242 // Restore Aero. |
241 if (composition_func_ != NULL) { | 243 if (composition_func_ != NULL) { |
242 (*composition_func_)(DWM_EC_ENABLECOMPOSITION); | 244 (*composition_func_)(DWM_EC_ENABLECOMPOSITION); |
243 } | 245 } |
244 } | 246 } |
245 | 247 |
248 void CapturerGdi::SetCursorShapeChangedCallback( | |
249 const CursorShapeChangedCallback& callback) { | |
250 // TODO(garykac) Implement this. Although as with the screen config changes, | |
251 // we'll need to poll to look for cursor shape changes. | |
Wez
2012/05/23 00:01:57
nit: Replace this TODO with a bug reference.
garykac
2012/05/26 01:58:01
Added bug reference.
| |
252 } | |
253 | |
246 void CapturerGdi::ScreenConfigurationChanged() { | 254 void CapturerGdi::ScreenConfigurationChanged() { |
247 // We poll for screen configuration changes, so ignore notifications. | 255 // We poll for screen configuration changes, so ignore notifications. |
248 } | 256 } |
249 | 257 |
250 void CapturerGdi::UpdateBufferCapture(const SkISize& size) { | 258 void CapturerGdi::UpdateBufferCapture(const SkISize& size) { |
251 // Switch to the desktop receiving user input if different from the current | 259 // Switch to the desktop receiving user input if different from the current |
252 // one. | 260 // one. |
253 scoped_ptr<DesktopWin> input_desktop = DesktopWin::GetInputDesktop(); | 261 scoped_ptr<DesktopWin> input_desktop = DesktopWin::GetInputDesktop(); |
254 if (input_desktop.get() != NULL && !desktop_.IsSame(*input_desktop)) { | 262 if (input_desktop.get() != NULL && !desktop_.IsSame(*input_desktop)) { |
255 // Release GDI resources otherwise SetThreadDesktop will fail. | 263 // Release GDI resources otherwise SetThreadDesktop will fail. |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 } | 430 } |
423 | 431 |
424 } // namespace | 432 } // namespace |
425 | 433 |
426 // static | 434 // static |
427 Capturer* Capturer::Create() { | 435 Capturer* Capturer::Create() { |
428 return new CapturerGdi(); | 436 return new CapturerGdi(); |
429 } | 437 } |
430 | 438 |
431 } // namespace remoting | 439 } // namespace remoting |
OLD | NEW |