Chromium Code Reviews| Index: remoting/host/screen_resolution.h |
| diff --git a/remoting/host/screen_resolution.h b/remoting/host/screen_resolution.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..31587a0c337aae2ae60530036d2604d7a578793d |
| --- /dev/null |
| +++ b/remoting/host/screen_resolution.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright (c) 2013 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. |
| + |
| +#ifndef REMOTING_HOST_SCREEN_RESOLUTION_H_ |
| +#define REMOTING_HOST_SCREEN_RESOLUTION_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "third_party/skia/include/core/SkPoint.h" |
| +#include "third_party/skia/include/core/SkSize.h" |
| + |
| +namespace remoting { |
| + |
| +// This structure describes the screen's dimensions and DPI. |
| +struct ScreenResolution { |
| + ScreenResolution(); |
| + |
| + // Initializes |this| assuming the efault DPI. |
| + explicit ScreenResolution(const SkISize& dimensions); |
| + |
| + // Returns the default DPI of (96, 96) if |dpi_| is (0, 0). Returns |dpi_| |
| + // otherwise. |
| + SkIPoint GetEffectiveDpi() const; |
| + |
| + // Returns the screen dimensions in logical pixels. I.e. returns |
| + // the dimensions of a screen of the same size displaying 96 pixels per inch. |
| + SkISize GetLogicalDimensions() const; |
| + |
| + // Returns true if either the screen size is empty or IsValid() returns false. |
| + bool IsNull() const; |
| + |
| + // Returns true if both |dimensions_| and |dpi_| are non-negative. |
| + bool IsValid() const; |
|
Jamie
2013/03/15 18:33:24
I think it's worth doing a careful audit (perhaps
alexeypa (please no reviews)
2013/03/15 20:30:41
We need both. We need to be able to check if the s
Jamie
2013/03/15 22:06:27
Fair enough; thanks for the clarification. However
alexeypa (please no reviews)
2013/03/15 22:32:12
Done.
|
| + |
| + // Dimensions of the screen in pixels. |
| + SkISize dimensions_; |
| + |
| + // The vertical and horizontal DPI of the screen. |
| + SkIPoint dpi_; |
| +}; |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_SCREEN_RESOLUTION_H_ |