| Index: webkit/plugins/ppapi/ppb_image_data_impl.h
|
| ===================================================================
|
| --- webkit/plugins/ppapi/ppb_image_data_impl.h (revision 0)
|
| +++ webkit/plugins/ppapi/ppb_image_data_impl.h (working copy)
|
| @@ -2,14 +2,14 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef WEBKIT_GLUE_PLUGINS_PEPPER_IMAGE_DATA_H_
|
| -#define WEBKIT_GLUE_PLUGINS_PEPPER_IMAGE_DATA_H_
|
| +#ifndef WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_
|
| +#define WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_
|
|
|
| #include "base/basictypes.h"
|
| #include "base/scoped_ptr.h"
|
| #include "ppapi/c/ppb_image_data.h"
|
| -#include "webkit/glue/plugins/pepper_plugin_delegate.h"
|
| -#include "webkit/glue/plugins/pepper_resource.h"
|
| +#include "webkit/plugins/ppapi/plugin_delegate.h"
|
| +#include "webkit/plugins/ppapi/resource.h"
|
|
|
| namespace skia {
|
| class PlatformCanvas;
|
| @@ -18,12 +18,14 @@
|
| struct PPB_ImageDataTrusted;
|
| class SkBitmap;
|
|
|
| -namespace pepper {
|
| +namespace webkit {
|
| +namespace plugins {
|
| +namespace ppapi {
|
|
|
| -class ImageData : public Resource {
|
| +class PPB_ImageData_Impl : public Resource {
|
| public:
|
| - explicit ImageData(PluginModule* module);
|
| - virtual ~ImageData();
|
| + explicit PPB_ImageData_Impl(PluginModule* module);
|
| + virtual ~PPB_ImageData_Impl();
|
|
|
| int width() const { return width_; }
|
| int height() const { return height_; }
|
| @@ -53,7 +55,7 @@
|
| static bool IsImageDataFormatSupported(PP_ImageDataFormat format);
|
|
|
| // Resource overrides.
|
| - virtual ImageData* AsImageData() { return this; }
|
| + virtual PPB_ImageData_Impl* AsImageData();
|
|
|
| // PPB_ImageData implementation.
|
| bool Init(PP_ImageDataFormat format,
|
| @@ -71,10 +73,10 @@
|
| const SkBitmap* GetMappedBitmap() const;
|
|
|
| // Swaps the guts of this image data with another.
|
| - void Swap(ImageData* other);
|
| + void Swap(PPB_ImageData_Impl* other);
|
|
|
| private:
|
| - // This will be NULL before initialization, and if this ImageData is
|
| + // This will be NULL before initialization, and if this PPB_ImageData_Impl is
|
| // swapped with another.
|
| scoped_ptr<PluginDelegate::PlatformImage2D> platform_image_;
|
|
|
| @@ -85,7 +87,7 @@
|
| int width_;
|
| int height_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(ImageData);
|
| + DISALLOW_COPY_AND_ASSIGN(PPB_ImageData_Impl);
|
| };
|
|
|
| // Manages mapping an image resource if necessary. Use this to ensure the
|
| @@ -100,7 +102,8 @@
|
| // image_data->mapped_canvas()->blah(); // Guaranteed valid.
|
| class ImageDataAutoMapper {
|
| public:
|
| - ImageDataAutoMapper(ImageData* image_data) : image_data_(image_data) {
|
| + ImageDataAutoMapper(PPB_ImageData_Impl* image_data)
|
| + : image_data_(image_data) {
|
| if (image_data_->is_mapped()) {
|
| is_valid_ = true;
|
| needs_unmap_ = false;
|
| @@ -119,13 +122,15 @@
|
| bool is_valid() const { return is_valid_; }
|
|
|
| private:
|
| - ImageData* image_data_;
|
| + PPB_ImageData_Impl* image_data_;
|
| bool is_valid_;
|
| bool needs_unmap_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper);
|
| };
|
|
|
| -} // namespace pepper
|
| +} // namespace ppapi
|
| +} // namespace plugins
|
| +} // namespace webkit
|
|
|
| -#endif // WEBKIT_GLUE_PLUGINS_PEPPER_IMAGE_DATA_H_
|
| +#endif // WEBKIT_PLUGINS_PPAPI_PPB_IMAGE_DATA_IMPL_H_
|
|
|