OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 REMOTING_TEST_FRAME_GENERATOR_UTIL_H_ | 5 #ifndef REMOTING_TEST_FRAME_GENERATOR_UTIL_H_ |
6 #define REMOTING_TEST_FRAME_GENERATOR_UTIL_H_ | 6 #define REMOTING_TEST_FRAME_GENERATOR_UTIL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
11 | 11 |
12 namespace webrtc { | 12 namespace webrtc { |
13 class DesktopFrame; | 13 class DesktopFrame; |
14 } // namespace webrtc | 14 } // namespace webrtc |
15 | 15 |
16 namespace remoting { | 16 namespace remoting { |
17 namespace test { | 17 namespace test { |
18 | 18 |
19 // Loads test image from remoting/test/data. | 19 // Loads test image from remoting/test/data. |
20 std::unique_ptr<webrtc::DesktopFrame> LoadDesktopFrameFromPng(const char* name); | 20 std::unique_ptr<webrtc::DesktopFrame> LoadDesktopFrameFromPng(const char* name); |
21 | 21 |
22 // Draws rectangle filled with the given |color|. | 22 // Draws rectangle filled with the given |color|. |
23 void DrawRect(webrtc::DesktopFrame* frame, | 23 void DrawRect(webrtc::DesktopFrame* frame, |
24 webrtc::DesktopRect rect, | 24 webrtc::DesktopRect rect, |
25 uint32_t color); | 25 uint32_t color); |
26 | 26 |
| 27 // Draws barcode that encodes |value| on the |frame|. If |changed| is true then |
| 28 // frame->updated_region() will be updated as well. |
| 29 void DrawBarcode(int value, bool changed, webrtc::DesktopFrame* frame); |
| 30 |
| 31 // Reads barcode from the frame. |
| 32 int ReadBarcode(const webrtc::DesktopFrame& frame); |
| 33 |
27 } // namespace test | 34 } // namespace test |
28 } // namespace remoting | 35 } // namespace remoting |
29 | 36 |
30 #endif // REMOTING_TEST_FRAME_GENERATOR_UTIL_H_ | 37 #endif // REMOTING_TEST_FRAME_GENERATOR_UTIL_H_ |
OLD | NEW |