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