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