| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 void CapturerGdi::InvalidateScreen(const SkISize& size) { | 146 void CapturerGdi::InvalidateScreen(const SkISize& size) { |
| 147 helper_.InvalidateScreen(size); | 147 helper_.InvalidateScreen(size); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void CapturerGdi::InvalidateFullScreen() { | 150 void CapturerGdi::InvalidateFullScreen() { |
| 151 helper_.InvalidateFullScreen(); | 151 helper_.InvalidateFullScreen(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void CapturerGdi::CaptureInvalidRegion( | 154 void CapturerGdi::CaptureInvalidRegion( |
| 155 const CaptureCompletedCallback& callback) { | 155 const CaptureCompletedCallback& callback) { |
| 156 // Force the system to power-up display hardware, if it has been suspended. |
| 157 SetThreadExecutionState(ES_DISPLAY_REQUIRED); |
| 158 |
| 159 // Perform the capture. |
| 156 CalculateInvalidRegion(); | 160 CalculateInvalidRegion(); |
| 157 SkRegion invalid_region; | 161 SkRegion invalid_region; |
| 158 helper_.SwapInvalidRegion(&invalid_region); | 162 helper_.SwapInvalidRegion(&invalid_region); |
| 159 CaptureRegion(invalid_region, callback); | 163 CaptureRegion(invalid_region, callback); |
| 160 } | 164 } |
| 161 | 165 |
| 162 const SkISize& CapturerGdi::size_most_recent() const { | 166 const SkISize& CapturerGdi::size_most_recent() const { |
| 163 return helper_.size_most_recent(); | 167 return helper_.size_most_recent(); |
| 164 } | 168 } |
| 165 | 169 |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 } | 370 } |
| 367 | 371 |
| 368 } // namespace | 372 } // namespace |
| 369 | 373 |
| 370 // static | 374 // static |
| 371 Capturer* Capturer::Create() { | 375 Capturer* Capturer::Create() { |
| 372 return new CapturerGdi(); | 376 return new CapturerGdi(); |
| 373 } | 377 } |
| 374 | 378 |
| 375 } // namespace remoting | 379 } // namespace remoting |
| OLD | NEW |