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

Unified Diff: webkit/glue/plugins/pepper_plugin_module.cc

Issue 2233001: Chrome side of moving Pepper ReadImageData to the Testing interface.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | « webkit/glue/plugins/pepper_image_data.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/pepper_plugin_module.cc
===================================================================
--- webkit/glue/plugins/pepper_plugin_module.cc (revision 48284)
+++ webkit/glue/plugins/pepper_plugin_module.cc (working copy)
@@ -14,6 +14,7 @@
#include "third_party/ppapi/c/ppb_device_context_2d.h"
#include "third_party/ppapi/c/ppb_image_data.h"
#include "third_party/ppapi/c/ppb_instance.h"
+#include "third_party/ppapi/c/ppb_testing.h"
#include "third_party/ppapi/c/ppb_var.h"
#include "third_party/ppapi/c/ppp.h"
#include "third_party/ppapi/c/ppp_instance.h"
@@ -96,6 +97,22 @@
&CallOnMainThread
};
+// PPB_Testing -----------------------------------------------------------------
+
+bool ReadImageData(PP_Resource device_context_2d,
+ PP_Resource image,
+ int32_t x, int32_t y) {
+ scoped_refptr<DeviceContext2D> context(
+ ResourceTracker::Get()->GetAsDeviceContext2D(device_context_2d));
+ if (!context.get())
+ return false;
+ return context->ReadImageData(image, x, y);
+}
+
+const PPB_Testing testing_interface = {
+ &ReadImageData
+};
+
// GetInterface ----------------------------------------------------------------
const void* GetInterface(const char* name) {
@@ -109,6 +126,8 @@
return ImageData::GetInterface();
if (strcmp(name, PPB_DEVICECONTEXT2D_INTERFACE) == 0)
return DeviceContext2D::GetInterface();
+ if (strcmp(name, PPB_TESTING_INTERFACE) == 0)
+ return &testing_interface;
return NULL;
}
« no previous file with comments | « webkit/glue/plugins/pepper_image_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698