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

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: revert change i made by accident 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 #include "base/basictypes.h"
11
12 namespace gfx {
13 class Point;
14 class Size;
15 class Rect;
16 } // namespace gfx
17
18 namespace ui {
19 namespace test {
20
21 class COMPOSITOR_EXPORT ScopedDIPEnablerForTest {
sky 2012/05/08 00:41:59 Add a description. Also, if this is only for testi
oshima 2012/05/08 01:24:16 This is necessary only for m20 (because I wanted t
22 public:
23 ScopedDIPEnablerForTest();
24 ~ScopedDIPEnablerForTest();
25
26 private:
27 DISALLOW_COPY_AND_ASSIGN(ScopedDIPEnablerForTest);
28 };
29
30 } // namespace test
31
32 class Layer;
33
34 // True if DIP is enabled.
35 COMPOSITOR_EXPORT bool IsDIPEnabled();
36
37 COMPOSITOR_EXPORT float GetDeviceScaleFactor(const Layer* layer);
38
39 // Utility functions that convert point/size/rect between
40 // DIP and pixel coordinates system.
41 COMPOSITOR_EXPORT gfx::Point ConvertPointToDIP(
42 const Layer* layer,
43 const gfx::Point& point_in_pixel);
44 COMPOSITOR_EXPORT gfx::Size ConvertSizeToDIP(
45 const Layer* layer,
46 const gfx::Size& size_in_pixel);
47 COMPOSITOR_EXPORT gfx::Rect ConvertRectToDIP(
48 const Layer* layer,
49 const gfx::Rect& rect_in_pixel);
50 COMPOSITOR_EXPORT gfx::Point ConvertPointToPixel(
51 const Layer* layer,
52 const gfx::Point& point_in_dip);
53 COMPOSITOR_EXPORT gfx::Size ConvertSizeToPixel(
54 const Layer* layer,
55 const gfx::Size& size_in_dip);
56 COMPOSITOR_EXPORT gfx::Rect ConvertRectToPixel(
57 const Layer* layer,
58 const gfx::Rect& rect_in_dip);
59
60 } // namespace ui
61
62 #endif // UI_GFX_COMPOSITOR_DIP_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698