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

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
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.h ('k') | ppapi/proxy/serialized_structs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/resource_creation_proxy.cc
===================================================================
--- ppapi/proxy/resource_creation_proxy.cc (revision 84713)
+++ ppapi/proxy/resource_creation_proxy.cc (working copy)
@@ -12,8 +12,10 @@
#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/font_impl.h"
#include "ppapi/shared_impl/function_group_base.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_image_data_api.h"
@@ -35,6 +37,20 @@
return this;
}
+PP_Resource ResourceCreationProxy::CreateFontObject(
+ PP_Instance instance,
+ const PP_FontDescription_Dev* description) {
+ if (!pp::shared_impl::FontImpl::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) {
@@ -127,10 +143,10 @@
result->SetHostResource(instance, resource);
// Get the description, it's just serialized as a string.
- ppapi::thunk::EnterResource<ppapi::thunk::PPB_ImageData_API>
- enter_resource(resource, false);
+ ppapi::thunk::EnterResource<ppapi::thunk::PPB_ImageData_API> enter_resource(
+ resource, false);
PP_ImageDataDesc desc;
- if (enter_resource.object()->Describe(&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));
}
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.h ('k') | ppapi/proxy/serialized_structs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698