summaryrefslogtreecommitdiffstats
path: root/mandoline/ui/common/util.cc
blob: 2ef16046fd85df4bb7c80b76e9b7ca2071640f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright 2015 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 "mandoline/ui/common/util.h"

#include "components/mus/public/cpp/window.h"
#include "mojo/converters/geometry/geometry_type_converters.h"

namespace mandoline {

std::vector<gfx::Display> GetDisplaysFromWindow(mus::Window* window) {
  static int64 synthesized_display_id = 2000;
  gfx::Display display;
  display.set_id(synthesized_display_id++);
  display.SetScaleAndBounds(
      window->viewport_metrics().device_pixel_ratio,
      gfx::Rect(window->viewport_metrics().size_in_pixels.To<gfx::Size>()));
  std::vector<gfx::Display> displays;
  displays.push_back(display);
  return displays;
}

}  // namespace mandoline