Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: ppapi/thunk/ppb_image_data_api.h

Issue 10790063: PPAPI/NaCl: Make ImageData for NaCl just use shared memory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make PPB_ImageData_API base non-exported Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_image_data_api.h
diff --git a/ppapi/thunk/ppb_image_data_api.h b/ppapi/thunk/ppb_image_data_api.h
index 3ddea427d27a6aa0c6bb8312c7cd9ced077e831e..3e46206a0c5fedfb831528f1c22d8da3f121a18d 100644
--- a/ppapi/thunk/ppb_image_data_api.h
+++ b/ppapi/thunk/ppb_image_data_api.h
@@ -12,6 +12,8 @@ namespace skia {
class PlatformCanvas;
}
+class SkCanvas;
+
namespace ppapi {
namespace thunk {
@@ -26,9 +28,24 @@ class PPB_ImageData_API {
// Trusted inteface.
virtual int32_t GetSharedMemory(int* handle, uint32_t* byte_count) = 0;
- // The canvas will be NULL if the image is not mapped and under Native
- // Client (which does not have skia).
+ // Get the platform-specific canvas that backs this ImageData, if there is
+ // one.
+ // The canvas will be NULL:
+ // * If the image is not mapped.
+ // * Within untrusted code (which does not have skia).
+ // * If the ImageData is not backed by a platform-specific image buffer.
+ // This will be the case for ImageDatas created for use in NaCl.
+ // For this last reason, you should prefer GetCanvas any time you don't need
+ // a platform-specific canvas (e.g., for use with platform-specific APIs).
+ // Anything that relies on having a PlatformCanvas will not work for ImageDat
+ // objects created from NaCl.
virtual skia::PlatformCanvas* GetPlatformCanvas() = 0;
+
+ // Get the canvas that backs this ImageData, if there is one.
+ // The canvas will be NULL:
+ // * If the image is not mapped.
+ // * Within untrusted code (which does not have skia).
+ virtual SkCanvas* GetCanvas() = 0;
};
} // namespace thunk
« no previous file with comments | « ppapi/proxy/resource_creation_proxy.cc ('k') | ppapi/thunk/resource_creation_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698