| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "ppapi/c/pp_bool.h" | 10 #include "ppapi/c/pp_bool.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 virtual ~PPB_ImageData_API() {} | 24 virtual ~PPB_ImageData_API() {} |
| 25 | 25 |
| 26 virtual PP_Bool Describe(PP_ImageDataDesc* desc) = 0; | 26 virtual PP_Bool Describe(PP_ImageDataDesc* desc) = 0; |
| 27 virtual void* Map() = 0; | 27 virtual void* Map() = 0; |
| 28 virtual void Unmap() = 0; | 28 virtual void Unmap() = 0; |
| 29 | 29 |
| 30 // Trusted inteface. | 30 // Trusted inteface. |
| 31 virtual int32_t GetSharedMemory(base::SharedMemory** shm, | 31 virtual int32_t GetSharedMemory(base::SharedMemory** shm, |
| 32 uint32_t* byte_count) = 0; | 32 uint32_t* byte_count) = 0; |
| 33 | 33 |
| 34 // Get the platform-specific canvas that backs this ImageData, if there is | |
| 35 // one. | |
| 36 // The canvas will be NULL: | |
| 37 // * If the image is not mapped. | |
| 38 // * Within untrusted code (which does not have skia). | |
| 39 // * If the ImageData is not backed by a platform-specific image buffer. | |
| 40 // This will be the case for ImageDatas created for use in NaCl. | |
| 41 // For this last reason, you should prefer GetCanvas any time you don't need | |
| 42 // a platform-specific canvas (e.g., for use with platform-specific APIs). | |
| 43 // Anything that relies on having a PlatformCanvas will not work for ImageDat | |
| 44 // objects created from NaCl. | |
| 45 virtual SkCanvas* GetPlatformCanvas() = 0; | |
| 46 | |
| 47 // Get the canvas that backs this ImageData, if there is one. | 34 // Get the canvas that backs this ImageData, if there is one. |
| 48 // The canvas will be NULL: | 35 // The canvas will be NULL: |
| 49 // * If the image is not mapped. | 36 // * If the image is not mapped. |
| 50 // * Within untrusted code (which does not have skia). | 37 // * Within untrusted code (which does not have skia). |
| 51 virtual SkCanvas* GetCanvas() = 0; | 38 virtual SkCanvas* GetCanvas() = 0; |
| 52 | 39 |
| 53 // Signal that this image is a good candidate for reuse. Call this from APIs | 40 // Signal that this image is a good candidate for reuse. Call this from APIs |
| 54 // that receive ImageData resources of a fixed size and where the plugin will | 41 // that receive ImageData resources of a fixed size and where the plugin will |
| 55 // release its reference to the ImageData. If the current implementation | 42 // release its reference to the ImageData. If the current implementation |
| 56 // supports image data reuse (only supported out-of-process) then the | 43 // supports image data reuse (only supported out-of-process) then the |
| 57 // ImageData will be marked and potentially cached for re-use. | 44 // ImageData will be marked and potentially cached for re-use. |
| 58 virtual void SetIsCandidateForReuse() = 0; | 45 virtual void SetIsCandidateForReuse() = 0; |
| 59 }; | 46 }; |
| 60 | 47 |
| 61 } // namespace thunk | 48 } // namespace thunk |
| 62 } // namespace ppapi | 49 } // namespace ppapi |
| 63 | 50 |
| 64 #endif // PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ | 51 #endif // PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ |
| OLD | NEW |