| Index: ppapi/proxy/ppb_flash_proxy.cc
|
| ===================================================================
|
| --- ppapi/proxy/ppb_flash_proxy.cc (revision 72517)
|
| +++ ppapi/proxy/ppb_flash_proxy.cc (working copy)
|
| @@ -12,6 +12,7 @@
|
| #include "ppapi/c/pp_errors.h"
|
| #include "ppapi/c/pp_resource.h"
|
| #include "ppapi/c/private/ppb_flash.h"
|
| +#include "ppapi/proxy/image_data.h"
|
| #include "ppapi/proxy/plugin_dispatcher.h"
|
| #include "ppapi/proxy/plugin_resource.h"
|
| #include "ppapi/proxy/ppapi_messages.h"
|
| @@ -67,13 +68,21 @@
|
| uint32_t glyph_count,
|
| const uint16_t glyph_indices[],
|
| const PP_Point glyph_advances[]) {
|
| - PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
|
| + ImageData* image_data = PluginResource::GetAs<ImageData>(pp_image_data);
|
| + if (!image_data)
|
| + return PP_FALSE;
|
| + // The instance parameter isn't strictly necessary but we check that it
|
| + // matches anyway.
|
| + if (image_data->instance() != instance)
|
| + return PP_FALSE;
|
| +
|
| + PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(
|
| + image_data->instance());
|
| if (!dispatcher)
|
| return PP_FALSE;
|
|
|
| PPBFlash_DrawGlyphs_Params params;
|
| - params.instance = instance,
|
| - params.pp_image_data = pp_image_data;
|
| + params.image_data = image_data->host_resource();
|
| params.font_desc.SetFromPPFontDescription(dispatcher, *font_desc, true);
|
| params.color = color;
|
| params.position = position;
|
| @@ -305,8 +314,9 @@
|
| return;
|
|
|
| *result = ppb_flash_target()->DrawGlyphs(
|
| - params.instance, params.pp_image_data, &font_desc, params.color,
|
| - params.position, params.clip,
|
| + 0, // Unused instance param.
|
| + params.image_data.host_resource(), &font_desc,
|
| + params.color, params.position, params.clip,
|
| const_cast<float(*)[3]>(params.transformation),
|
| static_cast<uint32_t>(params.glyph_indices.size()),
|
| const_cast<uint16_t*>(¶ms.glyph_indices[0]),
|
|
|