| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/display/manager/chromeos/test/action_logger_util.h" | 5 #include "ui/display/manager/chromeos/test/action_logger_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "ui/display/types/display_mode.h" | 12 #include "ui/display/types/display_mode.h" |
| 13 #include "ui/display/types/display_snapshot.h" | 13 #include "ui/display/types/display_snapshot.h" |
| 14 #include "ui/display/types/gamma_ramp_rgb_entry.h" | 14 #include "ui/display/types/gamma_ramp_rgb_entry.h" |
| 15 #include "ui/display/types/native_display_delegate.h" | 15 #include "ui/display/types/native_display_delegate.h" |
| 16 #include "ui/gfx/geometry/point.h" | 16 #include "ui/gfx/geometry/point.h" |
| 17 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
| 18 | 18 |
| 19 namespace ui { | 19 namespace display { |
| 20 namespace test { | 20 namespace test { |
| 21 | 21 |
| 22 std::string DisplaySnapshotToString(const DisplaySnapshot& output) { | 22 std::string DisplaySnapshotToString(const DisplaySnapshot& output) { |
| 23 return base::StringPrintf("id=%" PRId64, output.display_id()); | 23 return base::StringPrintf("id=%" PRId64, output.display_id()); |
| 24 } | 24 } |
| 25 | 25 |
| 26 std::string GetBackgroundAction(uint32_t color_argb) { | 26 std::string GetBackgroundAction(uint32_t color_argb) { |
| 27 return base::StringPrintf("background(0x%x)", color_argb); | 27 return base::StringPrintf("background(0x%x)", color_argb); |
| 28 } | 28 } |
| 29 | 29 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 51 out2 ? DisplaySnapshotToString(*out2).c_str() : "NULL"); | 51 out2 ? DisplaySnapshotToString(*out2).c_str() : "NULL"); |
| 52 } | 52 } |
| 53 | 53 |
| 54 std::string GetSetHDCPStateAction(const DisplaySnapshot& output, | 54 std::string GetSetHDCPStateAction(const DisplaySnapshot& output, |
| 55 HDCPState state) { | 55 HDCPState state) { |
| 56 return base::StringPrintf("set_hdcp(id=%" PRId64 ",state=%d)", | 56 return base::StringPrintf("set_hdcp(id=%" PRId64 ",state=%d)", |
| 57 output.display_id(), state); | 57 output.display_id(), state); |
| 58 } | 58 } |
| 59 | 59 |
| 60 std::string SetColorCorrectionAction( | 60 std::string SetColorCorrectionAction( |
| 61 const ui::DisplaySnapshot& output, | 61 const DisplaySnapshot& output, |
| 62 const std::vector<GammaRampRGBEntry>& degamma_lut, | 62 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 63 const std::vector<GammaRampRGBEntry>& gamma_lut, | 63 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 64 const std::vector<float>& correction_matrix) { | 64 const std::vector<float>& correction_matrix) { |
| 65 std::string degamma_table; | 65 std::string degamma_table; |
| 66 for (size_t i = 0; i < degamma_lut.size(); ++i) { | 66 for (size_t i = 0; i < degamma_lut.size(); ++i) { |
| 67 degamma_table += base::StringPrintf(",degamma[%" PRIuS "]=%04x%04x%04x", i, | 67 degamma_table += base::StringPrintf(",degamma[%" PRIuS "]=%04x%04x%04x", i, |
| 68 degamma_lut[i].r, degamma_lut[i].g, | 68 degamma_lut[i].r, degamma_lut[i].g, |
| 69 degamma_lut[i].b); | 69 degamma_lut[i].b); |
| 70 } | 70 } |
| 71 std::string gamma_table; | 71 std::string gamma_table; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 94 if (!actions.empty()) | 94 if (!actions.empty()) |
| 95 actions += ","; | 95 actions += ","; |
| 96 actions += action; | 96 actions += action; |
| 97 action = va_arg(arg_list, const char*); | 97 action = va_arg(arg_list, const char*); |
| 98 } | 98 } |
| 99 va_end(arg_list); | 99 va_end(arg_list); |
| 100 return actions; | 100 return actions; |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace test | 103 } // namespace test |
| 104 } // namespace ui | 104 } // namespace display |
| OLD | NEW |