| 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 UI_DISPLAY_FAKE_DISPLAY_SNAPSHOT_H_ | 5 #ifndef UI_DISPLAY_FAKE_DISPLAY_SNAPSHOT_H_ |
| 6 #define UI_DISPLAY_FAKE_DISPLAY_SNAPSHOT_H_ | 6 #define UI_DISPLAY_FAKE_DISPLAY_SNAPSHOT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "ui/display/display.h" | |
| 16 #include "ui/display/display_export.h" | 15 #include "ui/display/display_export.h" |
| 16 #include "ui/display/types/display_constants.h" |
| 17 #include "ui/display/types/display_mode.h" | 17 #include "ui/display/types/display_mode.h" |
| 18 #include "ui/display/types/display_snapshot.h" | 18 #include "ui/display/types/display_snapshot.h" |
| 19 #include "ui/gfx/geometry/point.h" | 19 #include "ui/gfx/geometry/point.h" |
| 20 #include "ui/gfx/geometry/size.h" | 20 #include "ui/gfx/geometry/size.h" |
| 21 | 21 |
| 22 namespace display { | 22 namespace display { |
| 23 | 23 |
| 24 // A display snapshot that doesn't correspond to a physical display, used when | 24 // A display snapshot that doesn't correspond to a physical display, used when |
| 25 // running off device. | 25 // running off device. |
| 26 class DISPLAY_EXPORT FakeDisplaySnapshot : public ui::DisplaySnapshot { | 26 class DISPLAY_EXPORT FakeDisplaySnapshot : public ui::DisplaySnapshot { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // Returns a display mode with |size|. If there is no existing mode, insert | 72 // Returns a display mode with |size|. If there is no existing mode, insert |
| 73 // a display mode with |size| first. | 73 // a display mode with |size| first. |
| 74 const ui::DisplayMode* AddOrFindDisplayMode(const gfx::Size& size); | 74 const ui::DisplayMode* AddOrFindDisplayMode(const gfx::Size& size); |
| 75 // Returns a display mode equivalent to |mode|. If there is no equivalent | 75 // Returns a display mode equivalent to |mode|. If there is no equivalent |
| 76 // display mode, insert |mode| first. | 76 // display mode, insert |mode| first. |
| 77 const ui::DisplayMode* AddOrFindDisplayMode( | 77 const ui::DisplayMode* AddOrFindDisplayMode( |
| 78 std::unique_ptr<ui::DisplayMode> mode); | 78 std::unique_ptr<ui::DisplayMode> mode); |
| 79 | 79 |
| 80 int64_t id_ = Display::kInvalidDisplayID; | 80 int64_t id_ = kInvalidDisplayId; |
| 81 gfx::Point origin_; | 81 gfx::Point origin_; |
| 82 float dpi_ = 96.0; | 82 float dpi_ = 96.0; |
| 83 ui::DisplayConnectionType type_ = ui::DISPLAY_CONNECTION_TYPE_UNKNOWN; | 83 ui::DisplayConnectionType type_ = ui::DISPLAY_CONNECTION_TYPE_UNKNOWN; |
| 84 bool is_aspect_preserving_scaling_ = false; | 84 bool is_aspect_preserving_scaling_ = false; |
| 85 bool has_overscan_ = false; | 85 bool has_overscan_ = false; |
| 86 bool has_color_correction_matrix_ = false; | 86 bool has_color_correction_matrix_ = false; |
| 87 std::string name_ = "Fake Display"; | 87 std::string name_ = "Fake Display"; |
| 88 int64_t product_id_ = DisplaySnapshot::kInvalidProductID; | 88 int64_t product_id_ = DisplaySnapshot::kInvalidProductID; |
| 89 DisplayModeList modes_; | 89 DisplayModeList modes_; |
| 90 const ui::DisplayMode* current_mode_ = nullptr; | 90 const ui::DisplayMode* current_mode_ = nullptr; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 117 // DisplaySnapshot: | 117 // DisplaySnapshot: |
| 118 std::string ToString() const override; | 118 std::string ToString() const override; |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 DISALLOW_COPY_AND_ASSIGN(FakeDisplaySnapshot); | 121 DISALLOW_COPY_AND_ASSIGN(FakeDisplaySnapshot); |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace display | 124 } // namespace display |
| 125 | 125 |
| 126 #endif // UI_DISPLAY_FAKE_DISPLAY_SNAPSHOT_H_ | 126 #endif // UI_DISPLAY_FAKE_DISPLAY_SNAPSHOT_H_ |
| OLD | NEW |