diff --git a/docs/development/api/fidl.md b/docs/development/api/fidl.md index f2d3d77fa52c32b1d338b67ef1a099a6e06c274a..88356545eb4ba1364e02127972d920b804da3a6c 100644 --- a/docs/development/api/fidl.md +++ b/docs/development/api/fidl.md @@ -132,7 +132,7 @@ with our current set of target languages and with potential future target languages. Prefer functional names (e.g., `fuchsia.media`) over product or code names -(e.g., `fuchsia.amber` or `fuchsia.mozart`). Product names are appropriate +(e.g., `fuchsia.amber` or `fuchsia.scenic`). Product names are appropriate when the product has some external existence beyond Fuchsia and when the protocol is specific to that product. For example, `fuchsia.cobalt` is a better name for the Cobalt interface protocol than `fuchsia.metrics` because diff --git a/docs/development/languages/fidl/reference/language.md b/docs/development/languages/fidl/reference/language.md index be250fc7f75105ab1544872f6b616d678a7965fe..4a2cab9a0af5ade22959bdbd5fb050fc3e392393 100644 --- a/docs/development/languages/fidl/reference/language.md +++ b/docs/development/languages/fidl/reference/language.md @@ -182,18 +182,18 @@ file, much like C. Libraries are named containers of FIDL declarations. Each library has a name consisting of a single identifier (e.g., "objects"), -or multiple identifiers separated by dots (e.g., "mozart.composition"). +or multiple identifiers separated by dots (e.g., "fuchsia.composition"). Library names are used in [Qualified Identifiers](#qualified-identifiers). ```fidl // library identifier separated by dots -library mozart.composition; +library fuchsia.composition; -// "using" to import library "mozart.buffers" -using mozart.buffers; +// "using" to import library "fuchsia.buffers" +using fuchsia.buffers; -// "using" to import library "mozart.geometry" and create a shortform called "geo" -using mozart.geometry as geo; +// "using" to import library "fuchsia.geometry" and create a shortform called "geo" +using fuchsia.geometry as geo; ``` @@ -201,7 +201,7 @@ Libraries may declare that they use other libraries with a "using" declaration. This allows the library to refer to symbols defined in other libraries upon which they depend. Symbols which are imported this way may be accessed by: -* qualifying them with the fully qualified library name (as in _"mozart.geometry.Rect"_), +* qualifying them with the fully qualified library name (as in _"fuchsia.geometry.Rect"_), * specifying just the library name (as in _"geometry.Rect"_), or, * using a library alias (as in _"geo.Rect"_). diff --git a/docs/getting_started.md b/docs/getting_started.md index 2537a8765a7186988aacad23fe5895ae95010d6e..3db26f997a804a54e608c85ebd96738193957f61 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -229,7 +229,7 @@ Note: to select tabs, you may need to enter "console mode". See the next section QEMU does not support Vulkan and therefore cannot run our graphics stack. -Most graphical components in Fuchsia use the [Mozart](/garnet/bin/ui/) system +Most graphical components in Fuchsia use the [Scenic](/garnet/bin/ui/) system compositor. You can launch such components, commonly found in `/system/apps`, like this: @@ -237,9 +237,9 @@ like this: launch spinning_square_view ``` -Source code for Mozart example apps is [here](/garnet/examples/ui). +Source code for Scenic example apps is [here](/garnet/examples/ui). -When you launch something that uses Mozart, uses hardware-accelerated graphics, or if you build +When you launch something that uses Scenic, uses hardware-accelerated graphics, or if you build the [default](https://fuchsia.googlesource.com/topaz/+/master/packages) package (which will boot into the Fuchsia System UI), Fuchsia will enter "graphics mode", which will not display any of the text shells. In order to use the text shell, you will need to enter "console mode" by diff --git a/docs/glossary.md b/docs/glossary.md index 16f24f0a7c7eb4711638dbbaa3f5dd6a460c21f1..1c75f1cfba1912141f96755cbdf19843e213dff0 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -359,7 +359,7 @@ set of services, which the creator can either use directly or offer to other com Services can also be obtained by interface name from a [Namespace](#namespace), which lets the component that created the namespace pick the implementation of the interface. Long-running -services, such as [Mozart](#mozart), are typically obtained through a [Namespace](#namespace), +services, such as [Scenic](#scenic), are typically obtained through a [Namespace](#namespace), which lets many clients connect to a common implementation. #### **Story** diff --git a/garnet/bin/ui/README.md b/garnet/bin/ui/README.md index c4b2f03d498821696a381ddbc0477576aa0c4b3a..b1fa8ba6aa1d82524f3311be1be8bb37887c7f5b 100644 --- a/garnet/bin/ui/README.md +++ b/garnet/bin/ui/README.md @@ -1,4 +1,4 @@ -# Mozart +# Fuchsia UI A collection of services and applications to support the graphical user interface. @@ -9,12 +9,6 @@ Scenic's primary mission is to allow client apps to present graphical content on the screen. This is achieved by providing controlled access to a shared scene graph. -## View Manager - -A service which provides user interface capabilities to views (user -interface components implemented by applications), mediates their -interactions, and manages the state of the overall view hierarchy. - ## Input Manager A service which dispatches input events to views. diff --git a/garnet/bin/ui/input_reader/buttons.cc b/garnet/bin/ui/input_reader/buttons.cc index 37e8c0f9dec309f4d8af6fe55def268e84825216..2e7e41f1e6fa19ced3875c86ae01666f09e83266 100644 --- a/garnet/bin/ui/input_reader/buttons.cc +++ b/garnet/bin/ui/input_reader/buttons.cc @@ -8,14 +8,13 @@ #include <hid-parser/report.h> #include <hid-parser/units.h> #include <hid-parser/usages.h> - +#include <src/lib/fxl/logging.h> #include <stdint.h> #include <stdio.h> -#include <vector> -#include <src/lib/fxl/logging.h> +#include <vector> -namespace mozart { +namespace ui_input { bool Buttons::ParseReportDescriptor( const hid::ReportDescriptor& report_descriptor, @@ -80,7 +79,7 @@ bool Buttons::ParseReport(const uint8_t* data, size_t len, if (report_size_ != len) { FXL_LOG(INFO) << "Sensor report: Expected size " << report_size_ - << "Received size " << len; + << "Received size " << len; return false; } @@ -110,4 +109,4 @@ bool Buttons::ParseReport(const uint8_t* data, size_t len, return true; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/buttons.h b/garnet/bin/ui/input_reader/buttons.h index fe8428b2cdb967eb15685f4ebeb171bcecedb009..1e0ae05380850e216f9aa982c14075d6637d7178 100644 --- a/garnet/bin/ui/input_reader/buttons.h +++ b/garnet/bin/ui/input_reader/buttons.h @@ -6,12 +6,13 @@ #define GARNET_BIN_UI_INPUT_READER_BUTTONS_H_ #include <hid-parser/parser.h> + #include <cstddef> #include "garnet/bin/ui/input_reader/device.h" #include "garnet/bin/ui/input_reader/touch.h" -namespace mozart { +namespace ui_input { class Buttons : public Device { public: // |Device| @@ -36,6 +37,6 @@ class Buttons : public Device { size_t report_size_ = 0; uint8_t report_id_ = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_BUTTONS_H_ diff --git a/garnet/bin/ui/input_reader/device.h b/garnet/bin/ui/input_reader/device.h index ad2646ee2828984660c115a46da4e3ad255f0950..f71c618001fb204c05387f2684d9f47db8c756f7 100644 --- a/garnet/bin/ui/input_reader/device.h +++ b/garnet/bin/ui/input_reader/device.h @@ -5,12 +5,12 @@ #ifndef GARNET_BIN_UI_INPUT_READER_DEVICE_H_ #define GARNET_BIN_UI_INPUT_READER_DEVICE_H_ -#include "garnet/bin/ui/input_reader/protocols.h" - #include <fuchsia/ui/input/cpp/fidl.h> #include <hid-parser/parser.h> -namespace mozart { +#include "garnet/bin/ui/input_reader/protocols.h" + +namespace ui_input { // This class represents a single HID input device. The purpose of a Device // is to parse raw report bytes into an InputReport form. The report bytes @@ -61,6 +61,6 @@ class Device { virtual uint8_t ReportId() const = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_DEVICE_H_ diff --git a/garnet/bin/ui/input_reader/device_watcher.h b/garnet/bin/ui/input_reader/device_watcher.h index b1c0e0fd2d5b9cecb790f9a091e13895c1d3a7fe..8ab559816d6491e39c46f802224b9005cd2dda88 100644 --- a/garnet/bin/ui/input_reader/device_watcher.h +++ b/garnet/bin/ui/input_reader/device_watcher.h @@ -7,7 +7,7 @@ #include <lib/fit/function.h> -namespace mozart { +namespace ui_input { class HidDecoder; @@ -25,5 +25,5 @@ class DeviceWatcher { virtual void Watch(ExistsCallback callback) = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_DEVICE_WATCHER_H_ diff --git a/garnet/bin/ui/input_reader/fdio_device_watcher.cc b/garnet/bin/ui/input_reader/fdio_device_watcher.cc index c3b5cf769f4dc3bdcad066f208d65c633f6b7093..f2ce6f78fb2623c44f9ded235bac99e39cffb564 100644 --- a/garnet/bin/ui/input_reader/fdio_device_watcher.cc +++ b/garnet/bin/ui/input_reader/fdio_device_watcher.cc @@ -9,7 +9,7 @@ #include "garnet/bin/ui/input_reader/fdio_hid_decoder.h" #include "lib/fsl/io/device_watcher.h" -namespace mozart { +namespace ui_input { FdioDeviceWatcher::FdioDeviceWatcher(std::string directory_path) : directory_path_(std::move(directory_path)) {} @@ -30,4 +30,4 @@ void FdioDeviceWatcher::Watch(ExistsCallback callback) { }); } -} // namespace mozart \ No newline at end of file +} // namespace ui_input \ No newline at end of file diff --git a/garnet/bin/ui/input_reader/fdio_device_watcher.h b/garnet/bin/ui/input_reader/fdio_device_watcher.h index 18a9f312f86dd4f1323773169164b4575b1bd1f4..4d354f5d36fc7954b6243939a3213f008002ffe8 100644 --- a/garnet/bin/ui/input_reader/fdio_device_watcher.h +++ b/garnet/bin/ui/input_reader/fdio_device_watcher.h @@ -13,7 +13,7 @@ namespace fsl { class DeviceWatcher; } -namespace mozart { +namespace ui_input { // This is the "real" FDIO implementation of |DeviceWatcher|, which uses // |fsl::DeviceWatcher|. @@ -30,5 +30,5 @@ class FdioDeviceWatcher : public DeviceWatcher { std::unique_ptr<fsl::DeviceWatcher> watch_; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_FDIO_DEVICE_WATCHER_H_ diff --git a/garnet/bin/ui/input_reader/fdio_hid_decoder.cc b/garnet/bin/ui/input_reader/fdio_hid_decoder.cc index a4dcc29b5dae4e2f09bca7f2f826e76965dd3ae1..bc32f6c28e5669d9183849d54416a574ef7913b8 100644 --- a/garnet/bin/ui/input_reader/fdio_hid_decoder.cc +++ b/garnet/bin/ui/input_reader/fdio_hid_decoder.cc @@ -4,8 +4,6 @@ #include "garnet/bin/ui/input_reader/fdio_hid_decoder.h" -#include <unistd.h> - #include <fuchsia/device/c/fidl.h> #include <fuchsia/hardware/input/c/fidl.h> #include <hid/acer12.h> @@ -17,6 +15,7 @@ #include <src/lib/fxl/arraysize.h> #include <src/lib/fxl/logging.h> #include <trace/event.h> +#include <unistd.h> #include <zircon/status.h> namespace { @@ -33,7 +32,7 @@ bool log_err(zx_status_t status, const std::string& what, } // namespace -namespace mozart { +namespace ui_input { FdioHidDecoder::FdioHidDecoder(const std::string& name, fbl::unique_fd fd) : caller_(std::move(fd)), name_(name) {} @@ -171,4 +170,4 @@ zx_status_t FdioHidDecoder::Send(ReportType type, uint8_t report_id, return ZX_OK; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/fdio_hid_decoder.h b/garnet/bin/ui/input_reader/fdio_hid_decoder.h index 807ff1617908ba7349b9d79fe8f6f858d402d10e..0c4ab3cc26a2356f248421710328833eb579e817 100644 --- a/garnet/bin/ui/input_reader/fdio_hid_decoder.h +++ b/garnet/bin/ui/input_reader/fdio_hid_decoder.h @@ -5,13 +5,13 @@ #ifndef GARNET_BIN_UI_INPUT_READER_FDIO_HID_DECODER_H_ #define GARNET_BIN_UI_INPUT_READER_FDIO_HID_DECODER_H_ -#include <string> -#include <vector> - #include <fbl/unique_fd.h> #include <fuchsia/ui/input/cpp/fidl.h> #include <lib/fzl/fdio.h> +#include <string> +#include <vector> + #include "garnet/bin/ui/input_reader/hid_decoder.h" #include "garnet/bin/ui/input_reader/mouse.h" #include "garnet/bin/ui/input_reader/touch.h" @@ -24,7 +24,7 @@ namespace hid { struct ReportField; } -namespace mozart { +namespace ui_input { // This is the "real" FDIO implementation of |HidDecoder|. // FdioHidDecoder takes ownership of an fd that represents a single Hid device. @@ -65,6 +65,6 @@ class FdioHidDecoder : public HidDecoder { uint32_t reports_read_ = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_FDIO_HID_DECODER_H_ diff --git a/garnet/bin/ui/input_reader/hardcoded.cc b/garnet/bin/ui/input_reader/hardcoded.cc index f03c6cc103a7d9963144ab1d2b9798db0b034d0a..de8af75d62091718590f7e60b3328f9e0425b410 100644 --- a/garnet/bin/ui/input_reader/hardcoded.cc +++ b/garnet/bin/ui/input_reader/hardcoded.cc @@ -86,7 +86,7 @@ const size_t kAmbientLight = 2; } // namespace -namespace mozart { +namespace ui_input { bool Hardcoded::ParseGamepadDescriptor(const hid::ReportField* fields, size_t count) { @@ -1440,4 +1440,4 @@ void Hardcoded::Read(std::vector<uint8_t> report, int report_len, } } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/hardcoded.h b/garnet/bin/ui/input_reader/hardcoded.h index d9f36d5c5980324a9b2d26f27df4b4172bb105e2..5ead08c4fb8b41bc9b2d7c04f2d0dbe9f0fbc72e 100644 --- a/garnet/bin/ui/input_reader/hardcoded.h +++ b/garnet/bin/ui/input_reader/hardcoded.h @@ -5,19 +5,19 @@ #ifndef GARNET_BIN_UI_INPUT_READER_HARDCODED_H_ #define GARNET_BIN_UI_INPUT_READER_HARDCODED_H_ -#include "garnet/bin/ui/input_reader/hid_decoder.h" -#include "garnet/bin/ui/input_reader/protocols.h" - -#include <array> -#include <cstddef> - #include <fuchsia/ui/input/cpp/fidl.h> #include <hid-parser/parser.h> #include <hid-parser/usages.h> #include <hid/acer12.h> #include <hid/paradise.h> -namespace mozart { +#include <array> +#include <cstddef> + +#include "garnet/bin/ui/input_reader/hid_decoder.h" +#include "garnet/bin/ui/input_reader/protocols.h" + +namespace ui_input { class Hardcoded { public: @@ -167,6 +167,6 @@ class Hardcoded { Protocol protocol_; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_HARDCODED_H_ diff --git a/garnet/bin/ui/input_reader/hid_decoder.cc b/garnet/bin/ui/input_reader/hid_decoder.cc index 4efc794357d806cf25343d2d4293b13175f17b17..5db6332eb5dd18a40951e953392d357ac78026f3 100644 --- a/garnet/bin/ui/input_reader/hid_decoder.cc +++ b/garnet/bin/ui/input_reader/hid_decoder.cc @@ -4,9 +4,9 @@ #include "garnet/bin/ui/input_reader/hid_decoder.h" -namespace mozart { +namespace ui_input { HidDecoder::HidDecoder() = default; HidDecoder::~HidDecoder() = default; -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/hid_decoder.h b/garnet/bin/ui/input_reader/hid_decoder.h index ad801baa2e2d958eee03c16763fb640b85276ebb..7994033a35e3a9a45c6f7cf99e3a517974861b02 100644 --- a/garnet/bin/ui/input_reader/hid_decoder.h +++ b/garnet/bin/ui/input_reader/hid_decoder.h @@ -5,15 +5,15 @@ #ifndef GARNET_BIN_UI_INPUT_READER_HID_DECODER_H_ #define GARNET_BIN_UI_INPUT_READER_HID_DECODER_H_ +#include <lib/zx/event.h> + #include <string> #include <vector> -#include <lib/zx/event.h> - #include "garnet/bin/ui/input_reader/mouse.h" #include "garnet/bin/ui/input_reader/touch.h" -namespace mozart { +namespace ui_input { // This interface wraps the file descriptor associated with a HID input // device and presents a simpler Read() interface. This is a transitional @@ -71,6 +71,6 @@ class HidDecoder { const std::vector<uint8_t>& report) = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_HID_DECODER_H_ diff --git a/garnet/bin/ui/input_reader/input_interpreter.cc b/garnet/bin/ui/input_reader/input_interpreter.cc index 68e4d840327e1ea1f2c3ff0aad3cd9e9a89d66b5..69fab840e7473d3a9ad4df93ad6c14d761666691 100644 --- a/garnet/bin/ui/input_reader/input_interpreter.cc +++ b/garnet/bin/ui/input_reader/input_interpreter.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "garnet/bin/ui/input_reader/input_interpreter.h" -#include "garnet/bin/ui/input_reader/device.h" #include <fuchsia/ui/input/cpp/fidl.h> #include <hid-parser/parser.h> @@ -20,6 +19,7 @@ #include <zircon/errors.h> #include <zircon/types.h> +#include "garnet/bin/ui/input_reader/device.h" #include "garnet/bin/ui/input_reader/fdio_hid_decoder.h" #include "garnet/bin/ui/input_reader/protocols.h" @@ -38,7 +38,7 @@ fuchsia::ui::input::InputReport CloneReport( } // namespace -namespace mozart { +namespace ui_input { InputInterpreter::InputInterpreter( std::unique_ptr<HidDecoder> hid_decoder, @@ -190,8 +190,7 @@ bool InputInterpreter::ParseHidFeatureReportDescriptor( if (collection == nullptr) { FXL_LOG(INFO) << "Can't process HID feature report descriptor for " - << name() - << "; Needed a valid Collection but didn't get one"; + << name() << "; Needed a valid Collection but didn't get one"; return false; } @@ -234,7 +233,7 @@ bool InputInterpreter::ParseHidInputReportDescriptor( if (collection == nullptr) { FXL_LOG(INFO) << "Can't process HID report descriptor for " << name() - << "; Needed a valid Collection but didn't get one"; + << "; Needed a valid Collection but didn't get one"; return false; } @@ -311,7 +310,7 @@ bool InputInterpreter::ParseHidInputReportDescriptor( if (!input_device.device->ParseReportDescriptor(*input_desc, &input_device.descriptor)) { FXL_LOG(INFO) << "Can't process HID report descriptor for " << name() - << "; Failed to do generic device parsing"; + << "; Failed to do generic device parsing"; return false; } devices_.push_back(std::move(input_device)); @@ -358,7 +357,7 @@ bool InputInterpreter::ParseProtocol() { hid::ParseReportDescriptor(desc.data(), desc.size(), &dev_desc); if (parse_res != hid::ParseResult::kParseOk) { FXL_LOG(INFO) << "hid-parser: error " << int(parse_res) - << " parsing report descriptor for " << name(); + << " parsing report descriptor for " << name(); return false; } @@ -386,11 +385,11 @@ bool InputInterpreter::ParseProtocol() { // If we never parsed a single device correctly then fail. if (devices_.size() == 0) { FXL_LOG(INFO) << "Can't process HID report descriptor for " << name() - << "; All parsing attempts failed."; + << "; All parsing attempts failed."; return false; } return true; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/input_interpreter.h b/garnet/bin/ui/input_reader/input_interpreter.h index c76965de1c380c25037902952141dc2893e657e5..402975e79e72867fab11ba21f670e9bba73f6ba2 100644 --- a/garnet/bin/ui/input_reader/input_interpreter.h +++ b/garnet/bin/ui/input_reader/input_interpreter.h @@ -5,6 +5,7 @@ #ifndef GARNET_BIN_UI_INPUT_READER_INPUT_INTERPRETER_H_ #define GARNET_BIN_UI_INPUT_READER_INPUT_INTERPRETER_H_ +#include <fuchsia/ui/input/cpp/fidl.h> #include <hid/acer12.h> #include <lib/zx/event.h> #include <zircon/types.h> @@ -22,9 +23,7 @@ #include "garnet/bin/ui/input_reader/touchpad.h" #include "garnet/bin/ui/input_reader/touchscreen.h" -#include <fuchsia/ui/input/cpp/fidl.h> - -namespace mozart { +namespace ui_input { // Each InputInterpreter instance observes and routes events coming in from one // file descriptor under /dev/class/input. Each file descriptor may multiplex @@ -109,6 +108,6 @@ class InputInterpreter { Hardcoded hardcoded_ = {}; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_INPUT_INTERPRETER_H_ diff --git a/garnet/bin/ui/input_reader/input_reader.cc b/garnet/bin/ui/input_reader/input_reader.cc index 807bbc2183c0c2c1ea6710c84d6e7a7ec4b6b98c..8574ba71302eaef5aef36a2502cb5474e606f157 100644 --- a/garnet/bin/ui/input_reader/input_reader.cc +++ b/garnet/bin/ui/input_reader/input_reader.cc @@ -11,7 +11,7 @@ #include "garnet/bin/ui/input_reader/input_interpreter.h" #include "src/lib/fxl/logging.h" -namespace mozart { +namespace ui_input { namespace { @@ -143,4 +143,4 @@ void InputReader::OnDisplayHandleReady(async_dispatcher_t* dispatcher, } } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/input_reader.h b/garnet/bin/ui/input_reader/input_reader.h index 98ec311505e8b4e5d71abc3656ae4eddc1e33875..13037cdef4fb7fe93a57c39496c97078ad5c3c4c 100644 --- a/garnet/bin/ui/input_reader/input_reader.h +++ b/garnet/bin/ui/input_reader/input_reader.h @@ -5,15 +5,15 @@ #ifndef GARNET_BIN_UI_INPUT_READER_INPUT_READER_H_ #define GARNET_BIN_UI_INPUT_READER_INPUT_READER_H_ -#include <map> - #include <fuchsia/ui/input/cpp/fidl.h> #include <lib/async/cpp/wait.h> +#include <map> + #include "garnet/bin/ui/input_reader/device_watcher.h" #include "src/lib/fxl/macros.h" -namespace mozart { +namespace ui_input { class InputInterpreter; @@ -66,6 +66,6 @@ class InputReader { FXL_DISALLOW_COPY_AND_ASSIGN(InputReader); }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_INPUT_READER_H_ diff --git a/garnet/bin/ui/input_reader/mouse.cc b/garnet/bin/ui/input_reader/mouse.cc index 60c7a29bc41b6d146af367406b0532fa053b8db8..d92b330e7495b3cf08e356004ef9b88293794117 100644 --- a/garnet/bin/ui/input_reader/mouse.cc +++ b/garnet/bin/ui/input_reader/mouse.cc @@ -3,20 +3,20 @@ // found in the LICENSE file. #include "garnet/bin/ui/input_reader/mouse.h" -#include "garnet/bin/ui/input_reader/device.h" #include <hid-parser/parser.h> #include <hid-parser/report.h> #include <hid-parser/units.h> #include <hid-parser/usages.h> - +#include <src/lib/fxl/logging.h> #include <stdint.h> #include <stdio.h> + #include <vector> -#include <src/lib/fxl/logging.h> +#include "garnet/bin/ui/input_reader/device.h" -namespace mozart { +namespace ui_input { bool Mouse::ParseReportDescriptor( const hid::ReportDescriptor& report_descriptor, @@ -113,7 +113,7 @@ bool Mouse::ParseReport(const uint8_t* data, size_t len, Report mouse_report = {}; if (len != report_size_) { FXL_LOG(INFO) << "Mouse HID Report is not correct size, (" << len - << " != " << report_size_ << ")"; + << " != " << report_size_ << ")"; return false; } @@ -188,4 +188,4 @@ bool Mouse::ParseReport(const uint8_t* data, size_t len, return true; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/mouse.h b/garnet/bin/ui/input_reader/mouse.h index 428d211a9e86e7b8bf98e69370bfdad0f7467e82..16f43160c9ffcb383120bfd71ea7ea221f07f2d4 100644 --- a/garnet/bin/ui/input_reader/mouse.h +++ b/garnet/bin/ui/input_reader/mouse.h @@ -5,13 +5,13 @@ #ifndef GARNET_BIN_UI_INPUT_READER_MOUSE_H_ #define GARNET_BIN_UI_INPUT_READER_MOUSE_H_ +#include <hid-parser/parser.h> + #include <cstddef> #include "garnet/bin/ui/input_reader/device.h" -#include <hid-parser/parser.h> - -namespace mozart { +namespace ui_input { class Mouse : public Device { public: @@ -54,6 +54,6 @@ class Mouse : public Device { size_t report_size_ = 0; uint8_t report_id_ = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_MOUSE_H_ diff --git a/garnet/bin/ui/input_reader/protocols.h b/garnet/bin/ui/input_reader/protocols.h index 82b98c1584bf0a1202ac1bf2626a2bf2f8ddd338..f6a744aa1abc04631dedd20111a7dd2b69dd6c5b 100644 --- a/garnet/bin/ui/input_reader/protocols.h +++ b/garnet/bin/ui/input_reader/protocols.h @@ -7,7 +7,7 @@ #include <zircon/types.h> -namespace mozart { +namespace ui_input { enum class Protocol : uint32_t { Other, Keyboard, @@ -63,6 +63,6 @@ enum class SensorDeviceType { PARADISE, AMBIENT_LIGHT, }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_PROTOCOLS_H_ diff --git a/garnet/bin/ui/input_reader/sensor.cc b/garnet/bin/ui/input_reader/sensor.cc index 161282cd1bc07f2c5f82f44a58adbe9b1cf74ef0..5fec03231515b48d882794e167f4a119ddc18ef1 100644 --- a/garnet/bin/ui/input_reader/sensor.cc +++ b/garnet/bin/ui/input_reader/sensor.cc @@ -8,12 +8,11 @@ #include <hid-parser/report.h> #include <hid-parser/units.h> #include <hid-parser/usages.h> - +#include <src/lib/fxl/logging.h> #include <stdint.h> #include <stdio.h> -#include <vector> -#include <src/lib/fxl/logging.h> +#include <vector> namespace { @@ -52,7 +51,7 @@ bool IsZUsage(const hid::Usage& u) { } // namespace -namespace mozart { +namespace ui_input { bool Sensor::ParseReportDescriptor( const hid::ReportDescriptor& report_descriptor, @@ -85,7 +84,7 @@ bool Sensor::ParseReportDescriptor( } else { FXL_LOG(INFO) << "Sensor report descriptor: Sensor page not supported (0x" - << std::hex << sensor_usage.usage << ")"; + << std::hex << sensor_usage.usage << ")"; return false; } @@ -113,7 +112,7 @@ bool Sensor::ParseReportDescriptor( if ((caps & Capabilities::SCALAR) && (caps & (Capabilities::X | Capabilities::Y | Capabilities::Z))) { FXL_LOG(INFO) << "Sensor report descriptor: Sensor describes Axis and " - "Scalar, must only describe one"; + "Scalar, must only describe one"; return false; } @@ -156,7 +155,7 @@ bool Sensor::ParseReport(const uint8_t* data, size_t len, if (report_size_ != len) { FXL_LOG(INFO) << "Sensor report: Expected size " << report_size_ - << "Recieved size " << len; + << "Recieved size " << len; return false; } @@ -205,4 +204,4 @@ bool Sensor::ParseReport(const uint8_t* data, size_t len, return true; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/sensor.h b/garnet/bin/ui/input_reader/sensor.h index 6b12714a4fcd5c14e9117e135eaaa8b7c0693ee6..2722fef446cec38478893eea74d9b7892f44453a 100644 --- a/garnet/bin/ui/input_reader/sensor.h +++ b/garnet/bin/ui/input_reader/sensor.h @@ -6,11 +6,12 @@ #define GARNET_BIN_UI_INPUT_READER_SENSOR_H_ #include <hid-parser/parser.h> + #include <cstddef> #include "garnet/bin/ui/input_reader/device.h" -namespace mozart { +namespace ui_input { class Sensor : public Device { public: @@ -41,6 +42,6 @@ class Sensor : public Device { uint8_t report_id_ = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_SENSOR_H_ diff --git a/garnet/bin/ui/input_reader/stylus.cc b/garnet/bin/ui/input_reader/stylus.cc index b0cbb0994d4d0e4e29c34775bc3c92c0abddc1d1..ca48613b2528363dfcaf7079ef68e7e4d297c8eb 100644 --- a/garnet/bin/ui/input_reader/stylus.cc +++ b/garnet/bin/ui/input_reader/stylus.cc @@ -3,20 +3,20 @@ // found in the LICENSE file. #include "garnet/bin/ui/input_reader/stylus.h" -#include "garnet/bin/ui/input_reader/device.h" #include <hid-parser/parser.h> #include <hid-parser/report.h> #include <hid-parser/units.h> #include <hid-parser/usages.h> - +#include <src/lib/fxl/logging.h> #include <stdint.h> #include <stdio.h> + #include <vector> -#include <src/lib/fxl/logging.h> +#include "garnet/bin/ui/input_reader/device.h" -namespace mozart { +namespace ui_input { bool Stylus::ParseReportDescriptor( const hid::ReportDescriptor& report_descriptor, @@ -123,7 +123,7 @@ bool Stylus::ParseReport(const uint8_t* data, size_t len, if (len != report_size_) { FXL_LOG(INFO) << "Stylus HID Report is not correct size, (" << len - << " != " << report_size_ << ")"; + << " != " << report_size_ << ")"; return false; } @@ -208,4 +208,4 @@ bool Stylus::ParseReport(const uint8_t* data, size_t len, return true; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/stylus.h b/garnet/bin/ui/input_reader/stylus.h index d3be95ab6301002cd727ca10ae94abc5f6cbbbe0..64bc3517d494eddc1bcae5c2465e16784be9a386 100644 --- a/garnet/bin/ui/input_reader/stylus.h +++ b/garnet/bin/ui/input_reader/stylus.h @@ -5,13 +5,13 @@ #ifndef GARNET_BIN_UI_INPUT_READER_STYLUS_H_ #define GARNET_BIN_UI_INPUT_READER_STYLUS_H_ +#include <hid-parser/parser.h> + #include <cstddef> #include "garnet/bin/ui/input_reader/device.h" -#include <hid-parser/parser.h> - -namespace mozart { +namespace ui_input { class Stylus : public Device { public: @@ -49,6 +49,6 @@ class Stylus : public Device { size_t report_size_ = 0; uint8_t report_id_ = 0; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_STYLUS_H_ diff --git a/garnet/bin/ui/input_reader/tests/end_to_end_tests.cc b/garnet/bin/ui/input_reader/tests/end_to_end_tests.cc index 220a9d4043b9d91b70a4fcede11fed0dc4c32de9..0a9d647ba45813f2b0f5640e9b749842266a8d9c 100644 --- a/garnet/bin/ui/input_reader/tests/end_to_end_tests.cc +++ b/garnet/bin/ui/input_reader/tests/end_to_end_tests.cc @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <set> - #include <hid/boot.h> #include <hid/buttons.h> #include <hid/paradise.h> #include <hid/usages.h> +#include <set> + #include "garnet/bin/ui/input_reader/input_reader.h" #include "garnet/bin/ui/input_reader/tests/mock_device_watcher.h" #include "garnet/bin/ui/input_reader/tests/mock_hid_decoder.h" @@ -18,12 +18,12 @@ #include "lib/ui/tests/mocks/mock_input_device.h" #include "lib/ui/tests/mocks/mock_input_device_registry.h" -namespace mozart { +namespace ui_input { namespace { -using MockInputDevice = mozart::test::MockInputDevice; -using MockInputDeviceRegistry = mozart::test::MockInputDeviceRegistry; +using MockInputDevice = ui_input::test::MockInputDevice; +using MockInputDeviceRegistry = ui_input::test::MockInputDeviceRegistry; // This fixture sets up a |MockDeviceWatcher| so that tests can add mock // devices. @@ -284,4 +284,4 @@ TEST_F(ReaderInterpreterInputTest, MediaButtonsTest) { EXPECT_EQ(0x1, last_report_.media_buttons->volume); } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/tests/interface_tests.cc b/garnet/bin/ui/input_reader/tests/interface_tests.cc index 3c6b6e0750ba0405bfa2a0c57c59661fcd930fb0..1866802ac66e1ef30ae790c8b25bc7bf9856d4ff 100644 --- a/garnet/bin/ui/input_reader/tests/interface_tests.cc +++ b/garnet/bin/ui/input_reader/tests/interface_tests.cc @@ -6,10 +6,10 @@ #include <hid/usages.h> #include "gtest/gtest.h" -#include "src/lib/fxl/time/time_point.h" #include "lib/gtest/test_loop_fixture.h" #include "lib/ui/tests/mocks/mock_input_device.h" #include "lib/ui/tests/mocks/mock_input_device_registry.h" +#include "src/lib/fxl/time/time_point.h" namespace input { namespace test { @@ -35,8 +35,8 @@ TEST_F(InputInterfaceTest, RegisterKeyboardTest) { fuchsia::ui::input::InputDevicePtr input_device; uint32_t on_register_count = 0; - mozart::test::MockInputDeviceRegistry registry( - [&on_register_count](mozart::test::MockInputDevice* input_device) { + ui_input::test::MockInputDeviceRegistry registry( + [&on_register_count](ui_input::test::MockInputDevice* input_device) { on_register_count++; }, nullptr); @@ -53,7 +53,7 @@ TEST_F(InputInterfaceTest, InputKeyboardTest) { fuchsia::ui::input::InputDevicePtr input_device; uint32_t on_report_count = 0; - mozart::test::MockInputDeviceRegistry registry( + ui_input::test::MockInputDeviceRegistry registry( nullptr, [&on_report_count](fuchsia::ui::input::InputReport report) { EXPECT_TRUE(report.keyboard); EXPECT_EQ(HID_USAGE_KEY_A, report.keyboard->pressed_keys.at(0)); diff --git a/garnet/bin/ui/input_reader/tests/mock_device_watcher.cc b/garnet/bin/ui/input_reader/tests/mock_device_watcher.cc index 3bb682d5c9b39bb3a92b90d9d794853284a58178..ba960c83a8f2696d92c2c2e2987dcff195cf07f3 100644 --- a/garnet/bin/ui/input_reader/tests/mock_device_watcher.cc +++ b/garnet/bin/ui/input_reader/tests/mock_device_watcher.cc @@ -6,7 +6,7 @@ #include "garnet/bin/ui/input_reader/hid_decoder.h" -namespace mozart { +namespace ui_input { MockDeviceWatcher::MockDeviceWatcher() : weak_ptr_factory_(this) {} MockDeviceWatcher::~MockDeviceWatcher() = default; @@ -23,4 +23,4 @@ void MockDeviceWatcher::AddDevice(std::unique_ptr<HidDecoder> hid_decoder) { callback_(std::move(hid_decoder)); } -} // namespace mozart \ No newline at end of file +} // namespace ui_input \ No newline at end of file diff --git a/garnet/bin/ui/input_reader/tests/mock_device_watcher.h b/garnet/bin/ui/input_reader/tests/mock_device_watcher.h index c8bd91c618a21ce31fc26bf8765aa24f5ffad036..4f0924a43c2aecee00a0cfc89c2a9de7057da7f6 100644 --- a/garnet/bin/ui/input_reader/tests/mock_device_watcher.h +++ b/garnet/bin/ui/input_reader/tests/mock_device_watcher.h @@ -8,7 +8,7 @@ #include "garnet/bin/ui/input_reader/device_watcher.h" #include "src/lib/fxl/memory/weak_ptr.h" -namespace mozart { +namespace ui_input { class MockDeviceWatcher : public DeviceWatcher { public: @@ -26,6 +26,6 @@ class MockDeviceWatcher : public DeviceWatcher { fxl::WeakPtrFactory<MockDeviceWatcher> weak_ptr_factory_; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_TESTS_MOCK_DEVICE_WATCHER_H_ diff --git a/garnet/bin/ui/input_reader/tests/mock_hid_decoder.cc b/garnet/bin/ui/input_reader/tests/mock_hid_decoder.cc index 37662dd9104e116759cd466f1d27340c089986df..92b345cd1690e1f2db4380d9c472dce1e67a8330 100644 --- a/garnet/bin/ui/input_reader/tests/mock_hid_decoder.cc +++ b/garnet/bin/ui/input_reader/tests/mock_hid_decoder.cc @@ -3,11 +3,11 @@ // found in the LICENSE file. #include "garnet/bin/ui/input_reader/tests/mock_hid_decoder.h" -#include "garnet/bin/ui/input_reader/touch.h" +#include "garnet/bin/ui/input_reader/touch.h" #include "src/lib/fxl/logging.h" -namespace mozart { +namespace ui_input { namespace { @@ -96,4 +96,4 @@ void MockHidDecoder::ClearReport() { FXL_CHECK(event_.signal(ZX_USER_SIGNAL_0, 0) == ZX_OK); } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/tests/mock_hid_decoder.h b/garnet/bin/ui/input_reader/tests/mock_hid_decoder.h index 6e9b0b690649d3f825aba8d2e920c5e30ccd1059..56c0ce08d87581083990006299942963b6bdf901 100644 --- a/garnet/bin/ui/input_reader/tests/mock_hid_decoder.h +++ b/garnet/bin/ui/input_reader/tests/mock_hid_decoder.h @@ -11,7 +11,7 @@ #include "garnet/bin/ui/input_reader/hid_decoder.h" #include "src/lib/fxl/memory/weak_ptr.h" -namespace mozart { +namespace ui_input { // Mocks HidDecoder and allows sending arbitrary ReportDescriptors and Reports // through |SendReportDescriptor| and |Send|. @@ -82,6 +82,6 @@ class MockHidDecoder : public HidDecoder { fxl::WeakPtrFactory<MockHidDecoder> weak_ptr_factory_; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_TESTS_MOCK_HID_DECODER_H_ diff --git a/garnet/bin/ui/input_reader/tests/mouse_test.cc b/garnet/bin/ui/input_reader/tests/mouse_test.cc index c6f21fdd5be174762c3d56903547c6a003f96d09..dc8f150a72b0d0dceee92a6f20489b6429efecd7 100644 --- a/garnet/bin/ui/input_reader/tests/mouse_test.cc +++ b/garnet/bin/ui/input_reader/tests/mouse_test.cc @@ -2,16 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <hid-parser/parser.h> -#include <hid-parser/usages.h> -#include <hid/paradise.h> +#include "garnet/bin/ui/input_reader/mouse.h" #include <fuchsia/ui/input/cpp/fidl.h> #include <gtest/gtest.h> +#include <hid-parser/parser.h> +#include <hid-parser/usages.h> +#include <hid/paradise.h> #include <src/lib/fxl/time/time_point.h> -#include "garnet/bin/ui/input_reader/mouse.h" - namespace input { namespace { @@ -56,13 +55,13 @@ TEST(MouseTest, BootMouse) { boot_mouse_desc, sizeof(boot_mouse_desc), &dev_desc); ASSERT_EQ(hid::ParseResult::kParseOk, parse_res); - mozart::Mouse mouse = {}; - mozart::Device::Descriptor device_descriptor = {}; + ui_input::Mouse mouse = {}; + ui_input::Device::Descriptor device_descriptor = {}; bool success = mouse.ParseReportDescriptor(dev_desc->report[0], &device_descriptor); ASSERT_TRUE(success); EXPECT_EQ(device_descriptor.has_mouse, true); - EXPECT_EQ(device_descriptor.mouse_type, mozart::MouseDeviceType::HID); + EXPECT_EQ(device_descriptor.mouse_type, ui_input::MouseDeviceType::HID); EXPECT_EQ(device_descriptor.mouse_descriptor->buttons, fuchsia::ui::input::kMouseButtonPrimary | fuchsia::ui::input::kMouseButtonSecondary | diff --git a/garnet/bin/ui/input_reader/tests/sensor_test.cc b/garnet/bin/ui/input_reader/tests/sensor_test.cc index a46d1a4ba1b0f9e12bee17d3d39fc95bdd44f3da..bd3787afb4a699abfcca2b1bfed969ca8a32f7b5 100644 --- a/garnet/bin/ui/input_reader/tests/sensor_test.cc +++ b/garnet/bin/ui/input_reader/tests/sensor_test.cc @@ -3,19 +3,20 @@ // found in the LICENSE file. #include "garnet/bin/ui/input_reader/sensor.h" -#include "garnet/bin/ui/input_reader/tests/sensor_test_data.h" #include <gtest/gtest.h> #include <hid-parser/parser.h> #include <hid-parser/usages.h> #include <src/lib/fxl/time/time_point.h> +#include "garnet/bin/ui/input_reader/tests/sensor_test_data.h" + namespace input { namespace test { TEST(SensorTest, LightMeter) { - mozart::Sensor sensor; + ui_input::Sensor sensor; hid::DeviceDescriptor *hid_desc = nullptr; auto parse_res = hid::ParseReportDescriptor( @@ -24,11 +25,11 @@ TEST(SensorTest, LightMeter) { ASSERT_NE(0UL, hid_desc->rep_count); ASSERT_NE(0UL, hid_desc->report[0].input_count); - mozart::Device::Descriptor descriptor = {}; + ui_input::Device::Descriptor descriptor = {}; auto success = sensor.ParseReportDescriptor(hid_desc->report[0], &descriptor); ASSERT_EQ(true, success); - ASSERT_EQ(mozart::Protocol::Sensor, descriptor.protocol); + ASSERT_EQ(ui_input::Protocol::Sensor, descriptor.protocol); ASSERT_EQ(true, descriptor.has_sensor); ASSERT_NE(nullptr, descriptor.sensor_descriptor); ASSERT_EQ(fuchsia::ui::input::SensorType::LIGHTMETER, @@ -50,7 +51,7 @@ TEST(SensorTest, LightMeter) { } TEST(SensorTest, Accelerometer) { - mozart::Sensor sensor; + ui_input::Sensor sensor; hid::DeviceDescriptor *hid_desc = nullptr; auto parse_res = hid::ParseReportDescriptor( @@ -59,11 +60,11 @@ TEST(SensorTest, Accelerometer) { ASSERT_NE(0UL, hid_desc->rep_count); ASSERT_NE(0UL, hid_desc->report[0].input_count); - mozart::Device::Descriptor descriptor = {}; + ui_input::Device::Descriptor descriptor = {}; auto success = sensor.ParseReportDescriptor(hid_desc->report[0], &descriptor); ASSERT_EQ(true, success); - ASSERT_EQ(mozart::Protocol::Sensor, descriptor.protocol); + ASSERT_EQ(ui_input::Protocol::Sensor, descriptor.protocol); ASSERT_EQ(true, descriptor.has_sensor); ASSERT_NE(nullptr, descriptor.sensor_descriptor); ASSERT_EQ(fuchsia::ui::input::SensorType::ACCELEROMETER, diff --git a/garnet/bin/ui/input_reader/tests/stylus_test.cc b/garnet/bin/ui/input_reader/tests/stylus_test.cc index 171143646183dedf3cc81c0db920f0b89e8d8366..6c70999e7cafe746f0c6659ea381b113e0db9b80 100644 --- a/garnet/bin/ui/input_reader/tests/stylus_test.cc +++ b/garnet/bin/ui/input_reader/tests/stylus_test.cc @@ -2,17 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "garnet/bin/ui/input_reader/stylus.h" + +#include <fuchsia/ui/input/cpp/fidl.h> +#include <gtest/gtest.h> #include <hid-parser/parser.h> #include <hid-parser/usages.h> #include <hid/acer12.h> #include <hid/paradise.h> - -#include <fuchsia/ui/input/cpp/fidl.h> -#include <gtest/gtest.h> #include <src/lib/fxl/time/time_point.h> -#include "garnet/bin/ui/input_reader/stylus.h" - namespace input { namespace { @@ -64,8 +63,8 @@ TEST(StylusTest, Paradise) { auto desc = get_stylus_descriptor(dev_desc); ASSERT_NE(nullptr, desc); - mozart::Stylus stylus = {}; - mozart::Device::Descriptor device_descriptor = {}; + ui_input::Stylus stylus = {}; + ui_input::Device::Descriptor device_descriptor = {}; bool success = stylus.ParseReportDescriptor(*desc, &device_descriptor); ASSERT_TRUE(success); ASSERT_TRUE(device_descriptor.has_stylus); @@ -116,8 +115,8 @@ TEST(StylusTest, Acer12) { auto desc = get_stylus_descriptor(dev_desc); ASSERT_NE(nullptr, desc); - mozart::Stylus stylus = {}; - mozart::Device::Descriptor device_descriptor = {}; + ui_input::Stylus stylus = {}; + ui_input::Device::Descriptor device_descriptor = {}; bool success = stylus.ParseReportDescriptor(*desc, &device_descriptor); ASSERT_TRUE(success); ASSERT_TRUE(device_descriptor.has_stylus); diff --git a/garnet/bin/ui/input_reader/tests/touchpad_test.cc b/garnet/bin/ui/input_reader/tests/touchpad_test.cc index ebd6c2f8e4bcca512cdc5559c3cd775affaef273..656bdb11124c6a69ed5285ad6b4ce86cd907f0be 100644 --- a/garnet/bin/ui/input_reader/tests/touchpad_test.cc +++ b/garnet/bin/ui/input_reader/tests/touchpad_test.cc @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <gtest/gtest.h> #include <hid-parser/parser.h> #include <hid-parser/usages.h> #include <hid/paradise.h> - -#include <gtest/gtest.h> #include <src/lib/fxl/time/time_point.h> #include "garnet/bin/ui/input_reader/touch.h" @@ -15,7 +14,7 @@ namespace input { namespace { -void ParseTouchpad(const uint8_t *desc, size_t desc_len, mozart::Touch *ts) { +void ParseTouchpad(const uint8_t *desc, size_t desc_len, ui_input::Touch *ts) { hid::DeviceDescriptor *dev_desc = nullptr; auto parse_res = hid::ParseReportDescriptor(desc, desc_len, &dev_desc); ASSERT_EQ(hid::ParseResult::kParseOk, parse_res); @@ -46,21 +45,22 @@ void ParseTouchpad(const uint8_t *desc, size_t desc_len, mozart::Touch *ts) { namespace test { TEST(TouchpadTest, ParadiseV1) { - mozart::Touch ts; + ui_input::Touch ts; size_t desc_size; const uint8_t *paradise_touchpad_v1_report_desc = get_paradise_touchpad_v1_report_desc(&desc_size); ParseTouchpad(paradise_touchpad_v1_report_desc, desc_size, &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(5UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::BUTTON | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | mozart::Touch::Capabilities::Y, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::BUTTON | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(1030000, ts_desc.x_max); @@ -82,7 +82,7 @@ TEST(TouchpadTest, ParadiseV1) { uint8_t *report_data = reinterpret_cast<uint8_t *>(&touchpad_v1_report); - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(touchpad_v1_report), &report); EXPECT_EQ(true, success); @@ -101,21 +101,22 @@ TEST(TouchpadTest, ParadiseV1) { } TEST(TouchpadTest, ParadiseV2) { - mozart::Touch ts; + ui_input::Touch ts; size_t desc_size; const uint8_t *paradise_touchpad_v2_report_desc = get_paradise_touchpad_v2_report_desc(&desc_size); ParseTouchpad(paradise_touchpad_v2_report_desc, desc_size, &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(5UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::BUTTON | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | mozart::Touch::Capabilities::Y, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::BUTTON | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(1030000, ts_desc.x_max); @@ -137,7 +138,7 @@ TEST(TouchpadTest, ParadiseV2) { uint8_t *report_data = reinterpret_cast<uint8_t *>(&touchpad_v2_report); - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(touchpad_v2_report), &report); EXPECT_EQ(true, success); diff --git a/garnet/bin/ui/input_reader/tests/touchscreen_test.cc b/garnet/bin/ui/input_reader/tests/touchscreen_test.cc index c1e7cd7aaf4ee3566f2a3e9540cafa961f27b559..e38839f1a2118a1c284ab3950f8fa048a2691afe 100644 --- a/garnet/bin/ui/input_reader/tests/touchscreen_test.cc +++ b/garnet/bin/ui/input_reader/tests/touchscreen_test.cc @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <gtest/gtest.h> #include <hid-parser/parser.h> #include <hid-parser/usages.h> #include <hid/ft3x27.h> #include <hid/paradise.h> - -#include <gtest/gtest.h> #include <src/lib/fxl/time/time_point.h> #include "garnet/bin/ui/input_reader/tests/touchscreen_test_data.h" @@ -17,7 +16,8 @@ namespace input { namespace { -void ParseTouchscreen(const uint8_t *desc, size_t desc_len, mozart::Touch *ts) { +void ParseTouchscreen(const uint8_t *desc, size_t desc_len, + ui_input::Touch *ts) { hid::DeviceDescriptor *dev_desc = nullptr; auto parse_res = hid::ParseReportDescriptor(desc, desc_len, &dev_desc); ASSERT_EQ(hid::ParseResult::kParseOk, parse_res); @@ -48,19 +48,19 @@ void ParseTouchscreen(const uint8_t *desc, size_t desc_len, mozart::Touch *ts) { namespace test { TEST(TouchscreenTest, Gechic1101) { - mozart::Touch ts; + ui_input::Touch ts; ParseTouchscreen(gechic1101_hid_descriptor, sizeof(gechic1101_hid_descriptor), &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(10UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::SCAN_TIME, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::SCAN_TIME, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(2563000, ts_desc.x_max); @@ -84,7 +84,7 @@ TEST(TouchscreenTest, Gechic1101) { 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Constant Value }; - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(report_data), &report); EXPECT_EQ(true, success); @@ -99,20 +99,20 @@ TEST(TouchscreenTest, Gechic1101) { } TEST(TouchscreenTest, CoolTouch) { - mozart::Touch ts; + ui_input::Touch ts; ParseTouchscreen(cooltouch_10x_hid_descriptor, sizeof(cooltouch_10x_hid_descriptor), &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(5UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::SCAN_TIME, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::SCAN_TIME, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(2771000, ts_desc.x_max); @@ -130,7 +130,7 @@ TEST(TouchscreenTest, CoolTouch) { 0x01, // Contact Count }; - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(report_data), &report); EXPECT_EQ(true, success); @@ -145,20 +145,20 @@ TEST(TouchscreenTest, CoolTouch) { } TEST(TouchscreenTest, WaveShare) { - mozart::Touch ts; + ui_input::Touch ts; ParseTouchscreen(waveshare_hid_descriptor, sizeof(waveshare_hid_descriptor), &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(1UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::SCAN_TIME, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::SCAN_TIME, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(655350000, ts_desc.x_max); @@ -176,7 +176,7 @@ TEST(TouchscreenTest, WaveShare) { 0x01, // Contact Count }; - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(report_data), &report); EXPECT_EQ(true, success); @@ -191,20 +191,20 @@ TEST(TouchscreenTest, WaveShare) { } TEST(TouchscreenTest, Gechic1303) { - mozart::Touch ts; + ui_input::Touch ts; ParseTouchscreen(gechic_1303_hid_descriptor, sizeof(gechic_1303_hid_descriptor), &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(10UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::SCAN_TIME, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::SCAN_TIME, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(5090000, ts_desc.x_max); @@ -227,7 +227,7 @@ TEST(TouchscreenTest, Gechic1303) { 0x01, // Contact Count }; - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(report_data), &report); EXPECT_EQ(true, success); @@ -243,22 +243,22 @@ TEST(TouchscreenTest, Gechic1303) { } TEST(TouchscreenTest, ParadiseV1) { - mozart::Touch ts; + ui_input::Touch ts; size_t desc_size; const uint8_t *paradise_touch_v1_report_desc = get_paradise_touch_report_desc(&desc_size); ParseTouchscreen(paradise_touch_v1_report_desc, desc_size, &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(5UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::SCAN_TIME, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::SCAN_TIME, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(2592000, ts_desc.x_max); @@ -277,7 +277,7 @@ TEST(TouchscreenTest, ParadiseV1) { uint8_t *report_data = reinterpret_cast<uint8_t *>(&touch_v1_report); - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(touch_v1_report), &report); EXPECT_EQ(true, success); @@ -290,22 +290,22 @@ TEST(TouchscreenTest, ParadiseV1) { } TEST(TouchscreenTest, ParadiseV2) { - mozart::Touch ts; + ui_input::Touch ts; size_t desc_size; const uint8_t *paradise_touch_v2_report_desc = get_paradise_touch_v2_report_desc(&desc_size); ParseTouchscreen(paradise_touch_v2_report_desc, desc_size, &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(5UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::SCAN_TIME, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::SCAN_TIME, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(2592000, ts_desc.x_max); @@ -324,7 +324,7 @@ TEST(TouchscreenTest, ParadiseV2) { uint8_t *report_data = reinterpret_cast<uint8_t *>(&touch_v2_report); - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(touch_v2_report), &report); EXPECT_EQ(true, success); @@ -337,22 +337,22 @@ TEST(TouchscreenTest, ParadiseV2) { } TEST(TouchscreenTest, ParadiseV3) { - mozart::Touch ts; + ui_input::Touch ts; size_t desc_size; const uint8_t *paradise_touch_v3_report_desc = get_paradise_touch_v3_report_desc(&desc_size); ParseTouchscreen(paradise_touch_v3_report_desc, desc_size, &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(5UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT | - mozart::Touch::Capabilities::SCAN_TIME, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT | + ui_input::Touch::Capabilities::SCAN_TIME, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(2593000, ts_desc.x_max); @@ -372,7 +372,7 @@ TEST(TouchscreenTest, ParadiseV3) { uint8_t *report_data = reinterpret_cast<uint8_t *>(&touch_v3_report); - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(touch_v3_report), &report); EXPECT_EQ(true, success); @@ -385,20 +385,20 @@ TEST(TouchscreenTest, ParadiseV3) { } TEST(TouchscreenTest, Ft3x27) { - mozart::Touch ts; + ui_input::Touch ts; const uint8_t *ft3x27_report_desc; size_t desc_size = get_ft3x27_report_desc(&ft3x27_report_desc); ParseTouchscreen(ft3x27_report_desc, desc_size, &ts); - mozart::Touch::Descriptor ts_desc; + ui_input::Touch::Descriptor ts_desc; EXPECT_TRUE(ts.SetDescriptor(&ts_desc)); EXPECT_EQ(5UL, ts.touch_points()); - EXPECT_EQ(mozart::Touch::Capabilities::CONTACT_ID | - mozart::Touch::Capabilities::TIP_SWITCH | - mozart::Touch::Capabilities::X | - mozart::Touch::Capabilities::Y | - mozart::Touch::Capabilities::CONTACT_COUNT, + EXPECT_EQ(ui_input::Touch::Capabilities::CONTACT_ID | + ui_input::Touch::Capabilities::TIP_SWITCH | + ui_input::Touch::Capabilities::X | + ui_input::Touch::Capabilities::Y | + ui_input::Touch::Capabilities::CONTACT_COUNT, ts.capabilities()); EXPECT_EQ(0, ts_desc.x_min); EXPECT_EQ(600, ts_desc.x_max); @@ -415,7 +415,7 @@ TEST(TouchscreenTest, Ft3x27) { uint8_t *report_data = reinterpret_cast<uint8_t *>(&touch_report); - mozart::Touch::Report report; + ui_input::Touch::Report report; auto success = ts.ParseReport(report_data, sizeof(touch_report), &report); EXPECT_EQ(true, success); diff --git a/garnet/bin/ui/input_reader/touch.cc b/garnet/bin/ui/input_reader/touch.cc index 48246e49ef01588fde234c6ae956e09dd127324a..882cedaeeb08d77124ac882221cf52dd0adce3ed 100644 --- a/garnet/bin/ui/input_reader/touch.cc +++ b/garnet/bin/ui/input_reader/touch.cc @@ -8,14 +8,14 @@ #include <hid-parser/report.h> #include <hid-parser/units.h> #include <hid-parser/usages.h> - #include <stdint.h> #include <stdio.h> + #include <vector> #include "src/lib/fxl/logging.h" -namespace mozart { +namespace ui_input { bool Touch::ParseTouchDescriptor(const hid::ReportDescriptor &desc) { size_t touch_points = 0; TouchPointConfig configs[MAX_TOUCH_POINTS] = {}; @@ -70,9 +70,9 @@ bool Touch::ParseTouchDescriptor(const hid::ReportDescriptor &desc) { } if (touch_points > MAX_TOUCH_POINTS) { FXL_LOG(INFO) << "Touch descriptor: Current touchscreen has " - << touch_points - << " touch points which is above hardcoded limit of " - << MAX_TOUCH_POINTS; + << touch_points + << " touch points which is above hardcoded limit of " + << MAX_TOUCH_POINTS; return false; } TouchPointConfig *config = &configs[touch_points - 1]; @@ -114,7 +114,7 @@ bool Touch::ParseTouchDescriptor(const hid::ReportDescriptor &desc) { << "Touch descriptor: Touch point capabilities are different"; for (size_t j = 0; j < touch_points; j++) { FXL_LOG(INFO) << "Touch descriptor: touch_point[" << j - << "] = " << configs[i].capabilities; + << "] = " << configs[i].capabilities; } return false; } @@ -141,7 +141,7 @@ bool Touch::ParseReport(const uint8_t *data, size_t len, Report *report) const { if (len != report_size_) { FXL_LOG(INFO) << "Touch HID Report is not correct size, (" << len - << " != " << report_size_ << ")"; + << " != " << report_size_ << ")"; return false; } @@ -285,4 +285,4 @@ bool Touch::SetDescriptor(Touch::Descriptor *touch_desc) { return true; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/touch.h b/garnet/bin/ui/input_reader/touch.h index dc8c73d9285137cfd7107f62414ee7c87bff0752..932999d9cbf03486635cc27ccbc354ee3222cd00 100644 --- a/garnet/bin/ui/input_reader/touch.h +++ b/garnet/bin/ui/input_reader/touch.h @@ -5,11 +5,11 @@ #ifndef GARNET_BIN_UI_INPUT_READER_TOUCH_H_ #define GARNET_BIN_UI_INPUT_READER_TOUCH_H_ -#include <cstddef> - #include <hid-parser/parser.h> -namespace mozart { +#include <cstddef> + +namespace ui_input { // This reprents a HID device that uses touch. It is a helper class that both // touchscreens and touchpads rely on. @@ -100,6 +100,6 @@ class Touch { uint8_t report_id_; int32_t contact_id_max_; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_TOUCH_H_ diff --git a/garnet/bin/ui/input_reader/touchpad.cc b/garnet/bin/ui/input_reader/touchpad.cc index 44684a288bce8b8627693ec7f1fdc87e75ee91e1..f5bbe1e1c0042f79877349fd81bbc91385ca65a5 100644 --- a/garnet/bin/ui/input_reader/touchpad.cc +++ b/garnet/bin/ui/input_reader/touchpad.cc @@ -8,14 +8,14 @@ #include <hid-parser/report.h> #include <hid-parser/units.h> #include <hid-parser/usages.h> - #include <stdint.h> #include <stdio.h> + #include <vector> #include "src/lib/fxl/logging.h" -namespace mozart { +namespace ui_input { bool Touchpad::ParseReportDescriptor( const hid::ReportDescriptor& report_descriptor, @@ -119,4 +119,4 @@ bool Touchpad::ParseReport(const uint8_t* data, size_t len, return ParseTouchpadReport(touchscreen, report); } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/touchpad.h b/garnet/bin/ui/input_reader/touchpad.h index 5c7f80a1d90b79b0222e9939c4c577b3d3006091..d5733795447c71aed8df042ea691b63542f77f3d 100644 --- a/garnet/bin/ui/input_reader/touchpad.h +++ b/garnet/bin/ui/input_reader/touchpad.h @@ -5,14 +5,14 @@ #ifndef GARNET_BIN_UI_INPUT_READER_TOUCHPAD_H_ #define GARNET_BIN_UI_INPUT_READER_TOUCHPAD_H_ -#include "garnet/bin/ui/input_reader/device.h" -#include "garnet/bin/ui/input_reader/touch.h" +#include <hid-parser/parser.h> #include <cstddef> -#include <hid-parser/parser.h> +#include "garnet/bin/ui/input_reader/device.h" +#include "garnet/bin/ui/input_reader/touch.h" -namespace mozart { +namespace ui_input { // This represents a HID touchpad device. It currently converts Touch // information into a Mouse InputReport. @@ -47,6 +47,6 @@ class Touchpad : public Device { int32_t mouse_abs_x_ = -1; int32_t mouse_abs_y_ = -1; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_TOUCHPAD_H_ diff --git a/garnet/bin/ui/input_reader/touchscreen.cc b/garnet/bin/ui/input_reader/touchscreen.cc index 0258887756e3767b018727723a495b13f27af582..6f3772cb8c943c9395dfe24516c7675b7ccc4319 100644 --- a/garnet/bin/ui/input_reader/touchscreen.cc +++ b/garnet/bin/ui/input_reader/touchscreen.cc @@ -8,14 +8,14 @@ #include <hid-parser/report.h> #include <hid-parser/units.h> #include <hid-parser/usages.h> - #include <stdint.h> #include <stdio.h> + #include <vector> #include "src/lib/fxl/logging.h" -namespace mozart { +namespace ui_input { bool TouchScreen::ParseReportDescriptor( const hid::ReportDescriptor& report_descriptor, @@ -72,4 +72,4 @@ bool TouchScreen::ParseReport(const uint8_t* data, size_t len, return true; } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/bin/ui/input_reader/touchscreen.h b/garnet/bin/ui/input_reader/touchscreen.h index c6573a8247123e426c1e6fb68f837a171ecdba9b..43e9cc6170ab3961c27223bc9a9bb14ce01b65e0 100644 --- a/garnet/bin/ui/input_reader/touchscreen.h +++ b/garnet/bin/ui/input_reader/touchscreen.h @@ -5,14 +5,14 @@ #ifndef GARNET_BIN_UI_INPUT_READER_TOUCHSCREEN_H_ #define GARNET_BIN_UI_INPUT_READER_TOUCHSCREEN_H_ -#include "garnet/bin/ui/input_reader/device.h" -#include "garnet/bin/ui/input_reader/touch.h" +#include <hid-parser/parser.h> #include <cstddef> -#include <hid-parser/parser.h> +#include "garnet/bin/ui/input_reader/device.h" +#include "garnet/bin/ui/input_reader/touch.h" -namespace mozart { +namespace ui_input { class TouchScreen : public Device { public: // |Device| @@ -27,6 +27,6 @@ class TouchScreen : public Device { private: Touch touch_ = {}; }; -} // namespace mozart +} // namespace ui_input #endif // GARNET_BIN_UI_INPUT_READER_TOUCHSCREEN_H_ diff --git a/garnet/bin/ui/print_input/main.cc b/garnet/bin/ui/print_input/main.cc index b81ab6e469a33697814e2fe1e880131b01d30e1d..182cd7eb343975dc151774994b7fba9f00fffdfb 100644 --- a/garnet/bin/ui/print_input/main.cc +++ b/garnet/bin/ui/print_input/main.cc @@ -2,28 +2,28 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <fuchsia/ui/input/cpp/fidl.h> #include <lib/async-loop/cpp/loop.h> -#include <fuchsia/ui/input/cpp/fidl.h> #include "garnet/bin/ui/input_reader/input_reader.h" +#include "lib/ui/input/cpp/formatting.h" +#include "lib/ui/input/device_state.h" +#include "lib/ui/input/input_device_impl.h" #include "src/lib/fxl/command_line.h" #include "src/lib/fxl/log_settings_command_line.h" #include "src/lib/fxl/logging.h" #include "src/lib/fxl/macros.h" #include "src/lib/fxl/strings/string_printf.h" -#include "lib/ui/input/cpp/formatting.h" -#include "lib/ui/input/device_state.h" -#include "lib/ui/input/input_device_impl.h" namespace print_input { class App : public fuchsia::ui::input::InputDeviceRegistry, - public mozart::InputDeviceImpl::Listener { + public ui_input::InputDeviceImpl::Listener { public: App() : reader_(this, true) { reader_.Start(); } ~App() {} - void OnDeviceDisconnected(mozart::InputDeviceImpl* input_device) { + void OnDeviceDisconnected(ui_input::InputDeviceImpl* input_device) { FXL_VLOG(1) << "UnregisterDevice " << input_device->id(); if (devices_.count(input_device->id()) != 0) { @@ -32,7 +32,7 @@ class App : public fuchsia::ui::input::InputDeviceRegistry, } } - void OnReport(mozart::InputDeviceImpl* input_device, + void OnReport(ui_input::InputDeviceImpl* input_device, fuchsia::ui::input::InputReport report) { FXL_VLOG(2) << "DispatchReport " << input_device->id() << " " << report; if (devices_.count(input_device->id()) == 0) { @@ -44,7 +44,7 @@ class App : public fuchsia::ui::input::InputDeviceRegistry, size.width = 100.0; size.height = 100.0; - mozart::DeviceState* state = devices_[input_device->id()].second.get(); + ui_input::DeviceState* state = devices_[input_device->id()].second.get(); FXL_CHECK(state); state->Update(std::move(report), size); @@ -60,19 +60,19 @@ class App : public fuchsia::ui::input::InputDeviceRegistry, FXL_CHECK(devices_.count(device_id) == 0); - std::unique_ptr<mozart::InputDeviceImpl> input_device = - std::make_unique<mozart::InputDeviceImpl>( + std::unique_ptr<ui_input::InputDeviceImpl> input_device = + std::make_unique<ui_input::InputDeviceImpl>( device_id, std::move(descriptor), std::move(input_device_request), this); - std::unique_ptr<mozart::DeviceState> state = - std::make_unique<mozart::DeviceState>( + std::unique_ptr<ui_input::DeviceState> state = + std::make_unique<ui_input::DeviceState>( input_device->id(), input_device->descriptor(), - mozart::OnEventCallback( + ui_input::OnEventCallback( [this](fuchsia::ui::input::InputEvent event) { OnEvent(std::move(event)); })); - mozart::DeviceState* state_ptr = state.get(); + ui_input::DeviceState* state_ptr = state.get(); auto device_pair = std::make_pair(std::move(input_device), std::move(state)); devices_.emplace(device_id, std::move(device_pair)); @@ -82,10 +82,10 @@ class App : public fuchsia::ui::input::InputDeviceRegistry, void OnEvent(fuchsia::ui::input::InputEvent event) { FXL_LOG(INFO) << event; } uint32_t next_device_token_ = 0; - mozart::InputReader reader_; + ui_input::InputReader reader_; std::unordered_map<uint32_t, - std::pair<std::unique_ptr<mozart::InputDeviceImpl>, - std::unique_ptr<mozart::DeviceState>>> + std::pair<std::unique_ptr<ui_input::InputDeviceImpl>, + std::unique_ptr<ui_input::DeviceState>>> devices_; FXL_DISALLOW_COPY_AND_ASSIGN(App); diff --git a/garnet/bin/ui/root_presenter/README.md b/garnet/bin/ui/root_presenter/README.md index 84f6c2a13eebb09e10e4aac1878e672e8c091ba6..2a53eff36b64e95fd26f0de247cf081d43391360 100644 --- a/garnet/bin/ui/root_presenter/README.md +++ b/garnet/bin/ui/root_presenter/README.md @@ -1,4 +1,4 @@ -# Mozart Root Presenter +# Root Presenter This directory contains the Root Presenter, a service which binds view trees to a renderer and provides input. diff --git a/garnet/bin/ui/root_presenter/app.cc b/garnet/bin/ui/root_presenter/app.cc index b3c6d7ad9c2e264fbe0839dbeb6f4b86f328f603..c1f73a2255309060a97fce5256beb0ae38cb7725 100644 --- a/garnet/bin/ui/root_presenter/app.cc +++ b/garnet/bin/ui/root_presenter/app.cc @@ -7,10 +7,11 @@ #include <fuchsia/ui/input/cpp/fidl.h> #include <lib/component/cpp/connect.h> #include <lib/fidl/cpp/clone.h> -#include <src/lib/fxl/logging.h> #include <lib/ui/input/cpp/formatting.h> #include <lib/ui/scenic/cpp/view_token_pair.h> +#include <src/lib/fxl/logging.h> #include <trace/event.h> + #include <algorithm> #include <cstdlib> #include <string> @@ -157,8 +158,8 @@ void App::RegisterDevice(fuchsia::ui::input::DeviceDescriptor descriptor, uint32_t device_id = ++next_device_token_; FXL_VLOG(1) << "RegisterDevice " << device_id << " " << descriptor; - std::unique_ptr<mozart::InputDeviceImpl> input_device = - std::make_unique<mozart::InputDeviceImpl>( + std::unique_ptr<ui_input::InputDeviceImpl> input_device = + std::make_unique<ui_input::InputDeviceImpl>( device_id, std::move(descriptor), std::move(input_device_request), this); @@ -169,7 +170,7 @@ void App::RegisterDevice(fuchsia::ui::input::DeviceDescriptor descriptor, devices_by_id_.emplace(device_id, std::move(input_device)); } -void App::OnDeviceDisconnected(mozart::InputDeviceImpl* input_device) { +void App::OnDeviceDisconnected(ui_input::InputDeviceImpl* input_device) { if (devices_by_id_.count(input_device->id()) == 0) return; @@ -181,7 +182,7 @@ void App::OnDeviceDisconnected(mozart::InputDeviceImpl* input_device) { devices_by_id_.erase(input_device->id()); } -void App::OnReport(mozart::InputDeviceImpl* input_device, +void App::OnReport(ui_input::InputDeviceImpl* input_device, fuchsia::ui::input::InputReport report) { TRACE_DURATION("input", "root_presenter_on_report", "id", report.trace_id); TRACE_FLOW_END("input", "report_to_presenter", report.trace_id); diff --git a/garnet/bin/ui/root_presenter/app.h b/garnet/bin/ui/root_presenter/app.h index 06e52c596201ccd6e3268b9866712741cd07f76f..3ac6355eb5147fe4c5fc29030c53a0a0998daa14 100644 --- a/garnet/bin/ui/root_presenter/app.h +++ b/garnet/bin/ui/root_presenter/app.h @@ -11,11 +11,12 @@ #include <fuchsia/ui/views/cpp/fidl.h> #include <lib/component/cpp/startup_context.h> #include <lib/fidl/cpp/binding_set.h> -#include <src/lib/fxl/command_line.h> -#include <src/lib/fxl/macros.h> #include <lib/ui/input/input_device_impl.h> #include <lib/ui/scenic/cpp/resources.h> #include <lib/zx/eventpair.h> +#include <src/lib/fxl/command_line.h> +#include <src/lib/fxl/macros.h> + #include <limits> #include <memory> #include <vector> @@ -33,14 +34,14 @@ namespace root_presenter { // and input routing is not fully supported (TODO). class App : public fuchsia::ui::policy::Presenter, public fuchsia::ui::input::InputDeviceRegistry, - public mozart::InputDeviceImpl::Listener { + public ui_input::InputDeviceImpl::Listener { public: explicit App(const fxl::CommandLine& command_line); ~App(); // |InputDeviceImpl::Listener| - void OnDeviceDisconnected(mozart::InputDeviceImpl* input_device) override; - void OnReport(mozart::InputDeviceImpl* input_device, + void OnDeviceDisconnected(ui_input::InputDeviceImpl* input_device) override; + void OnReport(ui_input::InputDeviceImpl* input_device, fuchsia::ui::input::InputReport report) override; private: @@ -74,7 +75,7 @@ class App : public fuchsia::ui::policy::Presenter, fidl::BindingSet<fuchsia::ui::policy::Presenter> presenter_bindings_; fidl::BindingSet<fuchsia::ui::input::InputDeviceRegistry> input_receiver_bindings_; - mozart::InputReader input_reader_; + ui_input::InputReader input_reader_; fuchsia::ui::scenic::ScenicPtr scenic_; std::unique_ptr<scenic::Session> session_; @@ -97,7 +98,7 @@ class App : public fuchsia::ui::policy::Presenter, size_t active_presentation_idx_ = std::numeric_limits<size_t>::max(); uint32_t next_device_token_ = 0; - std::unordered_map<uint32_t, std::unique_ptr<mozart::InputDeviceImpl>> + std::unordered_map<uint32_t, std::unique_ptr<ui_input::InputDeviceImpl>> devices_by_id_; FXL_DISALLOW_COPY_AND_ASSIGN(App); diff --git a/garnet/bin/ui/root_presenter/displays/display_configuration.cc b/garnet/bin/ui/root_presenter/displays/display_configuration.cc index 94480d1e7131c6c424a1294309307d02da63d789..d9e9b5c2c80007fd0be38dc72574e17bc7b4c17b 100644 --- a/garnet/bin/ui/root_presenter/displays/display_configuration.cc +++ b/garnet/bin/ui/root_presenter/displays/display_configuration.cc @@ -4,8 +4,8 @@ #include "garnet/bin/ui/root_presenter/displays/display_configuration.h" -#include "src/lib/fxl/logging.h" #include "src/lib/files/file.h" +#include "src/lib/fxl/logging.h" namespace root_presenter { namespace display_configuration { @@ -56,31 +56,31 @@ float LookupPixelDensityForDisplay(uint32_t width_in_px, } } - // TODO(MZ-16): Need to have a database of devices and a more robust way + // TODO(SCN-16): Need to have a database of devices and a more robust way // of identifying and classifying them. if (width_in_px == 2160 && height_in_px == 1440) { // Assume that the device is an Acer Switch 12 Alpha. FXL_LOG(INFO) - << "SceneManager: treating device as an Acer Switch 12 Alpha."; + << "RootPresenter: treating device as an Acer Switch 12 Alpha."; return 8.5f; } else if (width_in_px == 2400 && height_in_px == 1600) { // Assume that the device is a Google Pixelbook. - FXL_LOG(INFO) << "SceneManager: treating device as a Google Pixelbook."; + FXL_LOG(INFO) << "RootPresenter: treating device as a Google Pixelbook."; return 9.252f; } else if (width_in_px == 3840 && height_in_px == 2160) { // Assume the display is a 24in 4K monitor. - FXL_LOG(INFO) << "SceneManager: treating display as a 24in 4K monitor."; + FXL_LOG(INFO) << "RootPresenter: treating display as a 24in 4K monitor."; return 7.323761f; } else { - // TODO(MZ-384): Don't lie. - FXL_LOG(WARNING) << "SceneManager: unrecognized display."; + // TODO(SCN-384): Don't lie. + FXL_LOG(WARNING) << "RootPresenter: unrecognized display."; return 9.f; } } fuchsia::ui::policy::DisplayUsage LookupDisplayUsageForDisplay( uint32_t width_in_px, uint32_t height_in_px) { - // TODO(MZ-16): Need to have a database of devices and a more robust way + // TODO(SCN-16): Need to have a database of devices and a more robust way // of identifying and classifying them. { std::string display_usage; @@ -113,13 +113,13 @@ fuchsia::ui::policy::DisplayUsage LookupDisplayUsageForDisplay( // Assume the display is a 24in 4K monitor. return fuchsia::ui::policy::DisplayUsage::kNear; } else { - // TODO(MZ-384): Don't lie. + // TODO(SCN-384): Don't lie. return fuchsia::ui::policy::DisplayUsage::kClose; } } void LogDisplayMetrics(const DisplayMetrics& metrics) { - FXL_DLOG(INFO) << "SceneManager: Display metrics: " + FXL_DLOG(INFO) << "RootPresenter: Display metrics: " << "width_in_px=" << metrics.width_in_px() << ", height_in_px=" << metrics.height_in_px() << ", width_in_pp=" << metrics.width_in_pp() diff --git a/garnet/bin/ui/root_presenter/displays/display_configuration.h b/garnet/bin/ui/root_presenter/displays/display_configuration.h index 551314428eade3735f8305a9bb8d5955538c88a1..8e2eaee0e027ad3b1183b1c507ea603d8835b64d 100644 --- a/garnet/bin/ui/root_presenter/displays/display_configuration.h +++ b/garnet/bin/ui/root_presenter/displays/display_configuration.h @@ -17,7 +17,7 @@ namespace display_configuration { // |height_in_px| the height of the display in pixels. // |model| the model object to initialize, must not be null. // -// TODO(MZ-16): This is a placeholder for more sophisticated configuration +// TODO(SCN-16): This is a placeholder for more sophisticated configuration // mechanisms we'll need in the future. void InitializeModelForDisplay(uint32_t width_in_px, uint32_t height_in_px, DisplayModel* model); diff --git a/garnet/bin/ui/root_presenter/perspective_demo_mode.cc b/garnet/bin/ui/root_presenter/perspective_demo_mode.cc index 772645dedc8002a6149f74007a6d61b2c320bba7..be90f6a8e86e6d5af2b58130055af8c6628c2fa9 100644 --- a/garnet/bin/ui/root_presenter/perspective_demo_mode.cc +++ b/garnet/bin/ui/root_presenter/perspective_demo_mode.cc @@ -3,9 +3,11 @@ // found in the LICENSE file. #include "garnet/bin/ui/root_presenter/perspective_demo_mode.h" -#include <array> -#include "garnet/lib/ui/util/glm_workaround.h" +#include "garnet/lib/ui/util/glm_workaround.h" // Must come first! + #include <glm/ext.hpp> +#include <array> + #include "garnet/bin/ui/root_presenter/presentation.h" namespace root_presenter { @@ -111,7 +113,7 @@ float PerspectiveDemoMode::ComputeHalfFov(Presentation* presenter, // half angle camera, at the appropriate distance. constexpr float kMinHalfFov = .1f * kPi / 180.f; - // TODO(MZ-194): The maximum half fov is determined by the minimum camera + // TODO(SCN-194): The maximum half fov is determined by the minimum camera // distance. This distance matches the hard coded behavior from // escher::Camera::NewOrtho() and scenic::gfx::Layer::GetViewingVolume(). For // a 1600px height display, this works out to ~76 degrees. diff --git a/garnet/bin/ui/root_presenter/presentation.cc b/garnet/bin/ui/root_presenter/presentation.cc index 591d4c0ef50e5bd292a3d1c7797bf1e6176d95d3..cfc89ea848f935cdd9a223af04bf89aef5d2df8f 100644 --- a/garnet/bin/ui/root_presenter/presentation.cc +++ b/garnet/bin/ui/root_presenter/presentation.cc @@ -4,14 +4,14 @@ #include "garnet/bin/ui/root_presenter/presentation.h" -#include <cmath> -#include <utility> - #include <lib/component/cpp/connect.h> #include <lib/ui/input/cpp/formatting.h> #include <src/lib/fxl/logging.h> #include <trace/event.h> +#include <cmath> +#include <utility> + #include "garnet/bin/ui/root_presenter/displays/display_configuration.h" using fuchsia::ui::policy::MediaButtonsListenerPtr; @@ -413,36 +413,36 @@ bool Presentation::ApplyDisplayModelChangesHelper(bool print_log) { return true; } -void Presentation::OnDeviceAdded(mozart::InputDeviceImpl* input_device) { +void Presentation::OnDeviceAdded(ui_input::InputDeviceImpl* input_device) { FXL_VLOG(1) << "OnDeviceAdded: device_id=" << input_device->id(); FXL_DCHECK(device_states_by_id_.count(input_device->id()) == 0); - std::unique_ptr<mozart::DeviceState> state; + std::unique_ptr<ui_input::DeviceState> state; if (input_device->descriptor()->sensor) { - mozart::OnSensorEventCallback callback = + ui_input::OnSensorEventCallback callback = [this](uint32_t device_id, fuchsia::ui::input::InputReport event) { OnSensorEvent(device_id, std::move(event)); }; - state = std::make_unique<mozart::DeviceState>( + state = std::make_unique<ui_input::DeviceState>( input_device->id(), input_device->descriptor(), std::move(callback)); } else if (input_device->descriptor()->media_buttons) { - mozart::OnMediaButtonsEventCallback callback = + ui_input::OnMediaButtonsEventCallback callback = [this](fuchsia::ui::input::InputReport report) { OnMediaButtonsEvent(std::move(report)); }; - state = std::make_unique<mozart::DeviceState>( + state = std::make_unique<ui_input::DeviceState>( input_device->id(), input_device->descriptor(), std::move(callback)); } else { - mozart::OnEventCallback callback = + ui_input::OnEventCallback callback = [this](fuchsia::ui::input::InputEvent event) { OnEvent(std::move(event)); }; - state = std::make_unique<mozart::DeviceState>( + state = std::make_unique<ui_input::DeviceState>( input_device->id(), input_device->descriptor(), std::move(callback)); } - mozart::DeviceState* state_ptr = state.get(); + ui_input::DeviceState* state_ptr = state.get(); auto device_pair = std::make_pair(input_device, std::move(state)); state_ptr->OnRegistered(); device_states_by_id_.emplace(input_device->id(), std::move(device_pair)); @@ -480,7 +480,7 @@ void Presentation::OnReport(uint32_t device_id, if (!display_model_initialized_) return; - mozart::DeviceState* state = device_states_by_id_[device_id].second.get(); + ui_input::DeviceState* state = device_states_by_id_[device_id].second.get(); fuchsia::math::Size size; size.width = display_model_actual_.display_info().width_in_px; size.height = display_model_actual_.display_info().height_in_px; diff --git a/garnet/bin/ui/root_presenter/presentation.h b/garnet/bin/ui/root_presenter/presentation.h index fa036b68c48b625bb8e1a0a9c960c9f0d77af952..31a33ee9df3f28773096b37e7fa7cae669127f38 100644 --- a/garnet/bin/ui/root_presenter/presentation.h +++ b/garnet/bin/ui/root_presenter/presentation.h @@ -64,7 +64,7 @@ class Presentation : protected fuchsia::ui::policy::Presentation { ~Presentation(); void OnReport(uint32_t device_id, fuchsia::ui::input::InputReport report); - void OnDeviceAdded(mozart::InputDeviceImpl* input_device); + void OnDeviceAdded(ui_input::InputDeviceImpl* input_device); void OnDeviceRemoved(uint32_t device_id); // Used internally by Presenter. Allows overriding of renderer params. @@ -221,8 +221,8 @@ class Presentation : protected fuchsia::ui::policy::Presentation { }; std::map<uint32_t, CursorState> cursors_; - std::map<uint32_t, std::pair<mozart::InputDeviceImpl*, - std::unique_ptr<mozart::DeviceState>>> + std::map<uint32_t, std::pair<ui_input::InputDeviceImpl*, + std::unique_ptr<ui_input::DeviceState>>> device_states_by_id_; // A registry of listeners who want to be notified when their keyboard diff --git a/garnet/bin/ui/sketchy/app.cc b/garnet/bin/ui/sketchy/app.cc index dbd5ccf3ee9f129ae73fa7604e439360f9b8e678..41c0221f4b4c4d160eb534e33ee42def31aad4e7 100644 --- a/garnet/bin/ui/sketchy/app.cc +++ b/garnet/bin/ui/sketchy/app.cc @@ -21,7 +21,7 @@ App::App(async::Loop* loop, escher::EscherWeakPtr weak_escher) loop_->Quit(); }); scenic_.set_error_handler([this](zx_status_t status) { - FXL_LOG(INFO) << "Sketchy service lost connection to Mozart."; + FXL_LOG(INFO) << "Sketchy service lost connection to Scenic."; loop_->Quit(); }); } diff --git a/garnet/bin/ui/sketchy/buffer/shared_buffer_pool.h b/garnet/bin/ui/sketchy/buffer/shared_buffer_pool.h index 27b4de3179befc70af0c7f2afaae59e2b1c7e276..2889512454706ba29bcd187966b9dc314df6b421 100644 --- a/garnet/bin/ui/sketchy/buffer/shared_buffer_pool.h +++ b/garnet/bin/ui/sketchy/buffer/shared_buffer_pool.h @@ -10,8 +10,8 @@ #include "garnet/bin/ui/sketchy/buffer/shared_buffer.h" #include "lib/escher/flib/fence_listener.h" #include "lib/escher/vk/buffer_factory.h" -#include "src/lib/fxl/memory/weak_ptr.h" #include "lib/ui/scenic/cpp/session.h" +#include "src/lib/fxl/memory/weak_ptr.h" namespace sketchy_service { @@ -29,7 +29,7 @@ class SharedBufferPool final { // to |free_buffers_|. void ReturnBuffer(SharedBufferPtr buffer, zx::event release_fence); - // TODO(MZ-269): Implement CleanUp() to free up free_buffers_ a bit. It will + // TODO(SCN-269): Implement CleanUp() to free up free_buffers_ a bit. It will // be useful when we support removing strokes. private: diff --git a/garnet/bin/ui/sketchy/canvas.cc b/garnet/bin/ui/sketchy/canvas.cc index f37f3ff465c9d1919534784f6289a85af89c1b7a..3c48f5881287efdbc9182cdbabc185d0c6ef8fe0 100644 --- a/garnet/bin/ui/sketchy/canvas.cc +++ b/garnet/bin/ui/sketchy/canvas.cc @@ -25,7 +25,7 @@ CanvasImpl::CanvasImpl(async::Loop* loop, scenic::Session* session, void CanvasImpl::Init( fidl::InterfaceHandle<::fuchsia::ui::sketchy::CanvasListener> listener) { - // TODO(MZ-269): unimplemented. + // TODO(SCN-269): unimplemented. FXL_LOG(ERROR) << "Init: unimplemented."; } @@ -41,13 +41,14 @@ void CanvasImpl::Present(uint64_t presentation_time, PresentCallback callback) { TRACE_DURATION("gfx", "CanvasImpl::Present"); TRACE_FLOW_END("gfx", "PresentCanvas", canvas_present_count_); ++canvas_present_count_; - TRACE_FLOW_BEGIN("gfx", "RequestScenicPresent", request_scenic_present_count_); + TRACE_FLOW_BEGIN("gfx", "RequestScenicPresent", + request_scenic_present_count_); - // TODO(MZ-269): Present() should behave the same way as Scenic. Specifically, - // Commands shouldn't be applied immediately. Instead a frame-request should - // be triggered and the Commands enqueue; when the corresponding frame is - // processed all Commands that are scheduled for the current frame's - // presentation time are applied. + // TODO(SCN-269): Present() should behave the same way as Scenic. + // Specifically, Commands shouldn't be applied immediately. Instead a + // frame-request should be triggered and the Commands enqueue; when the + // corresponding frame is processed all Commands that are scheduled for the + // current frame's presentation time are applied. for (auto it = commands_->begin(); it != commands_->end(); ++it) { if (!ApplyCommand(std::move(*it))) { loop_->Quit(); diff --git a/garnet/bin/ui/sketchy/canvas.h b/garnet/bin/ui/sketchy/canvas.h index 111849e7dc253ade504a6e0966974f3f7e48e0f6..8272ad95202f216384d534ebf2439a6f5570b334 100644 --- a/garnet/bin/ui/sketchy/canvas.h +++ b/garnet/bin/ui/sketchy/canvas.h @@ -5,11 +5,11 @@ #ifndef GARNET_BIN_UI_SKETCHY_CANVAS_H_ #define GARNET_BIN_UI_SKETCHY_CANVAS_H_ -#include <unordered_map> - #include <fuchsia/ui/sketchy/cpp/fidl.h> #include <lib/async-loop/cpp/loop.h> +#include <unordered_map> + #include "garnet/bin/ui/sketchy/buffer/shared_buffer_pool.h" #include "garnet/bin/ui/sketchy/resources/resource_map.h" #include "garnet/bin/ui/sketchy/resources/stroke_group.h" @@ -64,7 +64,7 @@ class CanvasImpl final : public ::fuchsia::ui::sketchy::Canvas { // |id| ID that can be used by the Canvas client to refer to // the imported node. // |token| Token that the Sketchy service will pass along - // to the SceneManager to import the node. + // to Scenic to import the node. bool ScenicImportNode(ResourceId id, zx::eventpair token); bool ApplyScenicAddChildCmd(fuchsia::ui::gfx::AddChildCmd add_child); diff --git a/garnet/bin/ui/sketchy/stroke/stroke_manager.h b/garnet/bin/ui/sketchy/stroke/stroke_manager.h index 9c25fafc2fe7a7b4a15044f3db66f6bca50fc942..4c60e20f5c886c6c91d36f9d0a0f861460d56700 100644 --- a/garnet/bin/ui/sketchy/stroke/stroke_manager.h +++ b/garnet/bin/ui/sketchy/stroke/stroke_manager.h @@ -27,7 +27,7 @@ class StrokeManager { // efficient rendering, client should keep the growing stroke in a temporary // group, and move them to a stable group once done. bool BeginStroke(StrokePtr stroke, glm::vec2 pt); - // TODO(MZ-269): Also pass in predicted points. + // TODO(SCN-269): Also pass in predicted points. bool ExtendStroke(StrokePtr stroke, std::vector<glm::vec2> sampled_pts); bool FinishStroke(StrokePtr stroke); @@ -40,7 +40,7 @@ class StrokeManager { private: std::map<StrokePtr, StrokeGroupPtr> stroke_to_group_map_; std::set<StrokeGroupPtr> dirty_stroke_groups_; - // TODO(MZ-269): Only have a tessellator per app. + // TODO(SCN-269): Only have a tessellator per app. StrokeTessellator stroke_tessellator_; }; diff --git a/garnet/docs/ui/README.md b/garnet/docs/ui/README.md index 34928e59d8e9c7de9bd1d3890871c454e0b31850..91ff03a87a24199731cabfd330851ca195ff209e 100644 --- a/garnet/docs/ui/README.md +++ b/garnet/docs/ui/README.md @@ -2,18 +2,12 @@ Fuchsia's Garnet layer does not provide a full-fledged end-user UI. Instead, it provides services that provide a foundation upon which to build secure, performant, multi-process UIs. -Collectively, these services are known as "Mozart". - These services include: ## Scenic, the Fuchsia graphics engine Scenic ([doc](scenic.md)) provides a retained-mode scene graph that allows graphical objects from multiple processes to be composed and rendered within a unified lighting environment. -## View Manager - -The view manager supports hierarchical embedding of client modules, and is responsible for propagating layout information, dispatching input events, and maintaining a model of the user's focus. - ## Input The input subsystem ([doc](input.md)) is responsible for discovering the available input devices, and allowing clients to register for events from these devices. diff --git a/garnet/docs/ui/units_and_metrics.md b/garnet/docs/ui/units_and_metrics.md index dc4bc430dd2ada8e1de52eae07fde3429d47bb73..8526296d6a964a5b496173c5d08a0742f493802a 100644 --- a/garnet/docs/ui/units_and_metrics.md +++ b/garnet/docs/ui/units_and_metrics.md @@ -293,7 +293,7 @@ an updated metrics event containing values which are scaled up by 200%. This informs the node that it may need to allocate higher resolution textures to maintain optimum fidelity. -TODO(MZ-378): Node metrics currently do not take into account the effects +TODO(SCN-378): Node metrics currently do not take into account the effects of certain transformations such as perspective projections and rotations which could affect the necessary level of detail required to maintain optimum fidelity or the accuracy of physical registration. We should consider @@ -320,7 +320,7 @@ missing information during setup to optimize fidelity. Refer to the **DisplayModel** class for more details. -TODO(MZ-379): Document specific calibration procedures and expected accuracy +TODO(SCN-379): Document specific calibration procedures and expected accuracy bounds for each model parameter. ### Display Information diff --git a/garnet/examples/escher/common/demo_harness_fuchsia.h b/garnet/examples/escher/common/demo_harness_fuchsia.h index adac500112c6aee700bebf78f518536db4145eaf..b5f50d18b6fd75cd57791f4f9a43cb95aeb43963 100644 --- a/garnet/examples/escher/common/demo_harness_fuchsia.h +++ b/garnet/examples/escher/common/demo_harness_fuchsia.h @@ -59,7 +59,7 @@ class DemoHarnessFuchsia : public DemoHarness, trace::TraceProvider trace_provider_; std::unique_ptr<sys::ComponentContext> component_context_; - mozart::InputReader input_reader_; + ui_input::InputReader input_reader_; fidl::BindingSet<fuchsia::ui::input::InputDevice, std::unique_ptr<fuchsia::ui::input::InputDevice>> input_devices_; diff --git a/garnet/examples/ui/lab/direct_input/app.cc b/garnet/examples/ui/lab/direct_input/app.cc index 5941794375c80c5abf2a99fdebb0256859ff4d8b..976091fcc16722a6f52e81b561422ce90dbbcde8 100644 --- a/garnet/examples/ui/lab/direct_input/app.cc +++ b/garnet/examples/ui/lab/direct_input/app.cc @@ -4,10 +4,6 @@ #include "garnet/examples/ui/lab/direct_input/app.h" -#include <limits> -#include <string> -#include <utility> - #include <fuchsia/math/cpp/fidl.h> #include <lib/fdio/fd.h> #include <lib/fit/function.h> @@ -18,6 +14,10 @@ #include <lib/zx/time.h> #include <zircon/processargs.h> +#include <limits> +#include <string> +#include <utility> + namespace direct_input { const uint32_t kNoFinger = std::numeric_limits<uint32_t>::max(); // Sentinel. @@ -466,26 +466,26 @@ void App::RegisterDevice(fuchsia::ui::input::DeviceDescriptor descriptor, FXL_VLOG(2) << "DirectInput - RegisterDevice: " << device_id << " " << descriptor; - std::unique_ptr<mozart::InputDeviceImpl> input_device = - std::make_unique<mozart::InputDeviceImpl>( + std::unique_ptr<ui_input::InputDeviceImpl> input_device = + std::make_unique<ui_input::InputDeviceImpl>( device_id, std::move(descriptor), std::move(input_device_request), this); - std::unique_ptr<mozart::DeviceState> state; + std::unique_ptr<ui_input::DeviceState> state; if (input_device->descriptor()->sensor) { - mozart::OnSensorEventCallback callback = + ui_input::OnSensorEventCallback callback = [this](uint32_t device_id, fuchsia::ui::input::InputReport event) { OnDeviceSensorEvent(device_id, std::move(event)); }; - state = std::make_unique<mozart::DeviceState>( + state = std::make_unique<ui_input::DeviceState>( input_device->id(), input_device->descriptor(), std::move(callback)); } else { uint32_t compositor_id = compositor_->id(); // Input destination. - mozart::OnEventCallback callback = + ui_input::OnEventCallback callback = [this, compositor_id](fuchsia::ui::input::InputEvent event) { OnDeviceInputEvent(compositor_id, std::move(event)); }; - state = std::make_unique<mozart::DeviceState>( + state = std::make_unique<ui_input::DeviceState>( input_device->id(), input_device->descriptor(), std::move(callback)); } @@ -494,7 +494,7 @@ void App::RegisterDevice(fuchsia::ui::input::DeviceDescriptor descriptor, device_state_by_id_.emplace(device_id, std::move(state)); } -void App::OnDeviceDisconnected(mozart::InputDeviceImpl* input_device) { +void App::OnDeviceDisconnected(ui_input::InputDeviceImpl* input_device) { const uint32_t device_id = input_device->id(); if (device_by_id_.count(device_id) == 0) @@ -507,7 +507,7 @@ void App::OnDeviceDisconnected(mozart::InputDeviceImpl* input_device) { device_by_id_.erase(device_id); } -void App::OnReport(mozart::InputDeviceImpl* input_device, +void App::OnReport(ui_input::InputDeviceImpl* input_device, fuchsia::ui::input::InputReport report) { const uint32_t device_id = input_device->id(); @@ -516,7 +516,7 @@ void App::OnReport(mozart::InputDeviceImpl* input_device, FXL_VLOG(3) << "DirectInput - OnReport: " << device_id << " " << report; - mozart::DeviceState* state = device_state_by_id_[device_id].get(); + ui_input::DeviceState* state = device_state_by_id_[device_id].get(); fuchsia::math::Size size; size.width = width_in_px_; size.height = height_in_px_; diff --git a/garnet/examples/ui/lab/direct_input/app.h b/garnet/examples/ui/lab/direct_input/app.h index c96a33f719076c404c93d8175ea7362bdad948b2..febb041ef65637013f48ed7083628dd31619b462 100644 --- a/garnet/examples/ui/lab/direct_input/app.h +++ b/garnet/examples/ui/lab/direct_input/app.h @@ -5,15 +5,15 @@ #ifndef GARNET_EXAMPLES_UI_LAB_DIRECT_INPUT_APP_H_ #define GARNET_EXAMPLES_UI_LAB_DIRECT_INPUT_APP_H_ -#include <array> -#include <memory> - #include <fuchsia/ui/app/cpp/fidl.h> #include <fuchsia/ui/input/cpp/fidl.h> #include <fuchsia/ui/scenic/cpp/fidl.h> #include <lib/async-loop/cpp/loop.h> #include <lib/zx/eventpair.h> +#include <array> +#include <memory> + #include "garnet/bin/ui/input_reader/input_reader.h" #include "lib/component/cpp/startup_context.h" #include "lib/fidl/cpp/binding_set.h" @@ -30,7 +30,7 @@ namespace direct_input { // // The README.md file describes its operation. class App : public fuchsia::ui::input::InputDeviceRegistry, - public mozart::InputDeviceImpl::Listener { + public ui_input::InputDeviceImpl::Listener { public: App(async::Loop* loop); ~App(); @@ -40,11 +40,11 @@ class App : public fuchsia::ui::input::InputDeviceRegistry, fidl::InterfaceRequest<fuchsia::ui::input::InputDevice> input_device) override; - // |mozart::InputDeviceImpl::Listener| - void OnDeviceDisconnected(mozart::InputDeviceImpl* input_device) override; + // |ui_input::InputDeviceImpl::Listener| + void OnDeviceDisconnected(ui_input::InputDeviceImpl* input_device) override; - // |mozart::InputDeviceImpl::Listener| - void OnReport(mozart::InputDeviceImpl* input_device, + // |ui_input::InputDeviceImpl::Listener| + void OnReport(ui_input::InputDeviceImpl* input_device, fuchsia::ui::input::InputReport report) override; private: @@ -85,13 +85,13 @@ class App : public fuchsia::ui::input::InputDeviceRegistry, async::Loop* const message_loop_; // Input fields - mozart::InputReader input_reader_; + ui_input::InputReader input_reader_; fidl::BindingSet<fuchsia::ui::input::InputDeviceRegistry> input_device_registry_bindings_; uint32_t next_device_token_; - std::unordered_map<uint32_t, std::unique_ptr<mozart::InputDeviceImpl>> + std::unordered_map<uint32_t, std::unique_ptr<ui_input::InputDeviceImpl>> device_by_id_; - std::unordered_map<uint32_t, std::unique_ptr<mozart::DeviceState>> + std::unordered_map<uint32_t, std::unique_ptr<ui_input::DeviceState>> device_state_by_id_; // DirectInput's Scene diff --git a/garnet/examples/ui/lab/scenic_dev_app/app.cc b/garnet/examples/ui/lab/scenic_dev_app/app.cc index 62a2ac8eeb99cb89a424e88d0273b1d564c106c0..693d4f48b30e1a9842676fea23c93878b3c1a8fb 100644 --- a/garnet/examples/ui/lab/scenic_dev_app/app.cc +++ b/garnet/examples/ui/lab/scenic_dev_app/app.cc @@ -3,24 +3,21 @@ // found in the LICENSE file. #include "garnet/examples/ui/lab/scenic_dev_app/app.h" -#include "garnet/lib/ui/util/glm_workaround.h" - -#include <glm/gtc/type_ptr.hpp> -#include <glm/gtx/quaternion.hpp> +#include "garnet/lib/ui/util/glm_workaround.h" // Must come first! #include <fuchsia/ui/gfx/cpp/fidl.h> #include <lib/async/cpp/task.h> #include <lib/zx/time.h> +#include <glm/gtc/type_ptr.hpp> +#include <glm/gtx/quaternion.hpp> +#include <lib/component/cpp/connect.h> +#include <lib/ui/scenic/cpp/commands.h> +#include <lib/ui/scenic/cpp/host_memory.h> +#include <src/lib/fxl/logging.h> #include <string> -#include "lib/component/cpp/connect.h" #include "lib/escher/util/image_utils.h" -#include "src/lib/fxl/logging.h" - -#include "lib/ui/scenic/cpp/commands.h" -#include "lib/ui/scenic/cpp/host_memory.h" - using namespace scenic; namespace scenic_dev_app { @@ -56,7 +53,6 @@ App::App(async::Loop* loop, const fxl::CommandLine& command_line) : startup_context_(component::StartupContext::CreateFromStartupInfo()), loop_(loop), shadow_technique_(GetShadowTechniqueFromCommandLine(command_line)) { - // Connect to the SceneManager service. scenic_ = startup_context_ ->ConnectToEnvironmentService<fuchsia::ui::scenic::Scenic>(); scenic_.set_error_handler([this](zx_status_t status) { diff --git a/garnet/examples/ui/shadertoy/service/imagepipe_shadertoy.cc b/garnet/examples/ui/shadertoy/service/imagepipe_shadertoy.cc index fafd927630e8fcdb89f5262ad48fdd737120a75f..e3ca49f6d794728a95e805fe30f42493bf33f843 100644 --- a/garnet/examples/ui/shadertoy/service/imagepipe_shadertoy.cc +++ b/garnet/examples/ui/shadertoy/service/imagepipe_shadertoy.cc @@ -34,7 +34,7 @@ void ShadertoyStateForImagePipe::ClearFramebuffers() { fb.acquire_fence.reset(); fb.release_fence.reset(); if (fb.image_pipe_id) { - // TODO(MZ-242): The docs in image_pipe.fidl says that all release fences + // TODO(SCN-242): The docs in image_pipe.fidl says that all release fences // must "be signaled before freeing or modifying the underlying memory // object". However, it seems convenient to allow clients to free the // object immediately; this shouldn't be a problem because the @@ -135,13 +135,13 @@ void ShadertoyStateForImagePipe::DrawFrame(uint64_t presentation_time, Renderer::Params params; params.iResolution = glm::vec3(width(), height(), 1); params.iTime = animation_time; - // TODO(MZ-241): params.iTimeDelta = ??; - // TODO(MZ-241): params.iFrame = 0; - // TODO(MZ-241): params.iChannelTime = ??; - // TODO(MZ-241): params.iChannelResolution = ??; + // TODO(SCN-241): params.iTimeDelta = ??; + // TODO(SCN-241): params.iFrame = 0; + // TODO(SCN-241): params.iChannelTime = ??; + // TODO(SCN-241): params.iChannelResolution = ??; params.iMouse = i_mouse(); - // TODO(MZ-241): params.iDate = ??; - // TODO(MZ-241): params.iSampleRate = ??; + // TODO(SCN-241): params.iDate = ??; + // TODO(SCN-241): params.iSampleRate = ??; renderer()->DrawFrame(fb.framebuffer, pipeline(), params, channel0(), channel1(), channel2(), channel3(), diff --git a/garnet/examples/ui/shadertoy/service/services/shadertoy_factory.fidl b/garnet/examples/ui/shadertoy/service/services/shadertoy_factory.fidl index 00aaf2fae4584485f7d2804136954474ee25a4cf..35ced0c2ad7bc3a6093512e94eb77f18c929f3db 100644 --- a/garnet/examples/ui/shadertoy/service/services/shadertoy_factory.fidl +++ b/garnet/examples/ui/shadertoy/service/services/shadertoy_factory.fidl @@ -19,7 +19,7 @@ protocol ShadertoyFactory { // automatically handled by the Shadertoy; in this case, invocations of // Shadertoy.SetMouse() will be ignored. Otherwise, the view will ignore // input events, and SetMouse() will behave normally. - // TODO(MZ-227): not implemented. + // TODO(SCN-227): not implemented. NewViewShadertoy(request<Shadertoy> toy, handle<eventpair> view_token, bool handle_input_events); }; diff --git a/garnet/examples/ui/standalone_app/app.cc b/garnet/examples/ui/standalone_app/app.cc index daa97deec377636cc7fa1b14cc13a8d5888d5291..da2baa3d7ef2291a7f04211be8dc6185617c6d36 100644 --- a/garnet/examples/ui/standalone_app/app.cc +++ b/garnet/examples/ui/standalone_app/app.cc @@ -3,24 +3,21 @@ // found in the LICENSE file. #include "garnet/examples/ui/standalone_app/app.h" -#include "garnet/lib/ui/util/glm_workaround.h" +#include "garnet/lib/ui/util/glm_workaround.h" // Must come first! +#include <fuchsia/ui/gfx/cpp/fidl.h> #include <glm/gtc/type_ptr.hpp> #include <glm/gtx/quaternion.hpp> - -#include <fuchsia/ui/gfx/cpp/fidl.h> #include <lib/async/cpp/task.h> +#include <lib/component/cpp/connect.h> +#include <lib/ui/scenic/cpp/commands.h> +#include <lib/ui/scenic/cpp/host_memory.h> #include <lib/zx/time.h> +#include <src/lib/fxl/logging.h> #include <string> -#include "lib/component/cpp/connect.h" #include "lib/escher/util/image_utils.h" -#include "src/lib/fxl/logging.h" - -#include "lib/ui/scenic/cpp/commands.h" -#include "lib/ui/scenic/cpp/host_memory.h" - using namespace scenic; namespace standalone_app { @@ -56,7 +53,6 @@ App::App(async::Loop* loop, const fxl::CommandLine& command_line) : startup_context_(component::StartupContext::CreateFromStartupInfo()), loop_(loop), shadow_technique_(GetShadowTechniqueFromCommandLine(command_line)) { - // Connect to the SceneManager service. scenic_ = startup_context_ ->ConnectToEnvironmentService<fuchsia::ui::scenic::Scenic>(); scenic_.set_error_handler([this](zx_status_t status) { diff --git a/garnet/lib/magma/docs/vulkan.md b/garnet/lib/magma/docs/vulkan.md index fb462c5f54d59fb6de9926c83139d7a6e950255f..3a8b8e8ef501d79688eb20f557d11af70e377d55 100644 --- a/garnet/lib/magma/docs/vulkan.md +++ b/garnet/lib/magma/docs/vulkan.md @@ -17,7 +17,7 @@ Vulkan Development a) The system compositor - See mozart documentation for details. + See Scenic documentation for details. b) Directly to the display diff --git a/garnet/lib/ui/gfx/engine/default_frame_scheduler.cc b/garnet/lib/ui/gfx/engine/default_frame_scheduler.cc index b7d25f43805992c6118c7cee62351d9863cbdda7..c8c9a6536004e0fcd66aacdf6781d1572cb52729 100644 --- a/garnet/lib/ui/gfx/engine/default_frame_scheduler.cc +++ b/garnet/lib/ui/gfx/engine/default_frame_scheduler.cc @@ -50,8 +50,8 @@ void DefaultFrameScheduler::SetRenderContinuously(bool render_continuously) { } zx_time_t DefaultFrameScheduler::PredictRequiredFrameRenderTime() const { - // TODO(MZ-400): more sophisticated prediction. This might require more info, - // e.g. about how many compositors will be rendering scenes, at what + // TODO(SCN-400): more sophisticated prediction. This might require more + // info, e.g. about how many compositors will be rendering scenes, at what // resolutions, etc. constexpr zx_time_t kHardcodedPrediction = 8'000'000; // 8ms return kHardcodedPrediction; @@ -282,7 +282,7 @@ void DefaultFrameScheduler::OnFramePresented(const FrameTimings& timings) { } FXL_DCHECK(!outstanding_frames_.empty()); - // TODO(MZ-400): how should we handle this case? It is theoretically + // TODO(SCN-400): how should we handle this case? It is theoretically // possible, but if if it happens then it means that the EventTimestamper is // receiving signals out-of-order and is therefore generating bogus data. FXL_DCHECK(outstanding_frames_[0].get() == &timings) << "out-of-order."; @@ -293,17 +293,17 @@ void DefaultFrameScheduler::OnFramePresented(const FrameTimings& timings) { } else { if (TRACE_CATEGORY_ENABLED("gfx")) { // Log trace data. - // TODO(MZ-400): just pass the whole Frame to a listener. - zx_duration_t target_vs_actual = - timings.actual_presentation_time() - timings.target_presentation_time(); + // TODO(SCN-400): just pass the whole Frame to a listener. + zx_duration_t target_vs_actual = timings.actual_presentation_time() - + timings.target_presentation_time(); zx_time_t now = async_now(dispatcher_); FXL_DCHECK(now >= timings.actual_presentation_time()); zx_duration_t elapsed_since_presentation = now - timings.actual_presentation_time(); - TRACE_INSTANT("gfx", "FramePresented", TRACE_SCOPE_PROCESS, "frame_number", - timings.frame_number(), "presentation time", + TRACE_INSTANT("gfx", "FramePresented", TRACE_SCOPE_PROCESS, + "frame_number", timings.frame_number(), "presentation time", timings.actual_presentation_time(), "target time missed by", target_vs_actual, "elapsed time since presentation", elapsed_since_presentation); diff --git a/garnet/lib/ui/gfx/engine/engine.cc b/garnet/lib/ui/gfx/engine/engine.cc index 17aefbd2f7844aea59f3de03511089c9d867f8dd..6e2bacff82a2bd8ba7876facdb5bd3db7ae1fef4 100644 --- a/garnet/lib/ui/gfx/engine/engine.cc +++ b/garnet/lib/ui/gfx/engine/engine.cc @@ -329,7 +329,7 @@ void Engine::UpdateAndDeliverMetrics(uint64_t presentation_time) { if (scenes.empty()) return; - // TODO(MZ-216): Traversing the whole graph just to compute this is pretty + // TODO(SCN-216): Traversing the whole graph just to compute this is pretty // inefficient. We should optimize this. fuchsia::ui::gfx::Metrics metrics; metrics.scale_x = 1.f; @@ -340,7 +340,7 @@ void Engine::UpdateAndDeliverMetrics(uint64_t presentation_time) { UpdateMetrics(scene, metrics, &updated_nodes); } - // TODO(MZ-216): Deliver events to sessions in batches. + // TODO(SCN-216): Deliver events to sessions in batches. // We probably want delivery to happen somewhere else which can also // handle delivery of other kinds of events. We should probably also // have some kind of backpointer from a session to its handler. diff --git a/garnet/lib/ui/gfx/engine/hit_tester.h b/garnet/lib/ui/gfx/engine/hit_tester.h index 2acce915d3c73f7dc985f2d83af19948a2d54ef9..b0336e6f97c8920358c4619ad699dc3f825312e9 100644 --- a/garnet/lib/ui/gfx/engine/hit_tester.h +++ b/garnet/lib/ui/gfx/engine/hit_tester.h @@ -81,7 +81,7 @@ class HitTester { // Returns true if the ray passes through the node's clipped content. // |ray| must be in the parent's local coordinate system. // - // TODO(MZ-207): The way this works only makes geometric sense if the ray + // TODO(SCN-207): The way this works only makes geometric sense if the ray // is parallel to the camera projection at the point being sampled. static bool IsRayWithinClippedContentOuter(Node* node, const escher::ray4& ray); diff --git a/garnet/lib/ui/gfx/engine/session_handler.h b/garnet/lib/ui/gfx/engine/session_handler.h index f44ea001cc83fcd41f97c8fab4433a22497dfcce..560a7ab7f73767e39b1202d4ab57864b55f75e07 100644 --- a/garnet/lib/ui/gfx/engine/session_handler.h +++ b/garnet/lib/ui/gfx/engine/session_handler.h @@ -19,8 +19,6 @@ namespace scenic_impl { namespace gfx { -class SceneManagerImpl; - // Implements the Session FIDL interface. For now, does nothing but buffer // operations from Enqueue() before passing them all to |session_| when // Commit() is called. Eventually, this class may do more work if performance diff --git a/garnet/lib/ui/gfx/gfx_system.h b/garnet/lib/ui/gfx/gfx_system.h index efd034d07e6e850055b70067b71f56b590a1de59..b4b89a20d413761271f8c581f2a4f86029650563 100644 --- a/garnet/lib/ui/gfx/gfx_system.h +++ b/garnet/lib/ui/gfx/gfx_system.h @@ -30,7 +30,7 @@ class GfxSystem : public TempSystemDelegate { CommandDispatcherUniquePtr CreateCommandDispatcher( CommandDispatcherContext context) override; - // TODO(MZ-452): Remove this when we externalize Displays. + // TODO(SCN-452): Remove this when we externalize Displays. void GetDisplayInfo( fuchsia::ui::scenic::Scenic::GetDisplayInfoCallback callback) override; void TakeScreenshot( @@ -58,7 +58,7 @@ class GfxSystem : public TempSystemDelegate { fit::closure DelayedInitClosure(); void Initialize(); - // TODO(MZ-452): Remove this when we externalize Displays. + // TODO(SCN-452): Remove this when we externalize Displays. void GetDisplayInfoImmediately( fuchsia::ui::scenic::Scenic::GetDisplayInfoCallback callback); void GetDisplayOwnershipEventImmediately( @@ -82,7 +82,7 @@ class GfxSystem : public TempSystemDelegate { int32_t messageCode, const char* pLayerPrefix, const char* pMessage); - // TODO(MZ-452): Remove this when we externalize Displays. + // TODO(SCN-452): Remove this when we externalize Displays. bool initialized_ = false; std::vector<fit::closure> run_after_initialized_; diff --git a/garnet/lib/ui/gfx/resources/compositor/layer.cc b/garnet/lib/ui/gfx/resources/compositor/layer.cc index 82e793911f6e6c057a4198ad82accfd109248b8a..f5213a51871f53be70e8474e0f47412692452250 100644 --- a/garnet/lib/ui/gfx/resources/compositor/layer.cc +++ b/garnet/lib/ui/gfx/resources/compositor/layer.cc @@ -22,7 +22,7 @@ Layer::Layer(Session* session, ResourceId id) Layer::~Layer() = default; bool Layer::SetRenderer(RendererPtr renderer) { - // TODO(MZ-249): if layer content is already specified as an image, clear it + // TODO(SCN-249): if layer content is already specified as an image, clear it // before setting the renderer. Or call it an error, and require the client // to explicitly clear it first. renderer_ = std::move(renderer); @@ -65,7 +65,7 @@ bool Layer::IsDrawable() const { return false; } - // TODO(MZ-249): Layers can also have a material or image pipe. + // TODO(SCN-249): Layers can also have a material or image pipe. return renderer_ && renderer_->camera() && renderer_->camera()->scene(); } diff --git a/garnet/lib/ui/gfx/resources/compositor/layer.h b/garnet/lib/ui/gfx/resources/compositor/layer.h index 2e402c157e71349fd30151de2e290aa055001c82..8a6a6c5a008ce3c24f256d47dc7cec2cd85e5ae2 100644 --- a/garnet/lib/ui/gfx/resources/compositor/layer.h +++ b/garnet/lib/ui/gfx/resources/compositor/layer.h @@ -10,7 +10,6 @@ #include "garnet/lib/ui/gfx/engine/hit.h" #include "garnet/lib/ui/gfx/engine/hit_tester.h" #include "garnet/lib/ui/gfx/resources/resource.h" - #include "lib/escher/geometry/types.h" #include "lib/escher/scene/viewing_volume.h" @@ -25,7 +24,7 @@ using LayerPtr = fxl::RefPtr<Layer>; using RendererPtr = fxl::RefPtr<Renderer>; // A Layer can appear in a LayerStack, and be displayed by a Compositor. -// TODO(MZ-249): Layers can currently only use a rendered scene as content, but +// TODO(SCN-249): Layers can currently only use a rendered scene as content, but // should also be able to directly use an Image/ImagePipe. class Layer : public Resource { public: @@ -62,7 +61,7 @@ class Layer : public Resource { uint32_t width() const { return static_cast<uint32_t>(size_.x); } uint32_t height() const { return static_cast<uint32_t>(size_.y); } - // TODO(MZ-250): support detecting and/or setting layer opacity. + // TODO(SCN-250): support detecting and/or setting layer opacity. bool opaque() const { return false; } // Performs a hit test into the scene of renderer, along the provided ray in diff --git a/garnet/lib/ui/gfx/resources/dump_visitor.cc b/garnet/lib/ui/gfx/resources/dump_visitor.cc index 1bf28dd66d72c58067cc8bf202e126a40052a9a2..27c9f417649ae505529b01b91852ca3da2e73bda 100644 --- a/garnet/lib/ui/gfx/resources/dump_visitor.cc +++ b/garnet/lib/ui/gfx/resources/dump_visitor.cc @@ -328,7 +328,7 @@ void DumpVisitor::Visit(Layer* r) { r->renderer()->Accept(this); EndSection(); } else { - // TODO(MZ-249): Texture or ImagePipe or whatever. + // TODO(SCN-249): Texture or ImagePipe or whatever. } VisitResource(r); EndItem(); diff --git a/garnet/lib/ui/gfx/resources/renderers/renderer.cc b/garnet/lib/ui/gfx/resources/renderers/renderer.cc index bc3e1c7ee15a2de917ce42b0a9992448dcfdc96b..465ca5fa145cb4be1bed823f708f5aa67f38f573 100644 --- a/garnet/lib/ui/gfx/resources/renderers/renderer.cc +++ b/garnet/lib/ui/gfx/resources/renderers/renderer.cc @@ -144,7 +144,7 @@ std::vector<escher::Object> Renderer::Visitor::GenerateClipperDisplayList( if (node->IsKindOf<ShapeNode>()) { node->Accept(&clipper_visitor); } else { - // TODO(MZ-167): accept non-ShapeNode parts. This might already work + // TODO(SCN-167): accept non-ShapeNode parts. This might already work // (i.e. it might be as simple as saying // "part->Accept(&part_visitor)"), but this hasn't been tested. FXL_LOG(WARNING) << "Renderer::Visitor::VisitNode(): Clipping only " @@ -183,7 +183,7 @@ void Renderer::Visitor::VisitAndMaybeClipNode(Node* r) { // also visible (i.e. have a non-null material) need to be drawn twice: // once as a clipper (with the material removed), and later as a clippee // (with the material intact). - // TODO(MZ-176): are there some constraints that we can put on allowable + // TODO(SCN-176): are there some constraints that we can put on allowable // elevations that would allow us to relax the draw-order constraint, // and thereby not render the objects twice? for (auto& obj : clippers) { diff --git a/garnet/lib/ui/gfx/resources/shapes/mesh_shape.cc b/garnet/lib/ui/gfx/resources/shapes/mesh_shape.cc index 184fd01244953d69bc1928818154531df12dfec6..a2a50dda38029a92a13c9a237c262d66d3324ca4 100644 --- a/garnet/lib/ui/gfx/resources/shapes/mesh_shape.cc +++ b/garnet/lib/ui/gfx/resources/shapes/mesh_shape.cc @@ -23,7 +23,7 @@ escher::Object MeshShape::GenerateRenderObject( bool MeshShape::GetIntersection(const escher::ray4& ray, float* out_distance) const { - // TODO(MZ-274): implement mesh-ray intersection. + // TODO(SCN-274): implement mesh-ray intersection. return IntersectRayBox(ray, bounding_box_, out_distance); } @@ -34,10 +34,11 @@ bool MeshShape::BindBuffers( uint64_t vertex_offset, uint32_t vertex_count, escher::BoundingBox bounding_box) { if (index_format != ::fuchsia::ui::gfx::MeshIndexFormat::kUint32) { - // TODO(MZ-275): only 32-bit indices are supported. - session()->error_reporter()->ERROR() << "BindBuffers::BindBuffers(): " - "TODO(MZ-275): only 32-bit indices " - "are supported."; + // TODO(SCN-275): only 32-bit indices are supported. + session()->error_reporter()->ERROR() + << "BindBuffers::BindBuffers(): " + "TODO(SCN-275): only 32-bit indices " + "are supported."; return false; } escher::MeshSpec spec; diff --git a/garnet/lib/ui/gfx/swapchain/display_swapchain.cc b/garnet/lib/ui/gfx/swapchain/display_swapchain.cc index d5b3b3030cde22d5f0ba3c8171ac525aa6bb36a6..328fe43d156ec7b2dbfbeaf52773bcfeabaa81b2 100644 --- a/garnet/lib/ui/gfx/swapchain/display_swapchain.cc +++ b/garnet/lib/ui/gfx/swapchain/display_swapchain.cc @@ -26,7 +26,7 @@ namespace { #define VK_CHECK_RESULT(XXX) FXL_CHECK(XXX.result == vk::Result::eSuccess) -// TODO(MZ-400): Don't triple buffer. This is done to avoid "tearing", but it +// TODO(SCN-400): Don't triple buffer. This is done to avoid "tearing", but it // wastes memory, and can result in the "permanent" addition of an extra Vsync // period of latency. An alternative would be to use an acquire fence; this // saves memory, but can still result in the permanent extra latency. Here's @@ -441,7 +441,7 @@ bool DisplaySwapchain::DrawAndPresentFrame(const FrameTimingsPtr& frame_timings, auto& frame_record = frames_[next_frame_index_] = NewFrameRecord(frame_timings); - // TODO(MZ-244): See below. What to do if rendering fails? + // TODO(SCN-244): See below. What to do if rendering fails? frame_record->render_finished_watch.Start(); next_frame_index_ = (next_frame_index_ + 1) % kSwapchainImageCount; diff --git a/garnet/lib/ui/gfx/tests/image_pipe_unittest.cc b/garnet/lib/ui/gfx/tests/image_pipe_unittest.cc index f8eab0c4818fbb138711be88e62872d5c8d33e46..3bc8f1b90e14cc215d833d64b2522f034542c113 100644 --- a/garnet/lib/ui/gfx/tests/image_pipe_unittest.cc +++ b/garnet/lib/ui/gfx/tests/image_pipe_unittest.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "garnet/lib/ui/gfx/resources/image_pipe.h" + #include "garnet/lib/ui/gfx/tests/mocks.h" #include "garnet/lib/ui/gfx/tests/session_handler_test.h" #include "garnet/lib/ui/gfx/tests/util.h" @@ -474,7 +475,7 @@ TEST_F(ImagePipeTest, ImagePipeRemoveImageThatIsPendingPresent) { EXPECT_ERROR_COUNT(0); } -// TODO(MZ-151): More tests. +// TODO(SCN-151): More tests. // - Test that you can't add the same image twice. // - Test that you can't present an image that doesn't exist. // - Test what happens when an acquire fence is closed on the client end. diff --git a/garnet/lib/ui/gfx/tests/shape_unittest.cc b/garnet/lib/ui/gfx/tests/shape_unittest.cc index 6de01b588bccd95717eb4034a716174bd3832ada..2b44b9f2abc730db8b89424d3feb438f0164bf4c 100644 --- a/garnet/lib/ui/gfx/tests/shape_unittest.cc +++ b/garnet/lib/ui/gfx/tests/shape_unittest.cc @@ -8,9 +8,8 @@ #include "garnet/lib/ui/gfx/resources/shapes/rectangle_shape.h" #include "garnet/lib/ui/gfx/resources/shapes/rounded_rectangle_shape.h" #include "garnet/lib/ui/gfx/tests/session_test.h" -#include "lib/ui/scenic/cpp/commands.h" - #include "gtest/gtest.h" +#include "lib/ui/scenic/cpp/commands.h" namespace scenic_impl { namespace gfx { @@ -151,7 +150,7 @@ TEST_F(ShapeTest, Rectangle) { &distance)); } -// TODO(MZ-159): This test needs a rounded rect factory to run but it is +// TODO(SCN-159): This test needs a rounded rect factory to run but it is // not currently available in the engine for tests. TEST_F(ShapeTest, DISABLED_RoundedRectangle) { const ResourceId id = 1; diff --git a/garnet/lib/ui/gfx/util/event_timestamper.h b/garnet/lib/ui/gfx/util/event_timestamper.h index be7d7f5d89c09a733d5b43504e8a958b933fbdc9..7be546be973a7800d7864449760c40a9797a88d6 100644 --- a/garnet/lib/ui/gfx/util/event_timestamper.h +++ b/garnet/lib/ui/gfx/util/event_timestamper.h @@ -97,7 +97,7 @@ class EventTimestamper { // Posts this EventTimestamper as a task on the background thread; when the // task is run it will bump the thread priority. - // TODO(MZ-257): Avoid using a high-priority thread. This would probably + // TODO(SCN-257): Avoid using a high-priority thread. This would probably // entail not using a background thread at all, but instead relying on new // kernel functionality to add a timestamp to a port message and/or a signaled // event. When addressing this, be sure to stop inheriting from async::Task. diff --git a/garnet/lib/ui/gfx/util/image_formats.cc b/garnet/lib/ui/gfx/util/image_formats.cc index b105388803f9f9e0c9fdab369f3a33e608cb016d..aa71f04286f8054e44cb78655a74e21bb8bb800b 100644 --- a/garnet/lib/ui/gfx/util/image_formats.cc +++ b/garnet/lib/ui/gfx/util/image_formats.cc @@ -3,9 +3,10 @@ // found in the LICENSE file. #include "lib/ui/gfx/util/image_formats.h" + #include "garnet/lib/ui/yuv/yuv.h" -#include "src/lib/fxl/logging.h" #include "lib/images/cpp/images.h" +#include "src/lib/fxl/logging.h" namespace scenic_impl { namespace gfx { @@ -14,7 +15,7 @@ namespace image_formats { namespace { // Takes 4 bytes of YUY2 and writes 8 bytes of RGBA -// TODO(MZ-547): do this better with a lookup table +// TODO(SCN-547): do this better with a lookup table void Yuy2ToBgra(uint8_t* yuy2, uint8_t* bgra1, uint8_t* bgra2) { uint8_t y1 = yuy2[0]; uint8_t u = yuy2[1]; @@ -77,8 +78,8 @@ void ConvertNv12ToBgra(uint8_t* out_ptr, uint8_t* in_ptr, uint32_t width, // Convert 2 lines at a time, to avoid reading UV data twice. I don't know if // avoiding reading UV twice really matters much since we're not skipping - // caches (such as with non-temporal reads), and I wouldn't be surprised if the - // bottleneck is often compute rather than memory. + // caches (such as with non-temporal reads), and I wouldn't be surprised if + // the bottleneck is often compute rather than memory. // // Writing two lines at a time might turn out to be counterproductive, // possibly depending on CPU write buffering details. @@ -175,7 +176,7 @@ escher::image_utils::ImageConversionFunction GetFunctionToConvertToBgra8( }; } break; - // TODO(MZ-551): support vertical flipping + // TODO(SCN-551): support vertical flipping case fuchsia::images::PixelFormat::YUY2: if (image_info.transform == fuchsia::images::Transform::FLIP_HORIZONTAL) { return [](void* out, void* in, uint32_t width, uint32_t height) { diff --git a/garnet/lib/ui/gfx/util/image_formats.h b/garnet/lib/ui/gfx/util/image_formats.h index 4811c9132de5f7efc08d3892e60b5e6dd58c0a10..cd2d1077830885ae78b108d73691a608f14bf505 100644 --- a/garnet/lib/ui/gfx/util/image_formats.h +++ b/garnet/lib/ui/gfx/util/image_formats.h @@ -6,11 +6,12 @@ #define GARNET_LIB_UI_GFX_UTIL_IMAGE_FORMATS_H_ #include <fuchsia/images/cpp/fidl.h> + #include "lib/escher/util/image_utils.h" // Contains utilities for converting from various formats to BGRA_8, which is // what is needed to render. -// TODO(MZ-547): Merge with existing image conversion libraries in media: +// TODO(SCN-547): Merge with existing image conversion libraries in media: // bin/media/video/video_converter.h namespace scenic_impl { diff --git a/garnet/lib/ui/scenic/session.cc b/garnet/lib/ui/scenic/session.cc index bbb18caa09fbfc6b75f69b1c347df9e698fce22a..9ad826348777308dea558ef6ca70dd55da2a129b 100644 --- a/garnet/lib/ui/scenic/session.cc +++ b/garnet/lib/ui/scenic/session.cc @@ -46,7 +46,7 @@ void Session::Present(uint64_t presentation_time, // calling into us during destruction. if (!valid_) return; - // TODO(MZ-469): Move Present logic into Session. + // TODO(SCN-469): Move Present logic into Session. auto& dispatcher = dispatchers_[System::TypeId::kGfx]; FXL_DCHECK(dispatcher); TempSessionDelegate* delegate = diff --git a/garnet/lib/ui/scenic/session.h b/garnet/lib/ui/scenic/session.h index 437b9fc65ed40c3d29949f738d62576831bb3147..b7c47ecacf17988f585340f8913f677253101d16 100644 --- a/garnet/lib/ui/scenic/session.h +++ b/garnet/lib/ui/scenic/session.h @@ -5,13 +5,13 @@ #ifndef GARNET_LIB_UI_SCENIC_SESSION_H_ #define GARNET_LIB_UI_SCENIC_SESSION_H_ +#include <fuchsia/ui/gfx/cpp/fidl.h> +#include <lib/fit/function.h> + #include <array> #include <memory> #include <string> -#include <fuchsia/ui/gfx/cpp/fidl.h> -#include <lib/fit/function.h> - #include "garnet/lib/ui/scenic/event_reporter.h" #include "garnet/lib/ui/scenic/forward_declarations.h" #include "garnet/lib/ui/scenic/scenic.h" @@ -50,13 +50,13 @@ class Session final : public fuchsia::ui::scenic::Session, PresentCallback callback) override; // |fuchsia::ui::scenic::Session| - // TODO(MZ-422): Remove this after it's removed from session.fidl. + // TODO(SCN-422): Remove this after it's removed from session.fidl. void HitTest(uint32_t node_id, ::fuchsia::ui::gfx::vec3 ray_origin, ::fuchsia::ui::gfx::vec3 ray_direction, HitTestCallback callback) override; // |fuchsia::ui::scenic::Session| - // TODO(MZ-422): Remove this after it's removed from session.fidl. + // TODO(SCN-422): Remove this after it's removed from session.fidl. void HitTestDeviceRay(::fuchsia::ui::gfx::vec3 ray_origin, ::fuchsia::ui::gfx::vec3 ray_direction, HitTestCallback callback) override; diff --git a/garnet/lib/ui/scenic/system.h b/garnet/lib/ui/scenic/system.h index 829c4d6e340a30e8d519e28e28d3c59cb93f9301..85d827214e75a94784634c3e43aeb785251684e9 100644 --- a/garnet/lib/ui/scenic/system.h +++ b/garnet/lib/ui/scenic/system.h @@ -5,7 +5,7 @@ #ifndef GARNET_LIB_UI_SCENIC_SYSTEM_H_ #define GARNET_LIB_UI_SCENIC_SYSTEM_H_ -// TODO(MZ-453): Don't support GetDisplayInfo in scenic fidl API. +// TODO(SCN-453): Don't support GetDisplayInfo in scenic fidl API. #include <fuchsia/ui/scenic/cpp/fidl.h> #include <lib/fit/function.h> #include <lib/inspect/inspect.h> @@ -100,7 +100,7 @@ class System { FXL_DISALLOW_COPY_AND_ASSIGN(System); }; -// TODO(MZ-452): Remove when we get rid of Scenic.GetDisplayInfo(). +// TODO(SCN-452): Remove when we get rid of Scenic.GetDisplayInfo(). class TempSystemDelegate : public System { public: explicit TempSystemDelegate(SystemContext context, diff --git a/garnet/lib/ui/sketchy/sketchy_system.h b/garnet/lib/ui/sketchy/sketchy_system.h index c44cc5fc7fddca8e9e06b04f8efa56d432175d9a..b41a99ff4821bc2cb4cc6896887b96b678852784 100644 --- a/garnet/lib/ui/sketchy/sketchy_system.h +++ b/garnet/lib/ui/sketchy/sketchy_system.h @@ -10,7 +10,7 @@ namespace scenic_impl { -// TODO(MZ-552): document. +// TODO(SCN-552): document. class SketchySystem : public System { public: static constexpr TypeId kTypeId = kSketchy; @@ -26,7 +26,7 @@ class SketchySystem : public System { gfx::GfxSystem* const gfx_system_; }; -// TODO(MZ-552): document. +// TODO(SCN-552): document. class SketchyCommandDispatcher : public CommandDispatcher { public: SketchyCommandDispatcher(CommandDispatcherContext context, diff --git a/garnet/public/lib/escher/flib/fence_listener.cc b/garnet/public/lib/escher/flib/fence_listener.cc index 8d436bb91f5dd72103cc94ce7c0ea81f5e806c8e..07fa3aedbd058d9b67b47875017234a9de99beca 100644 --- a/garnet/public/lib/escher/flib/fence_listener.cc +++ b/garnet/public/lib/escher/flib/fence_listener.cc @@ -77,7 +77,7 @@ void FenceListener::OnFenceSignalled(zx_status_t status, "error status code: " << status; - // TODO(MZ-173): Close the session if there is an error, or if the fence + // TODO(SCN-173): Close the session if there is an error, or if the fence // is closed. } } diff --git a/garnet/public/lib/escher/flib/fence_set_listener.cc b/garnet/public/lib/escher/flib/fence_set_listener.cc index 6bcc545595abefc430dfe7e82cde812cf6bdd418..f8b5ac4490e2ec7f6ebd00858aaa65621e7033ce 100644 --- a/garnet/public/lib/escher/flib/fence_set_listener.cc +++ b/garnet/public/lib/escher/flib/fence_set_listener.cc @@ -72,7 +72,7 @@ void FenceSetListener::OnFenceSignalled(size_t waiter_index, zx_status_t status, "error status code: " << status; - // TODO(MZ-173): Close the session if there is an error, or if the fence + // TODO(SCN-173): Close the session if there is an error, or if the fence // is closed. } } diff --git a/garnet/public/lib/ui/input/device_state.cc b/garnet/public/lib/ui/input/device_state.cc index 9222caf2f657db913f7523e81b96ab73a412808d..aff071f8e650bd3ee76b1379e33e722ac88d11a3 100644 --- a/garnet/public/lib/ui/input/device_state.cc +++ b/garnet/public/lib/ui/input/device_state.cc @@ -28,7 +28,7 @@ void PointerTraceHACK(trace_async_id_t id, float* fa, float* fb) { } } // namespace -namespace mozart { +namespace ui_input { constexpr zx::duration kKeyRepeatSlow = zx::msec(250); constexpr zx::duration kKeyRepeatFast = zx::msec(75); @@ -231,7 +231,7 @@ void MouseState::Update(fuchsia::ui::input::InputReport input_report, buttons_ = input_report.mouse->pressed_buttons; // TODO(jpoichet) Update once we have an API to capture mouse. - // TODO(MZ-385): Quantize the mouse value to the range [0, display_width - + // TODO(SCN-385): Quantize the mouse value to the range [0, display_width - // mouse_resolution] position_.x = std::max(0.0f, std::min(position_.x + input_report.mouse->rel_x, @@ -600,4 +600,4 @@ void DeviceState::Update(fuchsia::ui::input::InputReport input_report, } } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/public/lib/ui/input/device_state.h b/garnet/public/lib/ui/input/device_state.h index 7f9aa787622b1c2cbfac8ded54d296682a18b52b..1d85b0a05e39b99c8555df4c2de7dbf678c446ab 100644 --- a/garnet/public/lib/ui/input/device_state.h +++ b/garnet/public/lib/ui/input/device_state.h @@ -5,21 +5,20 @@ #ifndef LIB_UI_INPUT_DEVICE_STATE_H_ #define LIB_UI_INPUT_DEVICE_STATE_H_ +#include <fuchsia/math/cpp/fidl.h> +#include <fuchsia/ui/input/cpp/fidl.h> #include <hid/hid.h> #include <hid/usages.h> +#include <lib/fit/function.h> #include <lib/zx/time.h> #include <stdint.h> #include <vector> -#include <fuchsia/math/cpp/fidl.h> -#include <fuchsia/ui/input/cpp/fidl.h> -#include <lib/fit/function.h> - #include "src/lib/fxl/memory/ref_counted.h" #include "src/lib/fxl/memory/weak_ptr.h" -namespace mozart { +namespace ui_input { using OnEventCallback = fit::function<void(fuchsia::ui::input::InputEvent event)>; @@ -192,6 +191,6 @@ class DeviceState { MediaButtonState media_buttons_; }; -} // namespace mozart +} // namespace ui_input #endif // LIB_UI_INPUT_DEVICE_STATE_H_ diff --git a/garnet/public/lib/ui/input/input_device_impl.cc b/garnet/public/lib/ui/input/input_device_impl.cc index 00562821ad9aaef0fdad2dd4a9401ded9888fafc..895b47cc298eeafc05becd1729cf067b2c9d44f3 100644 --- a/garnet/public/lib/ui/input/input_device_impl.cc +++ b/garnet/public/lib/ui/input/input_device_impl.cc @@ -1,9 +1,8 @@ #include <lib/ui/input/input_device_impl.h> - #include <src/lib/fxl/logging.h> #include <trace/event.h> -namespace mozart { +namespace ui_input { InputDeviceImpl::InputDeviceImpl( uint32_t id, fuchsia::ui::input::DeviceDescriptor descriptor, @@ -29,4 +28,4 @@ void InputDeviceImpl::DispatchReport(fuchsia::ui::input::InputReport report) { listener_->OnReport(this, std::move(report)); } -} // namespace mozart +} // namespace ui_input diff --git a/garnet/public/lib/ui/input/input_device_impl.h b/garnet/public/lib/ui/input/input_device_impl.h index c353d88af97c1d2ce772ae5ba9bdacf15f19b24d..d600300ebdb665c31c44b4ff79167c47ebb0f40a 100644 --- a/garnet/public/lib/ui/input/input_device_impl.h +++ b/garnet/public/lib/ui/input/input_device_impl.h @@ -6,9 +6,10 @@ #define LIB_UI_INPUT_INPUT_DEVICE_IMPL_H_ #include <fuchsia/ui/input/cpp/fidl.h> + #include "lib/fidl/cpp/binding.h" -namespace mozart { +namespace ui_input { class InputDeviceImpl : public fuchsia::ui::input::InputDevice { public: @@ -38,6 +39,6 @@ class InputDeviceImpl : public fuchsia::ui::input::InputDevice { Listener* listener_; }; -} // namespace mozart +} // namespace ui_input #endif // LIB_UI_INPUT_INPUT_DEVICE_IMPL_H_ diff --git a/garnet/public/lib/ui/sketchy/client/resources.cc b/garnet/public/lib/ui/sketchy/client/resources.cc index 4a3f8719c62b26070fe581d6949062618d235680..f5af7c2f1207e1c2f1beb6d72d2f00a708b8576b 100644 --- a/garnet/public/lib/ui/sketchy/client/resources.cc +++ b/garnet/public/lib/ui/sketchy/client/resources.cc @@ -86,7 +86,7 @@ void Stroke::Extend(std::vector<glm::vec2> pts) const { extend_stroke.touches = std::move(touches); extend_stroke.predicted_touches.resize(0); - // TODO(MZ-269): Populate predicted touches. + // TODO(SCN-269): Populate predicted touches. ::fuchsia::ui::sketchy::Command command; command.set_extend_stroke(std::move(extend_stroke)); EnqueueCmd(std::move(command)); diff --git a/garnet/public/lib/ui/sketchy/client/resources.h b/garnet/public/lib/ui/sketchy/client/resources.h index 5b9bd00412b7d0d51551d6014defc375d7002b5d..f0d45646881e22fe3726f7113931fd9fe433183f 100644 --- a/garnet/public/lib/ui/sketchy/client/resources.h +++ b/garnet/public/lib/ui/sketchy/client/resources.h @@ -67,7 +67,7 @@ class Stroke final : public Resource, public fxl::RefCountedThreadSafe<Stroke> { explicit Stroke(Canvas* canvas); void SetPath(const StrokePath& path) const; void Begin(glm::vec2 pt) const; - // TODO(MZ-269): Also pass in predicted points. + // TODO(SCN-269): Also pass in predicted points. void Extend(std::vector<glm::vec2> pts) const; void Finish() const; diff --git a/garnet/public/lib/ui/tests/mocks/mock_input_device.cc b/garnet/public/lib/ui/tests/mocks/mock_input_device.cc index 74ecda8ae9223a6ad84f2d0b941045bf99602918..7adcfb209b0d1f5efc85bf07d6b9417378b9c402 100644 --- a/garnet/public/lib/ui/tests/mocks/mock_input_device.cc +++ b/garnet/public/lib/ui/tests/mocks/mock_input_device.cc @@ -4,7 +4,7 @@ #include "lib/ui/tests/mocks/mock_input_device.h" -namespace mozart { +namespace ui_input { namespace test { MockInputDevice::MockInputDevice( @@ -25,4 +25,4 @@ void MockInputDevice::DispatchReport(fuchsia::ui::input::InputReport report) { } } // namespace test -} // namespace mozart +} // namespace ui_input diff --git a/garnet/public/lib/ui/tests/mocks/mock_input_device.h b/garnet/public/lib/ui/tests/mocks/mock_input_device.h index c1fb3301f9527c20ec5f775d348c1b472f88cade..272482a912a9c08438c2787002f2dda663c77c35 100644 --- a/garnet/public/lib/ui/tests/mocks/mock_input_device.h +++ b/garnet/public/lib/ui/tests/mocks/mock_input_device.h @@ -11,7 +11,7 @@ #include "lib/fidl/cpp/binding.h" #include "src/lib/fxl/macros.h" -namespace mozart { +namespace ui_input { namespace test { using OnReportCallback = @@ -42,6 +42,6 @@ class MockInputDevice : public fuchsia::ui::input::InputDevice { }; } // namespace test -} // namespace mozart +} // namespace ui_input #endif // LIB_UI_TESTS_MOCKS_MOCK_INPUT_DEVICE_H_ diff --git a/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.cc b/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.cc index 1ae6d2d3221fa541e77095bf8cc0950224784a07..03ff7969200f4d173ba62b067aba27bc831f3f21 100644 --- a/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.cc +++ b/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.cc @@ -4,7 +4,7 @@ #include "lib/ui/tests/mocks/mock_input_device_registry.h" -namespace mozart { +namespace ui_input { namespace test { MockInputDeviceRegistry::MockInputDeviceRegistry( @@ -33,4 +33,4 @@ void MockInputDeviceRegistry::RegisterDevice( } } // namespace test -} // namespace mozart +} // namespace ui_input diff --git a/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.h b/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.h index a4130e63b12274916247c2dbf967772cd39036d2..7b99b17809c491cb3469b5c40d2102f79cba3639 100644 --- a/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.h +++ b/garnet/public/lib/ui/tests/mocks/mock_input_device_registry.h @@ -5,17 +5,17 @@ #ifndef LIB_UI_TESTS_MOCKS_MOCK_INPUT_DEVICE_REGISTRY_H_ #define LIB_UI_TESTS_MOCKS_MOCK_INPUT_DEVICE_REGISTRY_H_ -#include <memory> -#include <unordered_map> - #include <fuchsia/ui/input/cpp/fidl.h> #include <lib/fit/function.h> +#include <memory> +#include <unordered_map> + #include "lib/component/cpp/startup_context.h" -#include "src/lib/fxl/macros.h" #include "lib/ui/tests/mocks/mock_input_device.h" +#include "src/lib/fxl/macros.h" -namespace mozart { +namespace ui_input { namespace test { using OnDeviceCallback = fit::function<void(MockInputDevice*)>; @@ -42,6 +42,6 @@ class MockInputDeviceRegistry : public fuchsia::ui::input::InputDeviceRegistry { }; } // namespace test -} // namespace mozart +} // namespace ui_input #endif // LIB_UI_TESTS_MOCKS_MOCK_INPUT_DEVICE_REGISTRY_H_ diff --git a/sdk/fidl/fuchsia.ui.gfx/fuchsia.ui.gfx.api b/sdk/fidl/fuchsia.ui.gfx/fuchsia.ui.gfx.api index e2d9c049b38f9769bff3b99610ae31e0cd893849..3361797d7ec6e1b68c1fc5dcd2c3161a0e3887ac 100644 --- a/sdk/fidl/fuchsia.ui.gfx/fuchsia.ui.gfx.api +++ b/sdk/fidl/fuchsia.ui.gfx/fuchsia.ui.gfx.api @@ -3,11 +3,11 @@ "fidl/fuchsia.ui.gfx/display_info.fidl": "487789dbc460e85bee1a1093b8e41c83", "fidl/fuchsia.ui.gfx/events.fidl": "0f5bdac88fd68d128a58b135581e3911", "fidl/fuchsia.ui.gfx/hit.fidl": "1325603f149baaa07e3d9c6b1bafcec7", - "fidl/fuchsia.ui.gfx/nodes.fidl": "87da3980758ae4aced5423a4655e0f73", + "fidl/fuchsia.ui.gfx/nodes.fidl": "d983262649e33110c2c024f63ee699e8", "fidl/fuchsia.ui.gfx/pose_buffer_provider.fidl": "4582584b23ff58d57767d85279634722", "fidl/fuchsia.ui.gfx/renderer.fidl": "ab707a12fa7bd2b3a8779412e6e26fde", "fidl/fuchsia.ui.gfx/resources.fidl": "01375ac2971c980340365b739f1ab37d", "fidl/fuchsia.ui.gfx/shapes.fidl": "e2d87bf731f70ca0052b6537c0a1b85e", "fidl/fuchsia.ui.gfx/tokens.fidl": "892a0d873970d904944afbb6fc2871b3", - "fidl/fuchsia.ui.gfx/types.fidl": "8d95d5e1c48e5994b85fd862bab58615" + "fidl/fuchsia.ui.gfx/types.fidl": "f8c29e282823d0448ccca62ae2670dc4" } \ No newline at end of file diff --git a/sdk/fidl/fuchsia.ui.gfx/nodes.fidl b/sdk/fidl/fuchsia.ui.gfx/nodes.fidl index 66456962e03da0a00b6d2e7c204b1cf9d35cd3fd..e53541b51e699c186ab6f96e91270b2bf9aa28ae 100644 --- a/sdk/fidl/fuchsia.ui.gfx/nodes.fidl +++ b/sdk/fidl/fuchsia.ui.gfx/nodes.fidl @@ -4,7 +4,7 @@ library fuchsia.ui.gfx; -// These are the types of nodes that can be created within a Mozart |Session|. +// These are the types of nodes that can be created within a Scenic |Session|. // // All nodes have an associated transform, which distinguishes them from mere // resources. Nodes may also have one or more node Characteristics: diff --git a/sdk/fidl/fuchsia.ui.gfx/types.fidl b/sdk/fidl/fuchsia.ui.gfx/types.fidl index e310fa5a644ba3eb0ff660f1295bc98c9f426456..e920ec58fa54b40813e0f0fbbdfbecc7b06fbe78 100644 --- a/sdk/fidl/fuchsia.ui.gfx/types.fidl +++ b/sdk/fidl/fuchsia.ui.gfx/types.fidl @@ -27,7 +27,7 @@ struct mat4 { array<float32>:16 matrix; }; -// TODO(MZ-238): use float32s instead of uint8. +// TODO(SCN-238): use float32s instead of uint8. struct ColorRgba { uint8 red; uint8 green; diff --git a/sdk/fidl/fuchsia.ui.scenic/fuchsia.ui.scenic.api b/sdk/fidl/fuchsia.ui.scenic/fuchsia.ui.scenic.api index c70f9016d97963ff4fc449ad16ab517ae875268c..edfb01e71535bc5740e125f2fba9f68bb4a8c375 100644 --- a/sdk/fidl/fuchsia.ui.scenic/fuchsia.ui.scenic.api +++ b/sdk/fidl/fuchsia.ui.scenic/fuchsia.ui.scenic.api @@ -1,6 +1,6 @@ { "fidl/fuchsia.ui.scenic/commands.fidl": "6710eee1f3c859bdeb5fd4279bbdd48f", "fidl/fuchsia.ui.scenic/events.fidl": "0b2de80e3dfc14c02961196c6827f0d2", - "fidl/fuchsia.ui.scenic/scenic.fidl": "f9c45c35e2fc28ba86c66d2459482ba9", - "fidl/fuchsia.ui.scenic/session.fidl": "d616194dabfff804e9e368950607e581" + "fidl/fuchsia.ui.scenic/scenic.fidl": "a02fbcb8be1b00d385c9bebb1c3c43ee", + "fidl/fuchsia.ui.scenic/session.fidl": "e51c510b1327b1504063a8d98a08f832" } \ No newline at end of file diff --git a/sdk/fidl/fuchsia.ui.scenic/scenic.fidl b/sdk/fidl/fuchsia.ui.scenic/scenic.fidl index 3be4f0dae2fe2c8c42e469532651d9e0fdc10c06..e6196cf695186bafaf5de3d631f7bbbc3d0798f5 100644 --- a/sdk/fidl/fuchsia.ui.scenic/scenic.fidl +++ b/sdk/fidl/fuchsia.ui.scenic/scenic.fidl @@ -16,12 +16,12 @@ struct ScreenshotData { [Discoverable] protocol Scenic { - // Create a new Session, which is the primary way to interact with Mozart. + // Create a new Session, which is the primary way to interact with Scenic. CreateSession(request<Session> session, SessionListener? listener); - // Get information about the SceneManager's primary display. - // TODO(MZ-453): in the future there will probably be a DisplayManager, and - // info about which displays to use will be provided to the SceneManager. + // Get information about the Scenic's primary display. + // TODO(SCN-453): in the future there will probably be a DisplayManager, and + // info about which displays to use will be provided to the Scenic. GetDisplayInfo() -> (fuchsia.ui.gfx.DisplayInfo info); // Gets an event signaled with displayOwnedSignal or displayNotOwnedSignal // when display ownership changes. diff --git a/sdk/fidl/fuchsia.ui.scenic/session.fidl b/sdk/fidl/fuchsia.ui.scenic/session.fidl index cef47e3ba1d91bda81423fca0389f16e835c65a0..b20e4ad12f5f2d854c410e75663c40104987f5a4 100644 --- a/sdk/fidl/fuchsia.ui.scenic/session.fidl +++ b/sdk/fidl/fuchsia.ui.scenic/session.fidl @@ -7,7 +7,7 @@ library fuchsia.ui.scenic; using fuchsia.images; using fuchsia.ui.gfx; -// Client use Sessions to interact with a Mozart instance by enqueuing commands +// Client use Sessions to interact with a Scenic instance by enqueuing commands // that create or modify resources. protocol Session { Enqueue(vector<Command> cmds); @@ -61,19 +61,19 @@ protocol Session { // // SYNCHRONIZATION // - // |acquire_fences| are used by Mozart to wait until all of the session's + // |acquire_fences| are used by Scenic to wait until all of the session's // resources are ready to render (or to allow downstream components, such as // the Vulkan driver, to wait for these resources). // // For example, Fuchsia's Vulkan driver allows an zx::event to be obtained - // from a VkSemaphore. This allows a Mozart client to submit a Vulkan command + // from a VkSemaphore. This allows a Scenic client to submit a Vulkan command // buffer to generate images/meshes/etc., and instructing Vulkan to signal a // VkSemaphore when it is done. By inserting the zx::event corresponding to - // this semaphore into |acquire_fences|, the client allows Mozart to submit work + // this semaphore into |acquire_fences|, the client allows Scenic to submit work // to the Vulkan driver without waiting on the CPU for the event to be // signalled. // - // |release_fences| is a list of events that will be signalled by Mozart when + // |release_fences| is a list of events that will be signalled by Scenic when // the updated session state has been fully committed: future frames will be // rendered using this state, and all frames generated using previous session // states have been fully-rendered and presented to the display. @@ -91,7 +91,7 @@ protocol Session { // 6) call Present() with one acquire-fence (obtained from the VkSemaphore // above) and one newly-created release-fence. // - // After the steps above, Mozart will use the committed session state to render + // After the steps above, Scenic will use the committed session state to render // frames whenever necessary. When the client wants to display something // different than Image #1, it would do something similar to steps 4) to 6): // 7) set Node #5 to use Material #4. @@ -103,7 +103,7 @@ protocol Session { // Finally, to continually draw new content, the client could repeat steps // 4) to 9), with one important difference: step 5) must wait on the event // signalled by step 9). Otherwise, it might render into Image #1 while that - // image is still being used by Mozart to render a frame. Similarly, step 8) + // image is still being used by Scenic to render a frame. Similarly, step 8) // must wait on the event signalled by step 6). // // The scenario described above uses one acquire-fence and one release-fence, @@ -117,7 +117,7 @@ protocol Session { // access to memory (and other external resources). Any modification to // resources made via the Session API are automatically synchronized. // - // TODO(MZ-400): document invariants that apply to |presentation_info|. Is it + // TODO(SCN-400): document invariants that apply to |presentation_info|. Is it // strong enough to guarantee that receiving the response means that all // previously-enqueued Commands have been applied? Or does it need to be stronger, // e.g. that all frames based on previous presentations are completely done, @@ -127,7 +127,7 @@ protocol Session { vector<handle<event>> acquire_fences, vector<handle<event>> release_fences) -> (fuchsia.images.PresentationInfo presentation_info); - // TODO(MZ-422) Remove these methods from the FIDL; they should just be + // TODO(SCN-422) Remove these methods from the FIDL; they should just be // exposed to View Manager directly using a C++ interface. HitTest(uint32 node_id, fuchsia.ui.gfx.vec3 ray_origin, fuchsia.ui.gfx.vec3 ray_direction) -> (vector<fuchsia.ui.gfx.Hit>? hits); diff --git a/sdk/fidl/fuchsia.ui.sketchy/commands.fidl b/sdk/fidl/fuchsia.ui.sketchy/commands.fidl index 232239faa469b41359ffd10f7d38ebaf87dfe20a..f877be0a5f455cf12c306c89d9bee6e532b0e0c7 100644 --- a/sdk/fidl/fuchsia.ui.sketchy/commands.fidl +++ b/sdk/fidl/fuchsia.ui.sketchy/commands.fidl @@ -65,6 +65,7 @@ struct CreateResourceCmd { // stroke is added to a stroke-group, the group will keep the it alive even // after the client releases the stroke. // + // TODO: edge cases. What about releasing a stroke that is currently being // drawn by Begin/Extend/FinishStrokeCmd? struct ReleaseResourceCmd { @@ -106,7 +107,7 @@ struct ExtendStrokeCmd { // trajectory of the stroke. Sketchy uses these to improve perceived latency // while the stroke is being drawn, but they have no impact on the finished // stroke. - // TODO: this may change to reflect however Mozart exposes predicted events. + // TODO: this may change to reflect however Scenic exposes predicted events. vector<Touch> predicted_touches; }; diff --git a/sdk/fidl/fuchsia.ui.sketchy/resources.fidl b/sdk/fidl/fuchsia.ui.sketchy/resources.fidl index a6f53f9fa0c0464671df6d10249ceef4bd4769b7..acf962dd0780227914b923d0126ae6a9df95ead5 100644 --- a/sdk/fidl/fuchsia.ui.sketchy/resources.fidl +++ b/sdk/fidl/fuchsia.ui.sketchy/resources.fidl @@ -25,6 +25,7 @@ union ResourceArgs { // SetPath or Begin/Extend/FinishStroke) since it was created, or the last time // that Clear was called. // + // Commands: // - ClearStroke // - SetStrokePath @@ -39,6 +40,7 @@ struct Stroke { // A stroke-group is a container of strokes, which can be inserted into a Scenic // scene-graph by importing adding it as a child of an imported |fuchsia.ui.gfx.Node|. // + // Commands: // - ClearGroup // - AddStroke @@ -49,8 +51,9 @@ struct StrokeGroup { }; // A pen handles user input to create a path for a stroke. -// TODO(MZ-246): expose access to stroke-fitter parameters. +// TODO(SCN-246): expose access to stroke-fitter parameters. // + // Commands: // - BeginStroke // - ExtendStroke @@ -61,6 +64,7 @@ struct Pen { // The classic Escher Sketcy Demo wobbly style that you know and love. // + // Commands: // - SetPenStyle (as arg). // - SetStrokeStyle (as arg). @@ -80,6 +84,7 @@ struct WobblyStyle { // proportionally to the arc-length of the stroke. An example use-case is a // to visualize the frequency spectrum of an audio signal. // + // Commands: // - SetPenStyle (as arg) // - SetStrokeStyle (as arg). diff --git a/sdk/fidl/fuchsia.ui.viewsv1/fuchsia.ui.viewsv1.api b/sdk/fidl/fuchsia.ui.viewsv1/fuchsia.ui.viewsv1.api index b659b118056473eab4c653a34e0f2460fc27813e..d7c5521d52d58e81c088f264f51953064e114168 100644 --- a/sdk/fidl/fuchsia.ui.viewsv1/fuchsia.ui.viewsv1.api +++ b/sdk/fidl/fuchsia.ui.viewsv1/fuchsia.ui.viewsv1.api @@ -1,6 +1,6 @@ { "fidl/fuchsia.ui.viewsv1/view_containers.fidl": "4a2e93e648c4b34144a8c56dce10a3ab", - "fidl/fuchsia.ui.viewsv1/view_manager.fidl": "429a5b08d8559ee83773498c8f555928", + "fidl/fuchsia.ui.viewsv1/view_manager.fidl": "29c663bfc2a6d899dd689294df131432", "fidl/fuchsia.ui.viewsv1/view_properties.fidl": "1d7ab5621bf135075279113cad3feba9", "fidl/fuchsia.ui.viewsv1/view_provider.fidl": "8d4832f34b877218b368cba39a644c2b", "fidl/fuchsia.ui.viewsv1/view_snapshot.fidl": "8fb458e6a6722abb66f37cfda174f8e7", diff --git a/sdk/fidl/fuchsia.ui.viewsv1/view_manager.fidl b/sdk/fidl/fuchsia.ui.viewsv1/view_manager.fidl index 61b81a33465b9408a398d8b55354187ff126cb1a..518663120541ed8e5649d42d26c946c88fa7a545 100644 --- a/sdk/fidl/fuchsia.ui.viewsv1/view_manager.fidl +++ b/sdk/fidl/fuchsia.ui.viewsv1/view_manager.fidl @@ -19,6 +19,7 @@ const uint32 kLabelMaxLength = 32; // The system creates a view tree to hold the root of a view hierarchy // containing views from various applications. // + // Refer to |View| and |ViewTree| for more information about these objects. [Discoverable] protocol ViewManager { @@ -51,7 +52,7 @@ protocol ViewManager { // attached. // // To present graphical content, the view must obtain a |Session| from - // |Mozart|, create an event pair, bind one endpoint to an + // |Scenic|, create an event pair, bind one endpoint to an // |ImportResourceOp| using |ImportSpec.NODE|, attach its content nodes as // descendants of the imported node, and pass the other endpoint of the // event pair to this method as |parent_export_token|. diff --git a/sdk/lib/ui/scenic/cpp/host_memory.h b/sdk/lib/ui/scenic/cpp/host_memory.h index b97b45005343c68c50db418280b12086c4de438a..8a59294b9a12ef68d1165d6d0255d1078ab5be11 100644 --- a/sdk/lib/ui/scenic/cpp/host_memory.h +++ b/sdk/lib/ui/scenic/cpp/host_memory.h @@ -7,6 +7,7 @@ #include <lib/ui/scenic/cpp/resources.h> #include <lib/zx/vmo.h> + #include <memory> #include <utility> #include <vector> @@ -39,7 +40,7 @@ class HostData : public std::enable_shared_from_this<HostData> { // session. The memory is mapped read/write into this process and transferred // read-only to the scene manager. The shared memory region is retained until // this object is destroyed. -// TODO(MZ-268): Don't inherit from Memory, so that Memory can have a public +// TODO(SCN-268): Don't inherit from Memory, so that Memory can have a public // move constructor. // TODO(MA-492): The memory is currently not transferred read-only, as we may // choose to map it as device-local memory on UMA platforms, and Vulkan requires @@ -72,7 +73,7 @@ class HostMemory final : public Memory { // Represents an image resource backed by host-accessible shared memory bound to // a session. The shared memory region is retained until this object is // destroyed. -// TODO(MZ-268): Don't inherit from Image, so that Image can have a public move +// TODO(SCN-268): Don't inherit from Image, so that Image can have a public move // constructor. class HostImage final : public Image { public: diff --git a/sdk/lib/ui/scenic/cpp/resources.h b/sdk/lib/ui/scenic/cpp/resources.h index fc4bd0832f8fc25368f17163c6ae94546181e059..ddb58ca806a40c82cae8c3a61fd2c93365744007 100644 --- a/sdk/lib/ui/scenic/cpp/resources.h +++ b/sdk/lib/ui/scenic/cpp/resources.h @@ -58,7 +58,7 @@ class Resource { }; // Represents a memory resource in a session. -// TODO(MZ-268): Make this class final, and add public move constructor. +// TODO(SCN-268): Make this class final, and add public move constructor. class Memory : public Resource { public: Memory(Session* session, zx::vmo vmo, uint64_t allocation_size, @@ -112,7 +112,7 @@ class RoundedRectangle final : public Shape { }; // Represents an image resource in a session. -// TODO(MZ-268): Make this class final, and add public move constructor. +// TODO(SCN-268): Make this class final, and add public move constructor. class Image : public Resource { public: // Creates an image resource bound to a session. @@ -201,14 +201,13 @@ class Node : public Resource { void SetTranslation(uint32_t variable_id); - - [[deprecated("(SCN-1054) Please move back to Node::SetTranslation().")]] - void SetTranslationRH(float tx, float ty, float tz) { + [[deprecated("(SCN-1054) Please move back to Node::SetTranslation().")]] void + SetTranslationRH(float tx, float ty, float tz) { SetTranslation((float[3]){tx, ty, tz}); } - [[deprecated("(SCN-1054) Please move back to Node::SetTranslation().")]] - void SetTranslationRH(const float translation[3]) { + [[deprecated("(SCN-1054) Please move back to Node::SetTranslation().")]] void + SetTranslationRH(const float translation[3]) { SetTranslation(translation); } @@ -298,7 +297,7 @@ class ContainerNode : public Node { class ViewHolder; // Represents an entity node resource in a session. -// TODO(MZ-268): Make this class final, and add public move constructor. +// TODO(SCN-268): Make this class final, and add public move constructor. class EntityNode : public ContainerNode { public: explicit EntityNode(Session* session); diff --git a/sdk/lib/ui/scenic/cpp/scenic_cpp.api b/sdk/lib/ui/scenic/cpp/scenic_cpp.api index 71ba0e6cf41455044177e03b48b4a5eaaf9e0fa1..9d6eab151f46beb069981681aa2ec119428247ad 100644 --- a/sdk/lib/ui/scenic/cpp/scenic_cpp.api +++ b/sdk/lib/ui/scenic/cpp/scenic_cpp.api @@ -1,8 +1,8 @@ { "pkg/scenic_cpp/include/lib/ui/scenic/cpp/commands.h": "6397ed51aac14686cbc898b7613cf22a", - "pkg/scenic_cpp/include/lib/ui/scenic/cpp/host_memory.h": "b1fe5a1b1b736a82cea37e191d435532", + "pkg/scenic_cpp/include/lib/ui/scenic/cpp/host_memory.h": "d9c14240ee79c58d60260a9d4c680681", "pkg/scenic_cpp/include/lib/ui/scenic/cpp/id.h": "4442d6e024bba018b7a8038d0a069713", - "pkg/scenic_cpp/include/lib/ui/scenic/cpp/resources.h": "efc4ec9b631f0b3fab70e180c97a44bc", + "pkg/scenic_cpp/include/lib/ui/scenic/cpp/resources.h": "9a5bb16005bb568233004a3b9d34106d", "pkg/scenic_cpp/include/lib/ui/scenic/cpp/session.h": "3055e2a58ffb264559fe73e14774cf85", "pkg/scenic_cpp/include/lib/ui/scenic/cpp/util/mesh_utils.h": "41dd823e1bd4cf48c560873547a689ea", "pkg/scenic_cpp/include/lib/ui/scenic/cpp/view_token_pair.h": "5891b46e01fcae095aeef0e8ff9b7398"