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

Side by Side Diff: ppapi/cpp/dev/view_dev.cc

Issue 10544168: Implement HiDPI support in Pepper dev interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comments to Graphics2DDev C++ header Created 8 years, 6 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 #include "ppapi/cpp/dev/view_dev.h"
6
7 #include "ppapi/c/dev/ppb_view_dev.h"
8 #include "ppapi/cpp/module_impl.h"
9
10 namespace pp {
11
12 namespace {
13
14 template <> const char* interface_name<PPB_View_Dev>() {
15 return PPB_VIEW_DEV_INTERFACE;
16 }
17
18 } // namespace
19
20 float ViewDev::GetDeviceScale() const {
21 if (has_interface<PPB_View_Dev>()) {
brettw 2012/06/19 18:28:21 It's not clear to me why this remaps error values.
Josh Horwich 2012/06/19 23:56:15 Done.
22 float out = get_interface<PPB_View_Dev>()->GetDeviceScale(pp_resource());
23 if (out > 0.0f)
24 return out;
25 }
26 return 1.0f;
27 }
28
29 float ViewDev::GetCSSScale() const {
30 if (has_interface<PPB_View_Dev>()) {
31 float out = get_interface<PPB_View_Dev>()->GetCSSScale(pp_resource());
32 if (out > 0.0f)
33 return out;
34 }
35 return 1.0f;
36 }
37
38 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698