summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 22:31:44 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-07 22:31:44 +0000
commitd0e3b4abd1a6c1a3de008e267bd457e9e2ce95f3 (patch)
tree8249e5b0757af4c6ad5077941771591771f45a84 /ppapi
parent635b82774a9961b7e404674d2d08615397e7861f (diff)
downloadchromium_src-d0e3b4abd1a6c1a3de008e267bd457e9e2ce95f3.zip
chromium_src-d0e3b4abd1a6c1a3de008e267bd457e9e2ce95f3.tar.gz
chromium_src-d0e3b4abd1a6c1a3de008e267bd457e9e2ce95f3.tar.bz2
Use PP_BrowserFont_Trusted_Description
instead of PP_FontDescription_Dev for the FLash interface This changes the old interface without revving the version. This is because the new struct is exactly the same as the old one with a different name, so it will not break binary compat. BUG= Review URL: https://codereview.chromium.org/11475006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171865 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/api/private/ppb_flash.idl2
-rw-r--r--ppapi/c/private/ppb_flash.h96
-rw-r--r--ppapi/cpp/private/DEPS1
-rw-r--r--ppapi/cpp/private/flash.cc4
-rw-r--r--ppapi/cpp/private/flash.h4
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c16
-rw-r--r--ppapi/proxy/browser_font_resource_trusted.h2
-rw-r--r--ppapi/proxy/ppb_flash_proxy.cc31
-rw-r--r--ppapi/proxy/ppb_flash_proxy.h23
-rw-r--r--ppapi/proxy/serialized_structs.cc27
-rw-r--r--ppapi/proxy/serialized_structs.h10
-rw-r--r--ppapi/thunk/ppb_flash_api.h23
-rw-r--r--ppapi/thunk/ppb_flash_thunk.cc2
13 files changed, 141 insertions, 100 deletions
diff --git a/ppapi/api/private/ppb_flash.idl b/ppapi/api/private/ppb_flash.idl
index c84268b..692b864 100644
--- a/ppapi/api/private/ppb_flash.idl
+++ b/ppapi/api/private/ppb_flash.idl
@@ -123,7 +123,7 @@ interface PPB_Flash {
PP_Bool DrawGlyphs(
[in] PP_Instance instance,
[in] PP_Resource pp_image_data,
- [in] PP_FontDescription_Dev font_desc,
+ [in] PP_BrowserFont_Trusted_Description font_desc,
[in] uint32_t color,
[in] PP_Point position,
[in] PP_Rect clip,
diff --git a/ppapi/c/private/ppb_flash.h b/ppapi/c/private/ppb_flash.h
index 36645cc..8dc057b 100644
--- a/ppapi/c/private/ppb_flash.h
+++ b/ppapi/c/private/ppb_flash.h
@@ -3,12 +3,11 @@
* found in the LICENSE file.
*/
-/* From private/ppb_flash.idl modified Tue Nov 20 10:12:16 2012. */
+/* From private/ppb_flash.idl modified Thu Dec 06 12:27:21 2012. */
#ifndef PPAPI_C_PRIVATE_PPB_FLASH_H_
#define PPAPI_C_PRIVATE_PPB_FLASH_H_
-#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/c/pp_array_output.h"
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_instance.h"
@@ -21,6 +20,7 @@
#include "ppapi/c/pp_stdint.h"
#include "ppapi/c/pp_time.h"
#include "ppapi/c/pp_var.h"
+#include "ppapi/c/trusted/ppb_browser_font_trusted.h"
#define PPB_FLASH_INTERFACE_12_4 "PPB_Flash;12.4"
#define PPB_FLASH_INTERFACE_12_5 "PPB_Flash;12.5"
@@ -141,17 +141,18 @@ struct PPB_Flash_13_0 {
* system settings. For this to work properly, the graphics layer that the
* text is being drawn into must be opaque.
*/
- PP_Bool (*DrawGlyphs)(PP_Instance instance,
- PP_Resource pp_image_data,
- const struct PP_FontDescription_Dev* font_desc,
- uint32_t color,
- const struct PP_Point* position,
- const struct PP_Rect* clip,
- const float transformation[3][3],
- PP_Bool allow_subpixel_aa,
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const struct PP_Point glyph_advances[]);
+ PP_Bool (*DrawGlyphs)(
+ PP_Instance instance,
+ PP_Resource pp_image_data,
+ const struct PP_BrowserFont_Trusted_Description* font_desc,
+ uint32_t color,
+ const struct PP_Point* position,
+ const struct PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const struct PP_Point glyph_advances[]);
/**
* Retrieves the proxy that will be used for the given URL. The result will
* be a string in PAC format, or an undefined var on error.
@@ -227,17 +228,18 @@ typedef struct PPB_Flash_13_0 PPB_Flash;
struct PPB_Flash_12_4 {
void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
- PP_Bool (*DrawGlyphs)(PP_Instance instance,
- PP_Resource pp_image_data,
- const struct PP_FontDescription_Dev* font_desc,
- uint32_t color,
- const struct PP_Point* position,
- const struct PP_Rect* clip,
- const float transformation[3][3],
- PP_Bool allow_subpixel_aa,
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const struct PP_Point glyph_advances[]);
+ PP_Bool (*DrawGlyphs)(
+ PP_Instance instance,
+ PP_Resource pp_image_data,
+ const struct PP_BrowserFont_Trusted_Description* font_desc,
+ uint32_t color,
+ const struct PP_Point* position,
+ const struct PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const struct PP_Point glyph_advances[]);
struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
int32_t (*Navigate)(PP_Resource request_info,
const char* target,
@@ -257,17 +259,18 @@ struct PPB_Flash_12_4 {
struct PPB_Flash_12_5 {
void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
- PP_Bool (*DrawGlyphs)(PP_Instance instance,
- PP_Resource pp_image_data,
- const struct PP_FontDescription_Dev* font_desc,
- uint32_t color,
- const struct PP_Point* position,
- const struct PP_Rect* clip,
- const float transformation[3][3],
- PP_Bool allow_subpixel_aa,
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const struct PP_Point glyph_advances[]);
+ PP_Bool (*DrawGlyphs)(
+ PP_Instance instance,
+ PP_Resource pp_image_data,
+ const struct PP_BrowserFont_Trusted_Description* font_desc,
+ uint32_t color,
+ const struct PP_Point* position,
+ const struct PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const struct PP_Point glyph_advances[]);
struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
int32_t (*Navigate)(PP_Resource request_info,
const char* target,
@@ -290,17 +293,18 @@ struct PPB_Flash_12_5 {
struct PPB_Flash_12_6 {
void (*SetInstanceAlwaysOnTop)(PP_Instance instance, PP_Bool on_top);
- PP_Bool (*DrawGlyphs)(PP_Instance instance,
- PP_Resource pp_image_data,
- const struct PP_FontDescription_Dev* font_desc,
- uint32_t color,
- const struct PP_Point* position,
- const struct PP_Rect* clip,
- const float transformation[3][3],
- PP_Bool allow_subpixel_aa,
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const struct PP_Point glyph_advances[]);
+ PP_Bool (*DrawGlyphs)(
+ PP_Instance instance,
+ PP_Resource pp_image_data,
+ const struct PP_BrowserFont_Trusted_Description* font_desc,
+ uint32_t color,
+ const struct PP_Point* position,
+ const struct PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const struct PP_Point glyph_advances[]);
struct PP_Var (*GetProxyForURL)(PP_Instance instance, const char* url);
int32_t (*Navigate)(PP_Resource request_info,
const char* target,
diff --git a/ppapi/cpp/private/DEPS b/ppapi/cpp/private/DEPS
index f11fdd6..18adee2 100644
--- a/ppapi/cpp/private/DEPS
+++ b/ppapi/cpp/private/DEPS
@@ -1,3 +1,4 @@
include_rules = [
"+ppapi/c/private",
+ "+ppapi/cpp/trusted",
]
diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc
index bdf86f5..757dbec 100644
--- a/ppapi/cpp/private/flash.cc
+++ b/ppapi/cpp/private/flash.cc
@@ -9,7 +9,6 @@
#include "ppapi/c/pp_bool.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/cpp/dev/device_ref_dev.h"
-#include "ppapi/cpp/dev/font_dev.h"
#include "ppapi/cpp/dev/video_capture_dev.h"
#include "ppapi/cpp/image_data.h"
#include "ppapi/cpp/instance_handle.h"
@@ -17,6 +16,7 @@
#include "ppapi/cpp/module_impl.h"
#include "ppapi/cpp/point.h"
#include "ppapi/cpp/rect.h"
+#include "ppapi/cpp/trusted/browser_font_trusted.h"
#include "ppapi/cpp/url_request_info.h"
#include "ppapi/cpp/var.h"
#include "ppapi/c/private/ppb_flash.h"
@@ -100,7 +100,7 @@ void Flash::SetInstanceAlwaysOnTop(const InstanceHandle& instance,
// static
bool Flash::DrawGlyphs(const InstanceHandle& instance,
ImageData* image,
- const FontDescription_Dev& font_desc,
+ const BrowserFontDescription& font_desc,
uint32_t color,
const Point& position,
const Rect& clip,
diff --git a/ppapi/cpp/private/flash.h b/ppapi/cpp/private/flash.h
index 857c689..6a6b7c3 100644
--- a/ppapi/cpp/private/flash.h
+++ b/ppapi/cpp/private/flash.h
@@ -16,8 +16,8 @@ struct PP_Point;
namespace pp {
+class BrowserFontDescription;
class DeviceRef_Dev;
-class FontDescription_Dev;
class ImageData;
class InstanceHandle;
class Module;
@@ -38,7 +38,7 @@ class Flash {
bool on_top);
static bool DrawGlyphs(const InstanceHandle& instance,
ImageData* image,
- const FontDescription_Dev& font_desc,
+ const BrowserFontDescription& font_desc,
uint32_t color,
const Point& position,
const Rect& clip,
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
index a8ccce0..1209f47 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
@@ -2246,7 +2246,7 @@ void Pnacl_M21_PPB_Flash_SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on
}
static __attribute__((pnaclcall))
-PP_Bool Pnacl_M21_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
+PP_Bool Pnacl_M21_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
const struct PPB_Flash_12_4 *iface = Pnacl_WrapperInfo_PPB_Flash_12_4.real_iface;
return iface->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances);
}
@@ -2340,7 +2340,7 @@ void Pnacl_M22_PPB_Flash_SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on
}
static __attribute__((pnaclcall))
-PP_Bool Pnacl_M22_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
+PP_Bool Pnacl_M22_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
const struct PPB_Flash_12_5 *iface = Pnacl_WrapperInfo_PPB_Flash_12_5.real_iface;
return iface->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances);
}
@@ -2440,7 +2440,7 @@ void Pnacl_M24_0_PPB_Flash_SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool
}
static __attribute__((pnaclcall))
-PP_Bool Pnacl_M24_0_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
+PP_Bool Pnacl_M24_0_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
const struct PPB_Flash_12_6 *iface = Pnacl_WrapperInfo_PPB_Flash_12_6.real_iface;
return iface->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances);
}
@@ -2546,7 +2546,7 @@ void Pnacl_M24_1_PPB_Flash_SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool
}
static __attribute__((pnaclcall))
-PP_Bool Pnacl_M24_1_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
+PP_Bool Pnacl_M24_1_PPB_Flash_DrawGlyphs(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]) {
const struct PPB_Flash_13_0 *iface = Pnacl_WrapperInfo_PPB_Flash_13_0.real_iface;
return iface->DrawGlyphs(instance, pp_image_data, font_desc, color, position, clip, transformation, allow_subpixel_aa, glyph_count, glyph_indices, glyph_advances);
}
@@ -3965,7 +3965,7 @@ struct PPB_FileRefPrivate_0_1 Pnacl_Wrappers_PPB_FileRefPrivate_0_1 = {
struct PPB_Flash_12_4 Pnacl_Wrappers_PPB_Flash_12_4 = {
.SetInstanceAlwaysOnTop = (void (*)(PP_Instance instance, PP_Bool on_top))&Pnacl_M21_PPB_Flash_SetInstanceAlwaysOnTop,
- .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M21_PPB_Flash_DrawGlyphs,
+ .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M21_PPB_Flash_DrawGlyphs,
.GetProxyForURL = (struct PP_Var (*)(PP_Instance instance, const char* url))&Pnacl_M21_PPB_Flash_GetProxyForURL,
.Navigate = (int32_t (*)(PP_Resource request_info, const char* target, PP_Bool from_user_action))&Pnacl_M21_PPB_Flash_Navigate,
.RunMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M21_PPB_Flash_RunMessageLoop,
@@ -3983,7 +3983,7 @@ struct PPB_Flash_12_4 Pnacl_Wrappers_PPB_Flash_12_4 = {
struct PPB_Flash_12_5 Pnacl_Wrappers_PPB_Flash_12_5 = {
.SetInstanceAlwaysOnTop = (void (*)(PP_Instance instance, PP_Bool on_top))&Pnacl_M22_PPB_Flash_SetInstanceAlwaysOnTop,
- .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M22_PPB_Flash_DrawGlyphs,
+ .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M22_PPB_Flash_DrawGlyphs,
.GetProxyForURL = (struct PP_Var (*)(PP_Instance instance, const char* url))&Pnacl_M22_PPB_Flash_GetProxyForURL,
.Navigate = (int32_t (*)(PP_Resource request_info, const char* target, PP_Bool from_user_action))&Pnacl_M22_PPB_Flash_Navigate,
.RunMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M22_PPB_Flash_RunMessageLoop,
@@ -4002,7 +4002,7 @@ struct PPB_Flash_12_5 Pnacl_Wrappers_PPB_Flash_12_5 = {
struct PPB_Flash_12_6 Pnacl_Wrappers_PPB_Flash_12_6 = {
.SetInstanceAlwaysOnTop = (void (*)(PP_Instance instance, PP_Bool on_top))&Pnacl_M24_0_PPB_Flash_SetInstanceAlwaysOnTop,
- .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M24_0_PPB_Flash_DrawGlyphs,
+ .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M24_0_PPB_Flash_DrawGlyphs,
.GetProxyForURL = (struct PP_Var (*)(PP_Instance instance, const char* url))&Pnacl_M24_0_PPB_Flash_GetProxyForURL,
.Navigate = (int32_t (*)(PP_Resource request_info, const char* target, PP_Bool from_user_action))&Pnacl_M24_0_PPB_Flash_Navigate,
.RunMessageLoop = (void (*)(PP_Instance instance))&Pnacl_M24_0_PPB_Flash_RunMessageLoop,
@@ -4022,7 +4022,7 @@ struct PPB_Flash_12_6 Pnacl_Wrappers_PPB_Flash_12_6 = {
struct PPB_Flash_13_0 Pnacl_Wrappers_PPB_Flash_13_0 = {
.SetInstanceAlwaysOnTop = (void (*)(PP_Instance instance, PP_Bool on_top))&Pnacl_M24_1_PPB_Flash_SetInstanceAlwaysOnTop,
- .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_FontDescription_Dev* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M24_1_PPB_Flash_DrawGlyphs,
+ .DrawGlyphs = (PP_Bool (*)(PP_Instance instance, PP_Resource pp_image_data, const struct PP_BrowserFont_Trusted_Description* font_desc, uint32_t color, const struct PP_Point* position, const struct PP_Rect* clip, const float transformation[3][3], PP_Bool allow_subpixel_aa, uint32_t glyph_count, const uint16_t glyph_indices[], const struct PP_Point glyph_advances[]))&Pnacl_M24_1_PPB_Flash_DrawGlyphs,
.GetProxyForURL = (struct PP_Var (*)(PP_Instance instance, const char* url))&Pnacl_M24_1_PPB_Flash_GetProxyForURL,
.Navigate = (int32_t (*)(PP_Resource request_info, const char* target, PP_Bool from_user_action))&Pnacl_M24_1_PPB_Flash_Navigate,
.GetLocalTimeZoneOffset = (double (*)(PP_Instance instance, PP_Time t))&Pnacl_M24_1_PPB_Flash_GetLocalTimeZoneOffset,
diff --git a/ppapi/proxy/browser_font_resource_trusted.h b/ppapi/proxy/browser_font_resource_trusted.h
index 1dc1fa5..a3b9a70 100644
--- a/ppapi/proxy/browser_font_resource_trusted.h
+++ b/ppapi/proxy/browser_font_resource_trusted.h
@@ -46,7 +46,7 @@ class PPAPI_PROXY_EXPORT BrowserFontResource_Trusted
virtual ::ppapi::thunk::PPB_BrowserFont_Trusted_API*
AsPPB_BrowserFont_Trusted_API() OVERRIDE;
- // PPB_Font implementation.
+ // PPB_BrowserFont_Trusted_API implementation.
virtual PP_Bool Describe(PP_BrowserFont_Trusted_Description* description,
PP_BrowserFont_Trusted_Metrics* metrics) OVERRIDE;
virtual PP_Bool DrawTextAt(PP_Resource image_data,
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index 845244e..0507910 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -14,12 +14,12 @@
#include "base/message_loop.h"
#include "base/time.h"
#include "build/build_config.h"
-#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/c/dev/ppb_var_deprecated.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/private/ppb_flash.h"
#include "ppapi/c/private/ppb_flash_print.h"
+#include "ppapi/c/trusted/ppb_browser_font_trusted.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/pepper_file_messages.h"
#include "ppapi/proxy/plugin_dispatcher.h"
@@ -145,17 +145,18 @@ void PPB_Flash_Proxy::SetInstanceAlwaysOnTop(PP_Instance instance,
API_ID_PPB_FLASH, instance, on_top));
}
-PP_Bool PPB_Flash_Proxy::DrawGlyphs(PP_Instance instance,
- PP_Resource pp_image_data,
- const PP_FontDescription_Dev* font_desc,
- uint32_t color,
- const PP_Point* position,
- const PP_Rect* clip,
- const float transformation[3][3],
- PP_Bool allow_subpixel_aa,
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const PP_Point glyph_advances[]) {
+PP_Bool PPB_Flash_Proxy::DrawGlyphs(
+ PP_Instance instance,
+ PP_Resource pp_image_data,
+ const PP_BrowserFont_Trusted_Description* font_desc,
+ uint32_t color,
+ const PP_Point* position,
+ const PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const PP_Point glyph_advances[]) {
Resource* image_data =
PpapiGlobals::Get()->GetResourceTracker()->GetResource(pp_image_data);
if (!image_data)
@@ -167,7 +168,7 @@ PP_Bool PPB_Flash_Proxy::DrawGlyphs(PP_Instance instance,
PPBFlash_DrawGlyphs_Params params;
params.image_data = image_data->host_resource();
- params.font_desc.SetFromPPFontDescription(*font_desc);
+ params.font_desc.SetFromPPBrowserFontDescription(*font_desc);
params.color = color;
params.position = *position;
params.clip = *clip;
@@ -500,8 +501,8 @@ void PPB_Flash_Proxy::OnHostMsgDrawGlyphs(
params.glyph_indices.empty())
return;
- PP_FontDescription_Dev font_desc;
- params.font_desc.SetToPPFontDescription(&font_desc);
+ PP_BrowserFont_Trusted_Description font_desc;
+ params.font_desc.SetToPPBrowserFontDescription(&font_desc);
*result = enter.functions()->GetFlashAPI()->DrawGlyphs(
0, // Unused instance param.
diff --git a/ppapi/proxy/ppb_flash_proxy.h b/ppapi/proxy/ppb_flash_proxy.h
index 6043d2c..d9bea31 100644
--- a/ppapi/proxy/ppb_flash_proxy.h
+++ b/ppapi/proxy/ppb_flash_proxy.h
@@ -53,17 +53,18 @@ class PPB_Flash_Proxy : public InterfaceProxy, public PPB_Flash_Shared {
// PPB_Flash_API implementation.
virtual void SetInstanceAlwaysOnTop(PP_Instance instance,
PP_Bool on_top) OVERRIDE;
- virtual PP_Bool DrawGlyphs(PP_Instance instance,
- PP_Resource pp_image_data,
- const PP_FontDescription_Dev* font_desc,
- uint32_t color,
- const PP_Point* position,
- const PP_Rect* clip,
- const float transformation[3][3],
- PP_Bool allow_subpixel_aa,
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const PP_Point glyph_advances[]) OVERRIDE;
+ virtual PP_Bool DrawGlyphs(
+ PP_Instance instance,
+ PP_Resource pp_image_data,
+ const PP_BrowserFont_Trusted_Description* font_desc,
+ uint32_t color,
+ const PP_Point* position,
+ const PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const PP_Point glyph_advances[]) OVERRIDE;
virtual int32_t Navigate(PP_Instance instance,
PP_Resource request_info,
const char* target,
diff --git a/ppapi/proxy/serialized_structs.cc b/ppapi/proxy/serialized_structs.cc
index f83ae0b..2904f9b 100644
--- a/ppapi/proxy/serialized_structs.cc
+++ b/ppapi/proxy/serialized_structs.cc
@@ -12,6 +12,7 @@
#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/c/pp_file_info.h"
#include "ppapi/c/pp_rect.h"
+#include "ppapi/c/trusted/ppb_browser_font_trusted.h"
#include "ppapi/shared_impl/var.h"
#if defined(OS_NACL)
@@ -48,6 +49,20 @@ void SerializedFontDescription::SetFromPPFontDescription(
word_spacing = desc.word_spacing;
}
+void SerializedFontDescription::SetFromPPBrowserFontDescription(
+ const PP_BrowserFont_Trusted_Description& desc) {
+ StringVar* string_var = StringVar::FromPPVar(desc.face);
+ face = string_var ? string_var->value() : std::string();
+
+ family = desc.family;
+ size = desc.size;
+ weight = desc.weight;
+ italic = desc.italic;
+ small_caps = desc.small_caps;
+ letter_spacing = desc.letter_spacing;
+ word_spacing = desc.word_spacing;
+}
+
void SerializedFontDescription::SetToPPFontDescription(
PP_FontDescription_Dev* desc) const {
desc->face = StringVar::StringToPPVar(face);
@@ -60,6 +75,18 @@ void SerializedFontDescription::SetToPPFontDescription(
desc->word_spacing = word_spacing;
}
+void SerializedFontDescription::SetToPPBrowserFontDescription(
+ PP_BrowserFont_Trusted_Description* desc) const {
+ desc->face = StringVar::StringToPPVar(face);
+ desc->family = static_cast<PP_BrowserFont_Trusted_Family>(family);
+ desc->size = size;
+ desc->weight = static_cast<PP_BrowserFont_Trusted_Weight>(weight);
+ desc->italic = italic;
+ desc->small_caps = small_caps;
+ desc->letter_spacing = letter_spacing;
+ desc->word_spacing = word_spacing;
+}
+
PPBFlash_DrawGlyphs_Params::PPBFlash_DrawGlyphs_Params()
: instance(0),
font_desc(),
diff --git a/ppapi/proxy/serialized_structs.h b/ppapi/proxy/serialized_structs.h
index d27b52c..04d7f5d 100644
--- a/ppapi/proxy/serialized_structs.h
+++ b/ppapi/proxy/serialized_structs.h
@@ -21,12 +21,14 @@
class Pickle;
struct PP_FontDescription_Dev;
+struct PP_BrowserFont_Trusted_Description;
namespace ppapi {
namespace proxy {
-// PP_FontDescript_Dev has to be redefined with a string in place of the PP_Var
-// used for the face name.
+// PP_FontDescription_Dev/PP_BrowserFontDescription (same definition, different
+// names) has to be redefined with a string in place of the PP_Var used for the
+// face name.
struct PPAPI_PROXY_EXPORT SerializedFontDescription {
SerializedFontDescription();
~SerializedFontDescription();
@@ -36,10 +38,14 @@ struct PPAPI_PROXY_EXPORT SerializedFontDescription {
// The reference of |face| owned by the PP_FontDescription_Dev will be
// unchanged and the caller is responsible for freeing it.
void SetFromPPFontDescription(const PP_FontDescription_Dev& desc);
+ void SetFromPPBrowserFontDescription(
+ const PP_BrowserFont_Trusted_Description& desc);
// Converts to a PP_FontDescription_Dev. The face name will have one ref
// assigned to it. The caller is responsible for freeing it.
void SetToPPFontDescription(PP_FontDescription_Dev* desc) const;
+ void SetToPPBrowserFontDescription(
+ PP_BrowserFont_Trusted_Description* desc) const;
std::string face;
int32_t family;
diff --git a/ppapi/thunk/ppb_flash_api.h b/ppapi/thunk/ppb_flash_api.h
index fad0600..50a039d 100644
--- a/ppapi/thunk/ppb_flash_api.h
+++ b/ppapi/thunk/ppb_flash_api.h
@@ -29,17 +29,18 @@ class PPAPI_THUNK_EXPORT PPB_Flash_API {
// Flash.
virtual void SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on_top) = 0;
- virtual PP_Bool DrawGlyphs(PP_Instance instance,
- PP_Resource pp_image_data,
- const PP_FontDescription_Dev* font_desc,
- uint32_t color,
- const PP_Point* position,
- const PP_Rect* clip,
- const float transformation[3][3],
- PP_Bool allow_subpixel_aa,
- uint32_t glyph_count,
- const uint16_t glyph_indices[],
- const PP_Point glyph_advances[]) = 0;
+ virtual PP_Bool DrawGlyphs(
+ PP_Instance instance,
+ PP_Resource pp_image_data,
+ const PP_BrowserFont_Trusted_Description* font_desc,
+ uint32_t color,
+ const PP_Point* position,
+ const PP_Rect* clip,
+ const float transformation[3][3],
+ PP_Bool allow_subpixel_aa,
+ uint32_t glyph_count,
+ const uint16_t glyph_indices[],
+ const PP_Point glyph_advances[]) = 0;
// External function that takes a PPB_URLRequestInfo resource.
virtual int32_t Navigate(PP_Instance instance,
diff --git a/ppapi/thunk/ppb_flash_thunk.cc b/ppapi/thunk/ppb_flash_thunk.cc
index 19e0783..9aac0ac 100644
--- a/ppapi/thunk/ppb_flash_thunk.cc
+++ b/ppapi/thunk/ppb_flash_thunk.cc
@@ -30,7 +30,7 @@ void SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on_top) {
PP_Bool DrawGlyphs(PP_Instance instance,
PP_Resource pp_image_data,
- const PP_FontDescription_Dev* font_desc,
+ const PP_BrowserFont_Trusted_Description* font_desc,
uint32_t color,
const PP_Point* position,
const PP_Rect* clip,