• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 PPAPI_CPP_DEV_VIEW_DEV_H_
6 #define PPAPI_CPP_DEV_VIEW_DEV_H_
7 
8 #include "ppapi/cpp/view.h"
9 
10 namespace pp {
11 
12 // ViewDev is a version of View that exposes under-development APIs related to
13 // HiDPI
14 class ViewDev : public View {
15  public:
ViewDev()16   ViewDev() : View() {}
ViewDev(const View & other)17   ViewDev(const View& other) : View(other) {}
18 
~ViewDev()19   virtual ~ViewDev() {}
20 
21   /// GetDeviceScale returns the scale factor between device pixels and DIPs
22   /// (also known as logical pixels or UI pixels on some platforms). This allows
23   /// the developer to render their contents at device resolution, even as
24   /// coordinates / sizes are given in DIPs through the API.
25   ///
26   /// Note that the coordinate system for Pepper APIs is DIPs. Also note that
27   /// one DIP might not equal one CSS pixel - when page scale/zoom is in effect.
28   ///
29   /// @return A <code>float</code> value representing the number of device
30   /// pixels per DIP.
31   float GetDeviceScale() const;
32 
33   /// GetCSSScale returns the scale factor between DIPs and CSS pixels. This
34   /// allows proper scaling between DIPs - as sent via the Pepper API - and CSS
35   /// pixel coordinates used for Web content.
36   ///
37   /// @return A <code>float</code> value representing the number of DIPs per CSS
38   /// pixel.
39   float GetCSSScale() const;
40 };
41 
42 }  // namespace pp
43 
44 #endif  // PPAPI_CPP_DEV_VIEW_DEV_H_
45