Commit dfb32745 authored by dmichael's avatar dmichael Committed by Commit bot

Revert of Remove unused PPB_View_Dev (patchset #3 of https://codereview.chromium.org/498123002/)

Reason for revert:
I should've checked sooner; this is apparently still used by Flash. (See go/UMA, histograms, Pepper.InterfaceUsed)

Original issue's description:
> Remove unused PPB_View_Dev
>
> TBR=binji@chromium.org
>
> Committed: https://chromium.googlesource.com/chromium/src/+/2210d5fb49cd4b75972f2e304b29637c050de4f1

TBR=binji@chromium.org,raymes@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/512703003

Cr-Commit-Position: refs/heads/master@{#292152}
parent c72c70da
......@@ -27,6 +27,7 @@
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/c/dev/ppb_video_capture_dev.h"
#include "ppapi/c/dev/ppb_video_decoder_dev.h"
#include "ppapi/c/dev/ppb_view_dev.h"
#include "ppapi/c/dev/ppb_widget_dev.h"
#include "ppapi/c/dev/ppb_zoom_dev.h"
#include "ppapi/c/ppb_audio.h"
......
......@@ -49,6 +49,7 @@
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/c/dev/ppb_video_capture_dev.h"
#include "ppapi/c/dev/ppb_video_decoder_dev.h"
#include "ppapi/c/dev/ppb_view_dev.h"
#include "ppapi/c/dev/ppb_widget_dev.h"
#include "ppapi/c/dev/ppb_zoom_dev.h"
#include "ppapi/c/pp_module.h"
......
......@@ -105,6 +105,7 @@
'ppb_trace_event_dev.h',
'ppb_truetype_font_dev.h',
'ppb_var_deprecated.h',
'ppb_view_dev.h',
'ppb_zoom_dev.h',
'pp_cursor_type_dev.h',
'ppp_class_deprecated.h',
......
......@@ -71,6 +71,8 @@
'scriptable_object_deprecated.cc',
'selection_dev.cc',
'truetype_font_dev.cc',
'view_dev.cc',
'zoom_dev.cc',
# ppapi/utility/graphics
'paint_aggregator.cc',
......@@ -158,6 +160,7 @@
'truetype_font_dev.h',
'video_capture_client_dev.h',
'video_decoder_client_dev.h',
'view_dev.h',
'widget_client_dev.h',
'zoom_dev.h',
],
......
......@@ -331,6 +331,7 @@ component("ppapi_shared") {
"thunk/ppb_video_source_private_api.h",
"thunk/ppb_video_source_private_thunk.cc",
"thunk/ppb_view_api.h",
"thunk/ppb_view_dev_thunk.cc",
"thunk/ppb_view_thunk.cc",
"thunk/ppb_websocket_api.h",
"thunk/ppb_websocket_thunk.cc",
......
/* Copyright (c) 2012 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.
*/
/* This file contains the <code>PPB_View_Dev</code> interface. */
[generate_thunk]
label Chrome {
M22 = 0.1
};
/* PPB_View_Dev interface */
interface PPB_View_Dev {
/**
* GetDeviceScale returns the scale factor between device pixels and DIPs
* (also known as logical pixels or UI pixels on some platforms). This allows
* the developer to render their contents at device resolution, even as
* coordinates / sizes are given in DIPs through the API.
*
* Note that the coordinate system for Pepper APIs is DIPs. Also note that
* one DIP might not equal one CSS pixel - when page scale/zoom is in effect.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_View</code> resource.
*
* @return A <code>float</code> value representing the number of device pixels
* per DIP. If the resource is invalid, the value will be 0.0.
*/
float_t GetDeviceScale([in] PP_Resource resource);
/**
* GetCSSScale returns the scale factor between DIPs and CSS pixels. This
* allows proper scaling between DIPs - as sent via the Pepper API - and CSS
* pixel coordinates used for Web content.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_View</code> resource.
*
* @return css_scale A <code>float</code> value representing the number of
* DIPs per CSS pixel. If the resource is invalid, the value will be 0.0.
*/
float_t GetCSSScale([in] PP_Resource resource);
};
/* Copyright (c) 2012 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.
*/
/* From dev/ppb_view_dev.idl modified Mon Jun 18 14:55:58 2012. */
#ifndef PPAPI_C_DEV_PPB_VIEW_DEV_H_
#define PPAPI_C_DEV_PPB_VIEW_DEV_H_
#include "ppapi/c/pp_macros.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_stdint.h"
#define PPB_VIEW_DEV_INTERFACE_0_1 "PPB_View(Dev);0.1"
#define PPB_VIEW_DEV_INTERFACE PPB_VIEW_DEV_INTERFACE_0_1
/**
* @file
* This file contains the <code>PPB_View_Dev</code> interface. */
/**
* @addtogroup Interfaces
* @{
*/
/* PPB_View_Dev interface */
struct PPB_View_Dev_0_1 {
/**
* GetDeviceScale returns the scale factor between device pixels and DIPs
* (also known as logical pixels or UI pixels on some platforms). This allows
* the developer to render their contents at device resolution, even as
* coordinates / sizes are given in DIPs through the API.
*
* Note that the coordinate system for Pepper APIs is DIPs. Also note that
* one DIP might not equal one CSS pixel - when page scale/zoom is in effect.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_View</code> resource.
*
* @return A <code>float</code> value representing the number of device pixels
* per DIP. If the resource is invalid, the value will be 0.0.
*/
float (*GetDeviceScale)(PP_Resource resource);
/**
* GetCSSScale returns the scale factor between DIPs and CSS pixels. This
* allows proper scaling between DIPs - as sent via the Pepper API - and CSS
* pixel coordinates used for Web content.
*
* @param[in] resource A <code>PP_Resource</code> corresponding to a
* <code>PPB_View</code> resource.
*
* @return css_scale A <code>float</code> value representing the number of
* DIPs per CSS pixel. If the resource is invalid, the value will be 0.0.
*/
float (*GetCSSScale)(PP_Resource resource);
};
typedef struct PPB_View_Dev_0_1 PPB_View_Dev;
/**
* @}
*/
#endif /* PPAPI_C_DEV_PPB_VIEW_DEV_H_ */
// Copyright (c) 2012 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.
#include "ppapi/cpp/dev/view_dev.h"
#include "ppapi/c/dev/ppb_view_dev.h"
#include "ppapi/cpp/module_impl.h"
namespace pp {
namespace {
template <> const char* interface_name<PPB_View_Dev>() {
return PPB_VIEW_DEV_INTERFACE;
}
} // namespace
float ViewDev::GetDeviceScale() const {
if (!has_interface<PPB_View_Dev>())
return 1.0f;
return get_interface<PPB_View_Dev>()->GetDeviceScale(pp_resource());
}
float ViewDev::GetCSSScale() const {
if (!has_interface<PPB_View_Dev>())
return 1.0f;
return get_interface<PPB_View_Dev>()->GetCSSScale(pp_resource());
}
} // namespace pp
// Copyright (c) 2012 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 PPAPI_CPP_DEV_VIEW_DEV_H_
#define PPAPI_CPP_DEV_VIEW_DEV_H_
#include "ppapi/cpp/view.h"
namespace pp {
// ViewDev is a version of View that exposes under-development APIs related to
// HiDPI
class ViewDev : public View {
public:
ViewDev() : View() {}
ViewDev(const View& other) : View(other) {}
virtual ~ViewDev() {}
/// GetDeviceScale returns the scale factor between device pixels and DIPs
/// (also known as logical pixels or UI pixels on some platforms). This allows
/// the developer to render their contents at device resolution, even as
/// coordinates / sizes are given in DIPs through the API.
///
/// Note that the coordinate system for Pepper APIs is DIPs. Also note that
/// one DIP might not equal one CSS pixel - when page scale/zoom is in effect.
///
/// @return A <code>float</code> value representing the number of device
/// pixels per DIP.
float GetDeviceScale() const;
/// GetCSSScale returns the scale factor between DIPs and CSS pixels. This
/// allows proper scaling between DIPs - as sent via the Pepper API - and CSS
/// pixel coordinates used for Web content.
///
/// @return A <code>float</code> value representing the number of DIPs per CSS
/// pixel.
float GetCSSScale() const;
};
} // namespace pp
#endif // PPAPI_CPP_DEV_VIEW_DEV_H_
......@@ -2668,6 +2668,8 @@ static void Pnacl_M14_PPB_VideoDecoder_Dev_Destroy(PP_Resource video_decoder) {
/* End wrapper methods for PPB_VideoDecoder_Dev_0_16 */
/* Not generating wrapper methods for PPB_View_Dev_0_1 */
/* Not generating wrapper methods for PPB_Widget_Dev_0_3 */
/* Not generating wrapper methods for PPB_Widget_Dev_0_4 */
......@@ -5165,6 +5167,8 @@ static const struct PPB_VideoDecoder_Dev_0_16 Pnacl_Wrappers_PPB_VideoDecoder_De
.Destroy = (void (*)(PP_Resource video_decoder))&Pnacl_M14_PPB_VideoDecoder_Dev_Destroy
};
/* Not generating wrapper interface for PPB_View_Dev_0_1 */
/* Not generating wrapper interface for PPB_Widget_Dev_0_3 */
/* Not generating wrapper interface for PPB_Widget_Dev_0_4 */
......
......@@ -285,6 +285,7 @@
'thunk/ppb_video_source_private_api.h',
'thunk/ppb_video_source_private_thunk.cc',
'thunk/ppb_view_api.h',
'thunk/ppb_view_dev_thunk.cc',
'thunk/ppb_view_thunk.cc',
'thunk/ppb_websocket_api.h',
'thunk/ppb_websocket_thunk.cc',
......
......@@ -290,6 +290,8 @@
'cpp/dev/video_decoder_client_dev.h',
'cpp/dev/video_decoder_dev.cc',
'cpp/dev/video_decoder_dev.h',
'cpp/dev/view_dev.cc',
'cpp/dev/view_dev.h',
'cpp/dev/widget_client_dev.cc',
'cpp/dev/widget_client_dev.h',
'cpp/dev/widget_dev.cc',
......
......@@ -26,6 +26,7 @@
#include "ppapi/c/dev/ppb_url_util_dev.h"
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/c/dev/ppb_video_capture_dev.h"
#include "ppapi/c/dev/ppb_view_dev.h"
#include "ppapi/c/dev/ppb_widget_dev.h"
#include "ppapi/c/dev/ppb_zoom_dev.h"
#include "ppapi/c/ppb_audio.h"
......
......@@ -28,6 +28,7 @@
#include "ppapi/c/dev/ppb_url_util_dev.h"
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/c/dev/ppb_video_decoder_dev.h"
#include "ppapi/c/dev/ppb_view_dev.h"
#include "ppapi/c/dev/ppb_widget_dev.h"
#include "ppapi/c/dev/ppb_zoom_dev.h"
#include "ppapi/c/dev/ppp_class_deprecated.h"
......
......@@ -28,6 +28,7 @@
#include "ppapi/cpp/dev/text_input_dev.h"
#include "ppapi/cpp/dev/url_util_dev.h"
#include "ppapi/cpp/dev/video_decoder_dev.h"
#include "ppapi/cpp/dev/view_dev.h"
#include "ppapi/cpp/dev/widget_client_dev.h"
#include "ppapi/cpp/dev/widget_dev.h"
#include "ppapi/cpp/dev/zoom_dev.h"
......
......@@ -18,6 +18,8 @@ PROXIED_IFACE(PPB_MEMORY_DEV_INTERFACE_0_1, PPB_Memory_Dev_0_1)
PROXIED_IFACE(PPB_PRINTING_DEV_INTERFACE_0_7, PPB_Printing_Dev_0_7)
PROXIED_IFACE(PPB_TEXTINPUT_DEV_INTERFACE_0_2, PPB_TextInput_Dev_0_2)
PROXIED_IFACE(PPB_TRUETYPEFONT_DEV_INTERFACE_0_1, PPB_TrueTypeFont_Dev_0_1)
PROXIED_IFACE(PPB_VIEW_DEV_INTERFACE_0_1, PPB_View_Dev_0_1)
PROXIED_IFACE(PPB_ZOOM_DEV_INTERFACE_0_2, PPB_Zoom_Dev_0_2)
#if !defined(OS_NACL)
PROXIED_API(PPB_Buffer)
......
// Copyright (c) 2012 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.
// From dev/ppb_view_dev.idl modified Tue Aug 20 08:13:36 2013.
#include "ppapi/c/dev/ppb_view_dev.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
#include "ppapi/thunk/ppb_view_api.h"
namespace ppapi {
namespace thunk {
namespace {
float GetDeviceScale(PP_Resource resource) {
VLOG(4) << "PPB_View_Dev::GetDeviceScale()";
EnterResource<PPB_View_API> enter(resource, true);
if (enter.failed())
return 0.0f;
return enter.object()->GetDeviceScale();
}
float GetCSSScale(PP_Resource resource) {
VLOG(4) << "PPB_View_Dev::GetCSSScale()";
EnterResource<PPB_View_API> enter(resource, true);
if (enter.failed())
return 0.0f;
return enter.object()->GetCSSScale();
}
const PPB_View_Dev_0_1 g_ppb_view_dev_thunk_0_1 = {
&GetDeviceScale,
&GetCSSScale
};
} // namespace
PPAPI_THUNK_EXPORT const PPB_View_Dev_0_1* GetPPB_View_Dev_0_1_Thunk() {
return &g_ppb_view_dev_thunk_0_1;
}
} // namespace thunk
} // namespace ppapi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment