OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/desktop_shape_tracker.h" | 5 #include "remoting/host/desktop_shape_tracker.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/win/scoped_gdi_object.h" | 10 #include "base/win/scoped_gdi_object.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 : old_desktop_region_(CreateRectRgn(0, 0, 0, 0)) { | 50 : old_desktop_region_(CreateRectRgn(0, 0, 0, 0)) { |
51 } | 51 } |
52 | 52 |
53 DesktopShapeTrackerWin::~DesktopShapeTrackerWin() { | 53 DesktopShapeTrackerWin::~DesktopShapeTrackerWin() { |
54 } | 54 } |
55 | 55 |
56 void DesktopShapeTrackerWin::RefreshDesktopShape() { | 56 void DesktopShapeTrackerWin::RefreshDesktopShape() { |
57 // Accumulate a new desktop shape from current window positions. | 57 // Accumulate a new desktop shape from current window positions. |
58 scoped_ptr<EnumDesktopShapeData> shape_data(new EnumDesktopShapeData); | 58 scoped_ptr<EnumDesktopShapeData> shape_data(new EnumDesktopShapeData); |
59 if (!EnumWindows(EnumWindowsCallback, (LPARAM)shape_data.get())) { | 59 if (!EnumWindows(EnumWindowsCallback, (LPARAM)shape_data.get())) { |
60 LOG_GETLASTERROR(ERROR) << "Failed to enumerate windows"; | 60 PLOG(ERROR) << "Failed to enumerate windows"; |
61 desktop_shape_.Clear(); | 61 desktop_shape_.Clear(); |
62 return; | 62 return; |
63 } | 63 } |
64 | 64 |
65 // If the shape has changed, refresh |desktop_shape_|. | 65 // If the shape has changed, refresh |desktop_shape_|. |
66 if (!EqualRgn(shape_data->desktop_region, old_desktop_region_)) { | 66 if (!EqualRgn(shape_data->desktop_region, old_desktop_region_)) { |
67 old_desktop_region_.Set(shape_data->desktop_region.release()); | 67 old_desktop_region_.Set(shape_data->desktop_region.release()); |
68 | 68 |
69 // Determine the size of output buffer required to receive the region. | 69 // Determine the size of output buffer required to receive the region. |
70 DWORD bytes_size = GetRegionData(old_desktop_region_, 0, NULL); | 70 DWORD bytes_size = GetRegionData(old_desktop_region_, 0, NULL); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 } // namespace | 133 } // namespace |
134 | 134 |
135 // static | 135 // static |
136 scoped_ptr<DesktopShapeTracker> DesktopShapeTracker::Create( | 136 scoped_ptr<DesktopShapeTracker> DesktopShapeTracker::Create( |
137 webrtc::DesktopCaptureOptions options) { | 137 webrtc::DesktopCaptureOptions options) { |
138 return scoped_ptr<DesktopShapeTracker>(new DesktopShapeTrackerWin()); | 138 return scoped_ptr<DesktopShapeTracker>(new DesktopShapeTrackerWin()); |
139 } | 139 } |
140 | 140 |
141 } // namespace remoting | 141 } // namespace remoting |
OLD | NEW |