diff options
author | jhorwich@chromium.org <jhorwich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 15:39:22 +0000 |
---|---|---|
committer | jhorwich@chromium.org <jhorwich@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-09 15:39:22 +0000 |
commit | f381e90d6f112bc395d7cf743cfa199737041541 (patch) | |
tree | 42507ef60f9021cee0f13971acdb54829434715c /ppapi/examples/scaling/scaling.html | |
parent | e20b88d661f2468003a38cbdaebb0ea3ef63474d (diff) | |
download | chromium_src-f381e90d6f112bc395d7cf743cfa199737041541.zip chromium_src-f381e90d6f112bc395d7cf743cfa199737041541.tar.gz chromium_src-f381e90d6f112bc395d7cf743cfa199737041541.tar.bz2 |
Move HiDPI-related Pepper interfaces to stable
This adds the APIs provided in PPB_View_Dev_0_1 and PP_Graphics2D_Dev_0_1 to
the public Pepper APIs for PPB_View and PPB_Graphics2D.
Includes:
- Change to IDL and generated C headers/shim
- Change to PPAPI to export the 1_1 interfaces
- C++ glue
- Example PPAPI plugin for using HiDPI Pepper APIs
BUG=144071
TEST=Existing (prebuilt) PDF plugin using 1.0 interfaces still works
Review URL: https://codereview.chromium.org/12989006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193110 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/examples/scaling/scaling.html')
-rw-r--r-- | ppapi/examples/scaling/scaling.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ppapi/examples/scaling/scaling.html b/ppapi/examples/scaling/scaling.html new file mode 100644 index 0000000..983cbd6 --- /dev/null +++ b/ppapi/examples/scaling/scaling.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<html> + <!-- + Copyright (c) 2013 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. + --> +<head> + <title>Pepper 2D Scaling Example</title> + <script> + + function HandleMessage(message_event) { + if (message_event.data) { + console.log(message_event.data); + } + } + + function AddListener() { + var plugin = document.getElementById("plugin"); + plugin.addEventListener("message", HandleMessage, false); + } + document.addEventListener("DOMContentLoaded", AddListener, false); + </script> +</head> + +<body> + <script> + function SendString(str) { + var plugin = document.getElementById("plugin"); + plugin.postMessage(str); + } + </script> + + <button onclick="SendString('dip')">DIP Res</button> + <button onclick="SendString('device')">Device Res</button> + <button onclick="SendString('metrics')">Metrics</button> + <hr> + <object id="plugin" type="application/x-ppapi-example-2d-scaling" width="200" height="200" border="2px"></object><br> +Blue lines are one pixel thin, at either DIP or device resolution.<br> +Green circle is 25 DIPs in radius.<br> +Red circle is 50 CSS pixels in radius.<br> +Mouse clicks in the plugin will generate a message in the JS console.<br> + <hr> +</body> |