scale_utility.h 919 B

123456789101112131415161718192021222324252627
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_PUBLIC_CPP_SCALE_UTILITY_H_
  5. #define ASH_PUBLIC_CPP_SCALE_UTILITY_H_
  6. #include "ash/public/cpp/ash_public_export.h"
  7. namespace gfx {
  8. class Transform;
  9. } // namespace gfx
  10. namespace ash {
  11. // TODO(crbug.com/756161): This method will need to be moved to
  12. // gfx/geometry/dip_utils.h for M62 and later. This method computes the scale
  13. // required to convert DIP coordinates to the coordinate space of the
  14. // |transform|. It deduces the scale from the transform by applying it to a pair
  15. // of points separated by the distance of 1, and measuring the distance between
  16. // the transformed points.
  17. ASH_PUBLIC_EXPORT float GetScaleFactorForTransform(
  18. const gfx::Transform& transform);
  19. } // namespace ash
  20. #endif // ASH_PUBLIC_CPP_SCALE_UTILITY_H_