| 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" |
| 11 #include "ppapi/c/ppb_image_data.h" | 11 #include "ppapi/c/ppb_image_data.h" |
| 12 | 12 #include "skia/ext/cdl_common.h" |
| 13 class SkCanvas; | |
| 14 | 13 |
| 15 namespace base { | 14 namespace base { |
| 16 class SharedMemory; | 15 class SharedMemory; |
| 17 } // namespace base | 16 } // namespace base |
| 18 | 17 |
| 19 namespace ppapi { | 18 namespace ppapi { |
| 20 namespace thunk { | 19 namespace thunk { |
| 21 | 20 |
| 22 class PPB_ImageData_API { | 21 class PPB_ImageData_API { |
| 23 public: | 22 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 // one. | 34 // one. |
| 36 // The canvas will be NULL: | 35 // The canvas will be NULL: |
| 37 // * If the image is not mapped. | 36 // * If the image is not mapped. |
| 38 // * Within untrusted code (which does not have skia). | 37 // * Within untrusted code (which does not have skia). |
| 39 // * If the ImageData is not backed by a platform-specific image buffer. | 38 // * 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. | 39 // 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 | 40 // 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). | 41 // 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 | 42 // Anything that relies on having a PlatformCanvas will not work for ImageDat |
| 44 // objects created from NaCl. | 43 // objects created from NaCl. |
| 45 virtual SkCanvas* GetPlatformCanvas() = 0; | 44 virtual CdlCanvas* GetPlatformCanvas() = 0; |
| 46 | 45 |
| 47 // Get the canvas that backs this ImageData, if there is one. | 46 // Get the canvas that backs this ImageData, if there is one. |
| 48 // The canvas will be NULL: | 47 // The canvas will be NULL: |
| 49 // * If the image is not mapped. | 48 // * If the image is not mapped. |
| 50 // * Within untrusted code (which does not have skia). | 49 // * Within untrusted code (which does not have skia). |
| 51 virtual SkCanvas* GetCanvas() = 0; | 50 virtual CdlCanvas* GetCanvas() = 0; |
| 52 | 51 |
| 53 // Signal that this image is a good candidate for reuse. Call this from APIs | 52 // 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 | 53 // that receive ImageData resources of a fixed size and where the plugin will |
| 55 // release its reference to the ImageData. If the current implementation | 54 // release its reference to the ImageData. If the current implementation |
| 56 // supports image data reuse (only supported out-of-process) then the | 55 // supports image data reuse (only supported out-of-process) then the |
| 57 // ImageData will be marked and potentially cached for re-use. | 56 // ImageData will be marked and potentially cached for re-use. |
| 58 virtual void SetIsCandidateForReuse() = 0; | 57 virtual void SetIsCandidateForReuse() = 0; |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 } // namespace thunk | 60 } // namespace thunk |
| 62 } // namespace ppapi | 61 } // namespace ppapi |
| 63 | 62 |
| 64 #endif // PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ | 63 #endif // PPAPI_THUNK_PPB_IMAGE_DATA_API_H_ |
| OLD | NEW |