summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins/pepper_image_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/plugins/pepper_image_data.h')
-rw-r--r--webkit/glue/plugins/pepper_image_data.h16
1 files changed, 11 insertions, 5 deletions
diff --git a/webkit/glue/plugins/pepper_image_data.h b/webkit/glue/plugins/pepper_image_data.h
index f2a110b..f8c713a 100644
--- a/webkit/glue/plugins/pepper_image_data.h
+++ b/webkit/glue/plugins/pepper_image_data.h
@@ -28,11 +28,8 @@ class ImageData : public Resource {
int width() const { return width_; }
int height() const { return height_; }
- // Returns the image format. Currently there is only one format so this
- // always returns the same thing. But if you care about the formation, you
- // should probably check this so when we support multiple formats, we can't
- // forget to update your code.
- PP_ImageDataFormat format() const { return PP_IMAGEDATAFORMAT_BGRA_PREMUL; }
+ // Returns the image format.
+ PP_ImageDataFormat format() const { return format_; }
// Returns true if this image is mapped. False means that the image is either
// invalid or not mapped. See ImageDataAutoMapper below.
@@ -47,6 +44,14 @@ class ImageData : public Resource {
static const PPB_ImageData* GetInterface();
static const PPB_ImageDataTrusted* GetTrustedInterface();
+ // Returns the image data format used by the browser. If the plugin uses the
+ // same format, there is no conversion. Otherwise the browser will be in
+ // charge of converting from a supported format to its native format.
+ static PP_ImageDataFormat GetNativeImageDataFormat();
+
+ // Returns true if the format is supported by the browser.
+ static bool IsImageDataFormatSupported(PP_ImageDataFormat format);
+
// Resource overrides.
virtual ImageData* AsImageData() { return this; }
@@ -76,6 +81,7 @@ class ImageData : public Resource {
// When the device is mapped, this is the image. Null when umapped.
scoped_ptr<skia::PlatformCanvas> mapped_canvas_;
+ PP_ImageDataFormat format_;
int width_;
int height_;