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