Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: ui/gfx/compositor/dip_util.h

Issue 10221028: Move DIP translation from ui/aura to ui/compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove dip from gyp Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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
5 #ifndef UI_GFX_COMPOSITOR_DIP_UTIL_H_
6 #define UI_GFX_COMPOSITOR_DIP_UTIL_H_
7 #pragma once
8
9 #include "ui/gfx/compositor/compositor_export.h"
10
11 namespace gfx {
12 class Point;
13 class Size;
14 class Rect;
15 } // namespace gfx
16
17 namespace ui {
18 class Layer;
19
20 COMPOSITOR_EXPORT bool IsDIPEnabled();
21
22 COMPOSITOR_EXPORT float GetDeviceScaleFactor(const Layer* layer);
23
24 // Utility functions that convert point/size/rect between
25 // DIP and pixel coordinates system.
26 COMPOSITOR_EXPORT gfx::Point ConvertPointToDIP(
27 const Layer* layer,
28 const gfx::Point& point_in_pixel);
29 COMPOSITOR_EXPORT gfx::Size ConvertSizeToDIP(
30 const Layer* layer,
31 const gfx::Size& size_in_pixel);
32 COMPOSITOR_EXPORT gfx::Rect ConvertRectToDIP(
33 const Layer* layer,
34 const gfx::Rect& rect_in_pixel);
35 COMPOSITOR_EXPORT gfx::Point ConvertPointToPixel(
36 const Layer* layer,
37 const gfx::Point& point_in_dip);
38 COMPOSITOR_EXPORT gfx::Size ConvertSizeToPixel(
39 const Layer* layer,
40 const gfx::Size& size_in_dip);
41 COMPOSITOR_EXPORT gfx::Rect ConvertRectToPixel(
42 const Layer* layer,
43 const gfx::Rect& rect_in_dip);
44
45 } // namespace ui
46
47 #endif // UI_GFX_COMPOSITOR_DIP_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698