diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-26 18:14:07 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-26 18:14:07 +0000 |
commit | 8368e7cae1312e6247a794556e275d4954a809ba (patch) | |
tree | a5334382920ee5f591012f8e5099ebc3f0768e07 /webkit/glue | |
parent | 7db9134198e1404ad174f8451b8b6e9c9c76beaa (diff) | |
download | chromium_src-8368e7cae1312e6247a794556e275d4954a809ba.zip chromium_src-8368e7cae1312e6247a794556e275d4954a809ba.tar.gz chromium_src-8368e7cae1312e6247a794556e275d4954a809ba.tar.bz2 |
Chrome side of moving Pepper ReadImageData to the Testing interface.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/2233001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48293 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/plugins/pepper_device_context_2d.cc | 13 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_image_data.cc | 8 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_module.cc | 19 |
3 files changed, 20 insertions, 20 deletions
diff --git a/webkit/glue/plugins/pepper_device_context_2d.cc b/webkit/glue/plugins/pepper_device_context_2d.cc index cf7f63e..4a4b374 100644 --- a/webkit/glue/plugins/pepper_device_context_2d.cc +++ b/webkit/glue/plugins/pepper_device_context_2d.cc @@ -118,24 +118,13 @@ bool Flush(PP_Resource device_context, return context->Flush(callback, callback_data); } -bool ReadImageData(PP_Resource device_context, - PP_Resource image, - int32_t x, int32_t y) { - scoped_refptr<DeviceContext2D> context( - ResourceTracker::Get()->GetAsDeviceContext2D(device_context)); - if (!context.get()) - return false; - return context->ReadImageData(image, x, y); -} - const PPB_DeviceContext2D ppb_devicecontext2d = { &Create, &Describe, &PaintImageData, &Scroll, &ReplaceContents, - &Flush, - &ReadImageData + &Flush }; } // namespace diff --git a/webkit/glue/plugins/pepper_image_data.cc b/webkit/glue/plugins/pepper_image_data.cc index 4eeff25..783f0a1 100644 --- a/webkit/glue/plugins/pepper_image_data.cc +++ b/webkit/glue/plugins/pepper_image_data.cc @@ -22,14 +22,6 @@ namespace pepper { namespace { -ImageData* ResourceAsImageData(PP_Resource resource) { - scoped_refptr<Resource> image_resource = - ResourceTracker::Get()->GetResource(resource); - if (!image_resource.get()) - return NULL; - return image_resource->AsImageData(); -} - PP_ImageDataFormat GetNativeImageDataFormat() { return PP_IMAGEDATAFORMAT_BGRA_PREMUL; } diff --git a/webkit/glue/plugins/pepper_plugin_module.cc b/webkit/glue/plugins/pepper_plugin_module.cc index 261f2e5..543e6c1 100644 --- a/webkit/glue/plugins/pepper_plugin_module.cc +++ b/webkit/glue/plugins/pepper_plugin_module.cc @@ -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 @@ const PPB_Core core_interface = { &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 @@ const void* GetInterface(const char* name) { 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; } |