Advertisement
Guest User

Untitled

a guest
Dec 19th, 2011
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. typedef struct alloc_device_t {
  2. struct hw_device_t common;
  3.  
  4. /*
  5. * (*alloc)() Allocates a buffer in graphic memory with the requested
  6. * parameters and returns a buffer_handle_t and the stride in pixels to
  7. * allow the implementation to satisfy hardware constraints on the width
  8. * of a pixmap (eg: it may have to be multiple of 8 pixels).
  9. * The CALLER TAKES OWNERSHIP of the buffer_handle_t.
  10. *
  11. * Returns 0 on success or -errno on error.
  12. */
  13.  
  14. int (*alloc)(struct alloc_device_t* dev,
  15. int w, int h, int format, int usage,
  16. buffer_handle_t* handle, int* stride,
  17. unsigned int* text, ogl_alloc_t ogl_alloc,
  18. ogl_free_t ogl_free);
  19.  
  20. /*
  21. * (*free)() Frees a previously allocated buffer.
  22. * Behavior is undefined if the buffer is still mapped in any process,
  23. * but shall not result in termination of the program or security breaches
  24. * (allowing a process to get access to another process' buffers).
  25. * THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes
  26. * invalid after the call.
  27. *
  28. * Returns 0 on success or -errno on error.
  29. */
  30. int (*free)(struct alloc_device_t* dev,
  31. buffer_handle_t handle);
  32.  
  33.  
  34. void (*flush)(struct alloc_device_t* dev);
  35.  
  36. } alloc_device_t;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement