diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 03:06:51 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-09 03:06:51 +0000 |
commit | 3f5ca5c7f09aa0542d5e9bf9da76a4b1c408d1e0 (patch) | |
tree | b877715dc62601ad153e89a5315a34b197398533 /webkit/glue | |
parent | f9610ab5622cef8a8ac0d3ad421e0bd2d75a0d8f (diff) | |
download | chromium_src-3f5ca5c7f09aa0542d5e9bf9da76a4b1c408d1e0.zip chromium_src-3f5ca5c7f09aa0542d5e9bf9da76a4b1c408d1e0.tar.gz chromium_src-3f5ca5c7f09aa0542d5e9bf9da76a4b1c408d1e0.tar.bz2 |
Change the private image data shared memory handle code to return a native
memory handle and a size rather than the internal TransportDIB structure.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/4611001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65482 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/plugins/pepper_image_data.cc | 8 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_image_data.h | 2 | ||||
-rw-r--r-- | webkit/glue/plugins/pepper_plugin_delegate.h | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/webkit/glue/plugins/pepper_image_data.cc b/webkit/glue/plugins/pepper_image_data.cc index 702abee..92d4364 100644 --- a/webkit/glue/plugins/pepper_image_data.cc +++ b/webkit/glue/plugins/pepper_image_data.cc @@ -79,10 +79,10 @@ void Unmap(PP_Resource resource) { image_data->Unmap(); } -uint64_t GetNativeMemoryHandle2(PP_Resource resource) { +uint64_t GetNativeMemoryHandle2(PP_Resource resource, uint32_t* byte_count) { scoped_refptr<ImageData> image_data(Resource::GetAs<ImageData>(resource)); if (image_data) - return image_data->GetNativeMemoryHandle(); + return image_data->GetNativeMemoryHandle(byte_count); return 0; } @@ -189,8 +189,8 @@ void ImageData::Unmap() { // in the future to save some memory. } -uint64 ImageData::GetNativeMemoryHandle() const { - return platform_image_->GetSharedMemoryHandle(); +uint64 ImageData::GetNativeMemoryHandle(uint32* byte_count) const { + return platform_image_->GetSharedMemoryHandle(byte_count); } const SkBitmap* ImageData::GetMappedBitmap() const { diff --git a/webkit/glue/plugins/pepper_image_data.h b/webkit/glue/plugins/pepper_image_data.h index b657173..473d4aa 100644 --- a/webkit/glue/plugins/pepper_image_data.h +++ b/webkit/glue/plugins/pepper_image_data.h @@ -64,7 +64,7 @@ class ImageData : public Resource { void Unmap(); // PPB_ImageDataTrusted implementation. - uint64 GetNativeMemoryHandle() const; + uint64 GetNativeMemoryHandle(uint32* byte_count) const; // The mapped bitmap and canvas will be NULL if the image is not mapped. skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } diff --git a/webkit/glue/plugins/pepper_plugin_delegate.h b/webkit/glue/plugins/pepper_plugin_delegate.h index d2c67c7..5e6f9a2 100644 --- a/webkit/glue/plugins/pepper_plugin_delegate.h +++ b/webkit/glue/plugins/pepper_plugin_delegate.h @@ -78,9 +78,10 @@ class PluginDelegate { virtual skia::PlatformCanvas* Map() = 0; // Returns the platform-specific shared memory handle of the data backing - // this image. This is used by NativeClient to send the image to the - // out-of-process plugin. Returns 0 on failure. - virtual intptr_t GetSharedMemoryHandle() const = 0; + // this image. This is used by PPAPI proxying to send the image to the + // out-of-process plugin. On success, the size in bytes will be placed into + // |*bytes_count|. Returns 0 on failure. + virtual intptr_t GetSharedMemoryHandle(uint32* byte_count) const = 0; virtual TransportDIB* GetTransportDIB() const = 0; }; |