OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_THUNK_PPB_IMAGE_DATA_API_H_ | 5 #ifndef PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ |
6 #define PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ | 6 #define PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ |
7 | 7 |
8 #include "base/memory/shared_memory.h" | |
9 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
10 #include "ppapi/c/ppb_image_data.h" | 9 #include "ppapi/c/ppb_image_data.h" |
11 | 10 |
12 class SkCanvas; | 11 class SkCanvas; |
13 | 12 |
| 13 namespace base { |
| 14 class SharedMemory; |
| 15 } // namespace base |
| 16 |
14 namespace ppapi { | 17 namespace ppapi { |
15 namespace thunk { | 18 namespace thunk { |
16 | 19 |
17 class PPB_ImageData_API { | 20 class PPB_ImageData_API { |
18 public: | 21 public: |
19 virtual ~PPB_ImageData_API() {} | 22 virtual ~PPB_ImageData_API() {} |
20 | 23 |
21 virtual PP_Bool Describe(PP_ImageDataDesc* desc) = 0; | 24 virtual PP_Bool Describe(PP_ImageDataDesc* desc) = 0; |
22 virtual void* Map() = 0; | 25 virtual void* Map() = 0; |
23 virtual void Unmap() = 0; | 26 virtual void Unmap() = 0; |
24 | 27 |
25 // Trusted inteface. | 28 // Trusted inteface. |
26 virtual int32_t GetSharedMemory(base::SharedMemoryHandle* handle, | 29 virtual int32_t GetSharedMemory(base::SharedMemory** shm, |
27 uint32_t* byte_count) = 0; | 30 uint32_t* byte_count) = 0; |
28 | 31 |
29 // Get the platform-specific canvas that backs this ImageData, if there is | 32 // Get the platform-specific canvas that backs this ImageData, if there is |
30 // one. | 33 // one. |
31 // The canvas will be NULL: | 34 // The canvas will be NULL: |
32 // * If the image is not mapped. | 35 // * If the image is not mapped. |
33 // * Within untrusted code (which does not have skia). | 36 // * Within untrusted code (which does not have skia). |
34 // * If the ImageData is not backed by a platform-specific image buffer. | 37 // * If the ImageData is not backed by a platform-specific image buffer. |
35 // This will be the case for ImageDatas created for use in NaCl. | 38 // This will be the case for ImageDatas created for use in NaCl. |
36 // For this last reason, you should prefer GetCanvas any time you don't need | 39 // For this last reason, you should prefer GetCanvas any time you don't need |
(...skipping 13 matching lines...) Expand all Loading... |
50 // release its reference to the ImageData. If the current implementation | 53 // release its reference to the ImageData. If the current implementation |
51 // supports image data reuse (only supported out-of-process) then the | 54 // supports image data reuse (only supported out-of-process) then the |
52 // ImageData will be marked and potentially cached for re-use. | 55 // ImageData will be marked and potentially cached for re-use. |
53 virtual void SetIsCandidateForReuse() = 0; | 56 virtual void SetIsCandidateForReuse() = 0; |
54 }; | 57 }; |
55 | 58 |
56 } // namespace thunk | 59 } // namespace thunk |
57 } // namespace ppapi | 60 } // namespace ppapi |
58 | 61 |
59 #endif // PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ | 62 #endif // PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ |
OLD | NEW |