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 #include "ppapi/proxy/ppb_image_data_proxy.h" | 5 #include "ppapi/proxy/ppb_image_data_proxy.h" |
6 | 6 |
7 #include <string.h> // For memcpy | 7 #include <string.h> // For memcpy |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bitmap.lockPixels(); | 102 bitmap.lockPixels(); |
103 return bitmap.getAddr(0, 0); | 103 return bitmap.getAddr(0, 0); |
104 } | 104 } |
105 | 105 |
106 void ImageData::Unmap() { | 106 void ImageData::Unmap() { |
107 // TODO(brettw) have a way to unmap a TransportDIB. Currently this isn't | 107 // TODO(brettw) have a way to unmap a TransportDIB. Currently this isn't |
108 // possible since deleting the TransportDIB also frees all the handles. | 108 // possible since deleting the TransportDIB also frees all the handles. |
109 // We need to add a method to TransportDIB to release the handles. | 109 // We need to add a method to TransportDIB to release the handles. |
110 } | 110 } |
111 | 111 |
| 112 int32_t ImageData::GetSharedMemory(int* /* handle */, |
| 113 uint32_t* /* byte_count */) { |
| 114 // Not supported in the proxy (this method is for actually implementing the |
| 115 // proxy in the host). |
| 116 return PP_ERROR_NOACCESS; |
| 117 } |
| 118 |
112 #if defined(OS_WIN) | 119 #if defined(OS_WIN) |
113 const ImageHandle ImageData::NullHandle = NULL; | 120 const ImageHandle ImageData::NullHandle = NULL; |
114 #elif defined(OS_MACOSX) | 121 #elif defined(OS_MACOSX) |
115 const ImageHandle ImageData::NullHandle = ImageHandle(); | 122 const ImageHandle ImageData::NullHandle = ImageHandle(); |
116 #else | 123 #else |
117 const ImageHandle ImageData::NullHandle = 0; | 124 const ImageHandle ImageData::NullHandle = 0; |
118 #endif | 125 #endif |
119 | 126 |
120 ImageHandle ImageData::HandleFromInt(int32_t i) { | 127 ImageHandle ImageData::HandleFromInt(int32_t i) { |
121 #if defined(OS_WIN) | 128 #if defined(OS_WIN) |
122 return reinterpret_cast<ImageHandle>(i); | 129 return reinterpret_cast<ImageHandle>(i); |
123 #elif defined(OS_MACOSX) | 130 #elif defined(OS_MACOSX) |
124 return ImageHandle(i, false); | 131 return ImageHandle(i, false); |
125 #else | 132 #else |
126 return static_cast<ImageHandle>(i); | 133 return static_cast<ImageHandle>(i); |
127 #endif | 134 #endif |
128 } | 135 } |
129 | 136 |
130 } // namespace proxy | 137 } // namespace proxy |
131 } // namespace pp | 138 } // namespace pp |
OLD | NEW |