| OLD | NEW | 
| (Empty) |  | 
 |   1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 
 |   2 // Use of this source code is governed by a BSD-style license that can be | 
 |   3 // found in the LICENSE file. | 
 |   4  | 
 |   5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_IMAGE_DATA_H_ | 
 |   6 #define WEBKIT_GLUE_PLUGINS_PEPPER_IMAGE_DATA_H_ | 
 |   7  | 
 |   8 #include "base/scoped_ptr.h" | 
 |   9 #include "third_party/ppapi/c/ppb_image_data.h" | 
 |  10 #include "webkit/glue/plugins/pepper_plugin_delegate.h" | 
 |  11 #include "webkit/glue/plugins/pepper_resource.h" | 
 |  12  | 
 |  13 typedef struct _ppb_ImageData PPB_ImageData; | 
 |  14  | 
 |  15 namespace skia { | 
 |  16 class PlatformCanvas; | 
 |  17 } | 
 |  18  | 
 |  19 class SkBitmap; | 
 |  20  | 
 |  21 namespace pepper { | 
 |  22  | 
 |  23 class PluginInstance; | 
 |  24  | 
 |  25 class ImageData : public Resource { | 
 |  26  public: | 
 |  27   ImageData(PluginModule* module); | 
 |  28   virtual ~ImageData(); | 
 |  29  | 
 |  30   // Returns a pointer to the interface implementing PPB_ImageData that is | 
 |  31   // exposed to the plugin. | 
 |  32   static const PPB_ImageData* GetInterface(); | 
 |  33  | 
 |  34   // Resource overrides. | 
 |  35   ImageData* AsImageData() { return this; } | 
 |  36  | 
 |  37   // PPB_ImageData implementation. | 
 |  38   bool Init(PP_ImageDataFormat format, | 
 |  39             int width, | 
 |  40             int height); | 
 |  41   void Describe(PP_ImageDataDesc* desc) const; | 
 |  42   void* Map(); | 
 |  43   void Unmap(); | 
 |  44  | 
 |  45   skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } | 
 |  46  | 
 |  47   const SkBitmap& GetMappedBitmap() const; | 
 |  48  | 
 |  49  private: | 
 |  50   scoped_ptr<PluginDelegate::PlatformImage2D> platform_image_; | 
 |  51  | 
 |  52   // When the device is mapped, this is the image. Null when umapped. | 
 |  53   scoped_ptr<skia::PlatformCanvas> mapped_canvas_; | 
 |  54  | 
 |  55   int width_; | 
 |  56   int height_; | 
 |  57 }; | 
 |  58  | 
 |  59 }  // namespace pepper | 
 |  60  | 
 |  61 #endif  // WEBKIT_GLUE_PLUGINS_PEPPER_IMAGE_DATA_H_ | 
| OLD | NEW |