| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PPAPI_PROXY_IMAGE_DATA_H_ | 5 #ifndef PPAPI_PROXY_IMAGE_DATA_H_ |
| 6 #define PPAPI_PROXY_IMAGE_DATA_H_ | 6 #define PPAPI_PROXY_IMAGE_DATA_H_ |
| 7 | 7 |
| 8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
| 9 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/ppb_image_data.h" | 10 #include "ppapi/c/ppb_image_data.h" |
| 10 #include "ppapi/proxy/plugin_resource.h" | 11 #include "ppapi/proxy/plugin_resource.h" |
| 11 #include "ppapi/proxy/serialized_structs.h" | 12 #include "ppapi/proxy/serialized_structs.h" |
| 13 #include "ppapi/shared_impl/image_data_impl.h" |
| 12 | 14 |
| 13 namespace pp { | 15 namespace pp { |
| 14 namespace proxy { | 16 namespace proxy { |
| 15 | 17 |
| 16 class ImageData : public PluginResource { | 18 class ImageData : public PluginResource, |
| 19 public pp::shared_impl::ImageDataImpl { |
| 17 public: | 20 public: |
| 18 ImageData(const PP_ImageDataDesc& desc, ImageHandle handle); | 21 ImageData(PP_Instance instance, |
| 22 const PP_ImageDataDesc& desc, |
| 23 ImageHandle handle); |
| 19 virtual ~ImageData(); | 24 virtual ~ImageData(); |
| 20 | 25 |
| 21 // Resource overrides. | 26 // Resource overrides. |
| 22 virtual ImageData* AsImageData(); | 27 virtual ImageData* AsImageData(); |
| 23 | 28 |
| 24 void* Map(); | 29 void* Map(); |
| 25 void Unmap(); | 30 void Unmap(); |
| 26 | 31 |
| 27 const PP_ImageDataDesc& desc() const { return desc_; } | 32 const PP_ImageDataDesc& desc() const { return desc_; } |
| 28 | 33 |
| 29 static const ImageHandle NullHandle; | 34 static const ImageHandle NullHandle; |
| 30 static ImageHandle HandleFromInt(int32_t i); | 35 static ImageHandle HandleFromInt(int32_t i); |
| 31 | 36 |
| 32 private: | 37 private: |
| 33 PP_ImageDataDesc desc_; | 38 PP_ImageDataDesc desc_; |
| 34 ImageHandle handle_; | 39 ImageHandle handle_; |
| 35 | 40 |
| 36 void* mapped_data_; | 41 void* mapped_data_; |
| 37 | 42 |
| 38 DISALLOW_COPY_AND_ASSIGN(ImageData); | 43 DISALLOW_COPY_AND_ASSIGN(ImageData); |
| 39 }; | 44 }; |
| 40 | 45 |
| 41 } // namespace proxy | 46 } // namespace proxy |
| 42 } // namespace pp | 47 } // namespace pp |
| 43 | 48 |
| 44 #endif // PPAPI_PROXY_IMAGE_DATA_H_ | 49 #endif // PPAPI_PROXY_IMAGE_DATA_H_ |
| OLD | NEW |