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/pp_instance.h" |
10 #include "ppapi/c/ppb_image_data.h" | 10 #include "ppapi/c/ppb_image_data.h" |
11 #include "ppapi/proxy/plugin_resource.h" | 11 #include "ppapi/proxy/plugin_resource.h" |
12 #include "ppapi/proxy/serialized_structs.h" | 12 #include "ppapi/proxy/serialized_structs.h" |
13 #include "ppapi/shared_impl/image_data_impl.h" | 13 #include "ppapi/shared_impl/image_data_impl.h" |
14 | 14 |
15 namespace pp { | 15 namespace pp { |
16 namespace proxy { | 16 namespace proxy { |
17 | 17 |
18 class ImageData : public PluginResource, | 18 class ImageData : public PluginResource, |
19 public pp::shared_impl::ImageDataImpl { | 19 public pp::shared_impl::ImageDataImpl { |
20 public: | 20 public: |
21 ImageData(PP_Instance instance, | 21 ImageData(PP_Instance instance, |
22 SerializedResource resource, | |
viettrungluu
2011/01/27 16:52:58
This sort of use makes me think that SerializedRes
| |
22 const PP_ImageDataDesc& desc, | 23 const PP_ImageDataDesc& desc, |
23 ImageHandle handle); | 24 ImageHandle handle); |
24 virtual ~ImageData(); | 25 virtual ~ImageData(); |
25 | 26 |
26 // Resource overrides. | 27 // Resource overrides. |
27 virtual ImageData* AsImageData(); | 28 virtual ImageData* AsImageData(); |
28 | 29 |
29 void* Map(); | 30 void* Map(); |
30 void Unmap(); | 31 void Unmap(); |
31 | 32 |
32 const PP_ImageDataDesc& desc() const { return desc_; } | 33 const PP_ImageDataDesc& desc() const { return desc_; } |
33 | 34 |
34 static const ImageHandle NullHandle; | 35 static const ImageHandle NullHandle; |
35 static ImageHandle HandleFromInt(int32_t i); | 36 static ImageHandle HandleFromInt(int32_t i); |
36 | 37 |
37 private: | 38 private: |
38 PP_ImageDataDesc desc_; | 39 PP_ImageDataDesc desc_; |
39 ImageHandle handle_; | 40 ImageHandle handle_; |
40 | 41 |
41 void* mapped_data_; | 42 void* mapped_data_; |
42 | 43 |
43 DISALLOW_COPY_AND_ASSIGN(ImageData); | 44 DISALLOW_COPY_AND_ASSIGN(ImageData); |
44 }; | 45 }; |
45 | 46 |
46 } // namespace proxy | 47 } // namespace proxy |
47 } // namespace pp | 48 } // namespace pp |
48 | 49 |
49 #endif // PPAPI_PROXY_IMAGE_DATA_H_ | 50 #endif // PPAPI_PROXY_IMAGE_DATA_H_ |
OLD | NEW |