OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PPB_IMAGE_DATA_PROXY_H_ | 5 #ifndef PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 6 #define PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
11 #include "ppapi/c/pp_module.h" | 11 #include "ppapi/c/pp_module.h" |
12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "ppapi/c/pp_size.h" | 13 #include "ppapi/c/pp_size.h" |
14 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
15 #include "ppapi/proxy/interface_proxy.h" | 15 #include "ppapi/proxy/interface_proxy.h" |
16 #include "ppapi/proxy/plugin_resource.h" | 16 #include "ppapi/proxy/plugin_resource.h" |
17 #include "ppapi/proxy/serialized_structs.h" | 17 #include "ppapi/proxy/serialized_structs.h" |
18 #include "ppapi/shared_impl/image_data_impl.h" | 18 #include "ppapi/shared_impl/image_data_impl.h" |
19 #include "ppapi/thunk/ppb_image_data_api.h" | 19 #include "ppapi/thunk/ppb_image_data_api.h" |
20 | 20 |
21 struct PPB_ImageData; | 21 struct PPB_ImageData; |
| 22 class TransportDIB; |
| 23 |
| 24 namespace skia { |
| 25 class PlatformCanvas; |
| 26 } |
22 | 27 |
23 namespace pp { | 28 namespace pp { |
24 namespace proxy { | 29 namespace proxy { |
25 | 30 |
26 class HostResource; | 31 class HostResource; |
27 | 32 |
28 class PPB_ImageData_Proxy : public InterfaceProxy { | 33 class PPB_ImageData_Proxy : public InterfaceProxy { |
29 public: | 34 public: |
30 PPB_ImageData_Proxy(Dispatcher* dispatcher, const void* target_interface); | 35 PPB_ImageData_Proxy(Dispatcher* dispatcher, const void* target_interface); |
31 virtual ~PPB_ImageData_Proxy(); | 36 virtual ~PPB_ImageData_Proxy(); |
(...skipping 21 matching lines...) Expand all Loading... |
53 virtual ::ppapi::thunk::PPB_ImageData_API* AsImageData_API(); | 58 virtual ::ppapi::thunk::PPB_ImageData_API* AsImageData_API(); |
54 | 59 |
55 // Resource overrides. | 60 // Resource overrides. |
56 virtual ImageData* AsImageData(); | 61 virtual ImageData* AsImageData(); |
57 | 62 |
58 // PPB_ImageData API. | 63 // PPB_ImageData API. |
59 virtual PP_Bool Describe(PP_ImageDataDesc* desc); | 64 virtual PP_Bool Describe(PP_ImageDataDesc* desc); |
60 virtual void* Map(); | 65 virtual void* Map(); |
61 virtual void Unmap(); | 66 virtual void Unmap(); |
62 | 67 |
| 68 skia::PlatformCanvas* mapped_canvas() const { return mapped_canvas_.get(); } |
| 69 |
63 const PP_ImageDataDesc& desc() const { return desc_; } | 70 const PP_ImageDataDesc& desc() const { return desc_; } |
64 | 71 |
65 static const ImageHandle NullHandle; | 72 static const ImageHandle NullHandle; |
66 static ImageHandle HandleFromInt(int32_t i); | 73 static ImageHandle HandleFromInt(int32_t i); |
67 | 74 |
68 private: | 75 private: |
69 PP_ImageDataDesc desc_; | 76 PP_ImageDataDesc desc_; |
70 ImageHandle handle_; | |
71 | 77 |
72 void* mapped_data_; | 78 scoped_ptr<TransportDIB> transport_dib_; |
| 79 |
| 80 // Null when the image isn't mapped. |
| 81 scoped_ptr<skia::PlatformCanvas> mapped_canvas_; |
73 | 82 |
74 DISALLOW_COPY_AND_ASSIGN(ImageData); | 83 DISALLOW_COPY_AND_ASSIGN(ImageData); |
75 }; | 84 }; |
76 | 85 |
77 } // namespace proxy | 86 } // namespace proxy |
78 } // namespace pp | 87 } // namespace pp |
79 | 88 |
80 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 89 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
OLD | NEW |