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/base/util.h" | 5 #include "remoting/base/util.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "third_party/libyuv/include/libyuv/convert.h" | 12 #include "third_party/libyuv/include/libyuv/convert.h" |
13 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" | 13 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" |
14 | 14 |
15 namespace remoting { | 15 namespace remoting { |
16 | 16 |
17 enum { kBytesPerPixelRGB32 = 4 }; | |
18 | |
19 static int CalculateRGBOffset(int x, int y, int stride) { | 17 static int CalculateRGBOffset(int x, int y, int stride) { |
20 return stride * y + kBytesPerPixelRGB32 * x; | 18 return stride * y + kBytesPerPixelRGB32 * x; |
21 } | 19 } |
22 | 20 |
23 // Do not write LOG messages in this routine since it is called from within | 21 // Do not write LOG messages in this routine since it is called from within |
24 // our LOG message handler. Bad things will happen. | 22 // our LOG message handler. Bad things will happen. |
25 std::string GetTimestampString() { | 23 std::string GetTimestampString() { |
26 base::Time t = base::Time::NowFromSystemTime(); | 24 base::Time t = base::Time::NowFromSystemTime(); |
27 base::Time::Exploded tex; | 25 base::Time::Exploded tex; |
28 t.LocalExplode(&tex); | 26 t.LocalExplode(&tex); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 141 } |
144 | 142 |
145 bool DoesRectContain(const webrtc::DesktopRect& a, | 143 bool DoesRectContain(const webrtc::DesktopRect& a, |
146 const webrtc::DesktopRect& b) { | 144 const webrtc::DesktopRect& b) { |
147 webrtc::DesktopRect intersection(a); | 145 webrtc::DesktopRect intersection(a); |
148 intersection.IntersectWith(b); | 146 intersection.IntersectWith(b); |
149 return intersection.equals(b); | 147 return intersection.equals(b); |
150 } | 148 } |
151 | 149 |
152 } // namespace remoting | 150 } // namespace remoting |
OLD | NEW |