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

Unified Diff: ppapi/proxy/resource_creation_proxy.cc

Issue 6981001: Make the Pepper proxy support in-process font rendering. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/resource_creation_proxy.cc
===================================================================
--- ppapi/proxy/resource_creation_proxy.cc (revision 84549)
+++ ppapi/proxy/resource_creation_proxy.cc (working copy)
@@ -12,6 +12,7 @@
#include "ppapi/proxy/plugin_resource_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/ppb_graphics_2d_proxy.h"
+#include "ppapi/proxy/ppb_font_proxy.h"
#include "ppapi/proxy/ppb_image_data_proxy.h"
#include "ppapi/c/trusted/ppb_image_data_trusted.h"
#include "ppapi/shared_impl/function_group_base.h"
@@ -34,6 +35,20 @@
return this;
}
+PP_Resource ResourceCreationProxy::CreateFont(
+ PP_Instance instance,
+ const PP_FontDescription_Dev* description) {
+ if (!Font::IsPPFontDescriptionValid(*description))
+ return 0;
+
+ // See the comment above Font's constructor for why we do this.
+ HostResource resource;
+ resource.SetHostResource(instance, 0);
+
+ linked_ptr<Font> object(new Font(resource, *description));
+ return PluginResourceTracker::GetInstance()->AddResource(object);
+}
+
PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance pp_instance,
const PP_Size& size,
PP_Bool is_always_opaque) {
@@ -126,9 +141,10 @@
result->SetHostResource(instance, resource);
// Get the description, it's just serialized as a string.
- ppapi::thunk::EnterResource<PPB_ImageData> enter_resource(resource, false);
+ ppapi::thunk::EnterResource<ppapi::thunk::PPB_ImageData_API> enter_resource(
+ resource, false);
PP_ImageDataDesc desc;
- if (enter_resource.object()->Describe(resource, &desc)) {
+ if (enter_resource.object()->Describe(&desc) == PP_TRUE) {
image_data_desc->resize(sizeof(PP_ImageDataDesc));
memcpy(&(*image_data_desc)[0], &desc, sizeof(PP_ImageDataDesc));
}

Powered by Google App Engine
This is Rietveld 408576698