blob: dbac085ed6f4b92e976c6239b237e1e24cb6fe68 [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/public/common/widget/screen_info_mojom_traits.h"
#include "ui/gfx/geometry/mojom/geometry.mojom.h"
#include "ui/gfx/mojom/display_color_spaces.mojom.h"
namespace mojo {
bool StructTraits<blink::mojom::ScreenInfoDataView, blink::ScreenInfo>::Read(
blink::mojom::ScreenInfoDataView data,
blink::ScreenInfo* out) {
if (!data.ReadDisplayColorSpaces(&out->display_color_spaces) ||
!data.ReadRect(&out->rect) ||
!data.ReadAvailableRect(&out->available_rect))
return false;
out->device_scale_factor = data.device_scale_factor();
out->depth = data.depth();
out->depth_per_component = data.depth_per_component();
out->is_monochrome = data.is_monochrome();
out->display_frequency = data.display_frequency();
out->orientation_type = data.orientation_type();
out->orientation_angle = data.orientation_angle();
out->is_extended = data.is_extended();
return true;
}
} // namespace mojo