Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 Name | |
| 2 | |
| 3 CHROMIUM_map_image | |
| 4 | |
| 5 Name Strings | |
| 6 | |
| 7 GL_CHROMIUM_map_image | |
| 8 | |
| 9 Version | |
| 10 | |
| 11 Last Modifed Date: May 9, 2013 | |
| 12 | |
| 13 Dependencies | |
| 14 | |
| 15 OpenGL ES 2.0 is required. | |
| 16 | |
| 17 Overview | |
| 18 | |
| 19 This extension allows for more efficiently uploading of buffer or texture | |
|
no sievers
2013/05/10 01:21:51
nit: more efficient uploading.
buffer data too? D
kaanb
2013/05/13 23:00:36
Done.
| |
| 20 data through Chromium's OpenGL ES 2.0 implementation. | |
| 21 | |
| 22 For security reasons Chromium accesses the GPU from a separate process. User | |
| 23 processes are not allowed to access the GPU directly. This multi-process | |
| 24 architechure has the advantage that GPU operations can be secured and | |
| 25 pipelined but it has the disadvantage that all data that is going to be | |
| 26 passed to GPU must first be made available to the separate GPU process. | |
| 27 | |
| 28 Chromium's OpenGL ES 2.0 implementation hides this issue when using the | |
| 29 standard OpenGL functions BufferData, BufferSubData, TexImage2D, and | |
| 30 TexSubImage2D by first copying the user's data to shared memory and then | |
| 31 telling the GPU process to use that shared memory to upload the data. | |
|
no sievers
2013/05/10 01:21:51
nit: I'm not sure if I'd detour so much here.
An
kaanb
2013/05/13 23:00:36
Done.
| |
| 32 | |
| 33 This extension helps avoid that extra copy from user memory to shared memory | |
| 34 in a safe and secure manner by allowing the application to directly allocate | |
| 35 and access GPU memory. After allocating the memory the client of this | |
| 36 interface can map the GPU buffer into the user memory and modify the pixels. | |
| 37 | |
| 38 Issues | |
| 39 | |
| 40 The initial use of this extension was designed for the single process | |
| 41 mode of Chromium where OpenGL ES 2.0 and GPU implementations share the | |
| 42 same process. Some additions may be required to support the case where | |
| 43 OpenGL ES 2.0 and GPU implementations live in different processes. | |
|
no sievers
2013/05/10 01:21:51
nit: Maybe also leave this out. Where the extensio
kaanb
2013/05/13 23:00:36
Done.
| |
| 44 | |
| 45 New Tokens | |
| 46 | |
| 47 None | |
| 48 | |
| 49 New Procedures and Functions | |
| 50 | |
| 51 GLuint CreateImageCHROMIUM (GLsizei width, GLsizei height) | |
|
greggman
2013/05/10 00:12:22
no format? How do you know the format of the image
kaanb
2013/05/13 23:00:36
Done.
| |
| 52 | |
| 53 Allocates GPU memory with width equal to <width> and height equal | |
|
no sievers
2013/05/10 01:21:51
nit: 'allocates an image'?
kaanb
2013/05/13 23:00:36
Done.
| |
| 54 to <height>. | |
| 55 | |
| 56 Returns a unique identifier for the allocated buffer that could be used | |
|
no sievers
2013/05/10 01:21:51
nit: 'for the allocated image'
kaanb
2013/05/13 23:00:36
Done.
| |
| 57 in subsequent operations. | |
| 58 | |
| 59 INVALID_VALUE is generated if <width> or <height> is nonpositive. | |
| 60 | |
| 61 void DestroyImageCHROMIUM (GLuint image_id) | |
| 62 | |
| 63 Frees GPU memory previously allocated by a call to CreateImageCHROMIUM. | |
|
no sievers
2013/05/10 01:21:51
nit: 'Free the image'
kaanb
2013/05/13 23:00:36
Done.
| |
| 64 | |
| 65 INVALID_OPERATION is generated if <image_id> is not a valid image id. | |
| 66 | |
| 67 void* MapImageCHROMIUM (GLuint image_id, GLenum access) | |
| 68 | |
| 69 Returns a pointer to in the user memory for the application to access | |
|
no sievers
2013/05/10 01:21:51
nit: I find that sentence a bit hard to read :)
kaanb
2013/05/13 23:00:36
Done.
| |
| 70 the image in an access mode specified by <access>. | |
| 71 | |
| 72 INVALID_OPERATION is generated if <image_id> is not a valid image id. | |
| 73 | |
| 74 INVALID_OPERATION is generated if the image was already mapped by a previous | |
| 75 call to this method. | |
| 76 | |
| 77 INVALID_ENUM is generated if <access> is not WRITE_ONLY and not READ_ONLY. | |
|
no sievers
2013/05/10 01:21:51
What about READ_WRITE?
kaanb
2013/05/13 23:00:36
Done.
| |
| 78 | |
| 79 GLboolean UnmapImageCHROMIUM (GLuint image_id) | |
| 80 | |
| 81 Makes the changes made to the image after calling MapImageCHROMIUM | |
| 82 permanent. Returns true iff the operation was successful. | |
|
greggman
2013/05/10 00:12:22
s/iff/if/
no sievers
2013/05/10 01:21:51
Hmm, does it really make anything permanent? There
kaanb
2013/05/13 23:00:36
Done.
kaanb
2013/05/13 23:00:36
Done.
| |
| 83 | |
| 84 Note that after calling UnmapImageCHROMIUM the application should assume | |
| 85 that the memory returned by MapImageCHROMIUM is off limits and is no longer | |
| 86 accessible by the application. Accessing it after calling | |
| 87 UnmapImageCHROMIUM will produce undefined results. | |
| 88 | |
| 89 INVALID_OPERATION is generated if <image_id> is not a valid image id. | |
| 90 | |
| 91 INVALID_OPERATION is generated if the image was not already mapped by a | |
| 92 previous call to MapImageCHROMIUM. | |
| 93 | |
| 94 void GetImageParameterivCHROMIUM(GLuint image_id, GLenum pname, | |
| 95 GLint* params) | |
| 96 | |
| 97 Sets <params> to the integer value of the parameter specified by <pname> | |
| 98 for the image specified by <image_id>. <params> is expected to be | |
| 99 suitably initialized before calling this method. | |
|
no sievers
2013/05/10 01:21:51
nit: suitably initialized? maybe you are trying to
kaanb
2013/05/13 23:00:36
Done.
| |
| 100 | |
| 101 INVALID_OPERATION is generated if <image_id> is not a valid image id. | |
| 102 | |
| 103 INVALID_ENUM is generated if <pname> is not IMAGE_ROWBYTES. | |
| 104 | |
| 105 Errors | |
| 106 | |
| 107 None. | |
| 108 | |
| 109 New State | |
| 110 | |
| 111 None. | |
| 112 | |
| 113 Revision History | |
| 114 | |
| 115 5/9/2013 Documented the extension | |
| OLD | NEW |