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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ppapi/c/pp_bool.h" | 9 #include "ppapi/c/pp_bool.h" |
10 #include "ppapi/c/pp_completion_callback.h" | 10 #include "ppapi/c/pp_completion_callback.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 namespace skia { | 25 namespace skia { |
26 class PlatformCanvas; | 26 class PlatformCanvas; |
27 } | 27 } |
28 | 28 |
29 namespace ppapi { | 29 namespace ppapi { |
30 | 30 |
31 class HostResource; | 31 class HostResource; |
32 | 32 |
33 namespace proxy { | 33 namespace proxy { |
34 | 34 |
| 35 // The proxied image data resource. Unlike most resources, this needs to be |
| 36 // public in the header since a number of other resources need to access it. |
35 class ImageData : public ppapi::Resource, | 37 class ImageData : public ppapi::Resource, |
36 public ppapi::thunk::PPB_ImageData_API, | 38 public ppapi::thunk::PPB_ImageData_API, |
37 public ppapi::ImageDataImpl { | 39 public ppapi::ImageDataImpl { |
38 public: | 40 public: |
39 ImageData(const ppapi::HostResource& resource, | 41 ImageData(const ppapi::HostResource& resource, |
40 const PP_ImageDataDesc& desc, | 42 const PP_ImageDataDesc& desc, |
41 ImageHandle handle); | 43 ImageHandle handle); |
42 virtual ~ImageData(); | 44 virtual ~ImageData(); |
43 | 45 |
44 // Resource overrides. | 46 // Resource overrides. |
(...skipping 16 matching lines...) Expand all Loading... |
61 PP_ImageDataDesc desc_; | 63 PP_ImageDataDesc desc_; |
62 | 64 |
63 scoped_ptr<TransportDIB> transport_dib_; | 65 scoped_ptr<TransportDIB> transport_dib_; |
64 | 66 |
65 // Null when the image isn't mapped. | 67 // Null when the image isn't mapped. |
66 scoped_ptr<skia::PlatformCanvas> mapped_canvas_; | 68 scoped_ptr<skia::PlatformCanvas> mapped_canvas_; |
67 | 69 |
68 DISALLOW_COPY_AND_ASSIGN(ImageData); | 70 DISALLOW_COPY_AND_ASSIGN(ImageData); |
69 }; | 71 }; |
70 | 72 |
| 73 class PPB_ImageData_Proxy : public InterfaceProxy { |
| 74 public: |
| 75 PPB_ImageData_Proxy(Dispatcher* dispatcher); |
| 76 virtual ~PPB_ImageData_Proxy(); |
| 77 |
| 78 static PP_Resource CreateProxyResource(PP_Instance instance, |
| 79 PP_ImageDataFormat format, |
| 80 const PP_Size& size, |
| 81 PP_Bool init_to_zero); |
| 82 |
| 83 // InterfaceProxy implementation. |
| 84 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 85 |
| 86 static const ApiID kApiID = API_ID_PPB_IMAGE_DATA; |
| 87 |
| 88 private: |
| 89 // Message handler. |
| 90 void OnHostMsgCreate(PP_Instance instance, |
| 91 int32_t format, |
| 92 const PP_Size& size, |
| 93 PP_Bool init_to_zero, |
| 94 HostResource* result, |
| 95 std::string* image_data_desc, |
| 96 ImageHandle* result_image_handle); |
| 97 |
| 98 DISALLOW_COPY_AND_ASSIGN(PPB_ImageData_Proxy); |
| 99 }; |
| 100 |
71 } // namespace proxy | 101 } // namespace proxy |
72 } // namespace ppapi | 102 } // namespace ppapi |
73 | 103 |
74 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ | 104 #endif // PPAPI_PPB_IMAGE_DATA_PROXY_H_ |
OLD | NEW |