OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CPP_COMPOSITOR_LAYER_H_ | 5 #ifndef PPAPI_CPP_COMPOSITOR_LAYER_H_ |
6 #define PPAPI_CPP_COMPOSITOR_LAYER_H_ | 6 #define PPAPI_CPP_COMPOSITOR_LAYER_H_ |
7 | 7 |
8 #include "ppapi/c/ppb_compositor_layer.h" | 8 #include "ppapi/c/ppb_compositor_layer.h" |
9 #include "ppapi/cpp/graphics_3d.h" | 9 #include "ppapi/cpp/graphics_3d.h" |
10 #include "ppapi/cpp/image_data.h" | 10 #include "ppapi/cpp/image_data.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const Size& size); | 63 const Size& size); |
64 | 64 |
65 /// Sets the texture of a texture layer. If the layer is uninitialized, it | 65 /// Sets the texture of a texture layer. If the layer is uninitialized, it |
66 /// will initialize the layer first, and then set its texture. The source rect | 66 /// will initialize the layer first, and then set its texture. The source rect |
67 /// will be set to ((0, 0), (1, 1)). If the layer has been initialized to | 67 /// will be set to ((0, 0), (1, 1)). If the layer has been initialized to |
68 /// another kind of layer, the layer will not be changed, and | 68 /// another kind of layer, the layer will not be changed, and |
69 /// <code>PP_ERROR_BADARGUMENT</code> will be returned. | 69 /// <code>PP_ERROR_BADARGUMENT</code> will be returned. |
70 /// | 70 /// |
71 /// param[in] context A <code>Graphics3D</code> corresponding to a graphics 3d | 71 /// param[in] context A <code>Graphics3D</code> corresponding to a graphics 3d |
72 /// resource which owns the GL texture. | 72 /// resource which owns the GL texture. |
| 73 /// param[in] target GL texture target (GL_TEXTURE_2D, etc). |
73 /// param[in] texture A GL texture object id. | 74 /// param[in] texture A GL texture object id. |
74 /// param[in] size A <code>Size</code> for the size of the layer before | 75 /// param[in] size A <code>Size</code> for the size of the layer before |
75 /// transform. | 76 /// transform. |
76 /// param[in] cc A <code>CompletionCallback</code> to be called when | 77 /// param[in] cc A <code>CompletionCallback</code> to be called when |
77 /// the texture is released by Chromium compositor. | 78 /// the texture is released by Chromium compositor. |
78 /// | 79 /// |
79 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. | 80 /// @return An int32_t containing a result code from <code>pp_errors.h</code>. |
80 int32_t SetTexture(const Graphics3D& context, | 81 int32_t SetTexture(const Graphics3D& context, |
| 82 uint32_t target, |
81 uint32_t texture, | 83 uint32_t texture, |
82 const Size& size, | 84 const Size& size, |
83 const CompletionCallback& cc); | 85 const CompletionCallback& cc); |
84 | 86 |
85 /// Sets the image of an image layer. If the layer is uninitialized, it will | 87 /// Sets the image of an image layer. If the layer is uninitialized, it will |
86 /// initiliaze the layer first, and then set the image of it. If the layer has | 88 /// initiliaze the layer first, and then set the image of it. If the layer has |
87 /// been initialized to another kind of layer, the layer will not be changed, | 89 /// been initialized to another kind of layer, the layer will not be changed, |
88 /// and <code>PP_ERROR_BADARGUMENT</code> will be returned. | 90 /// and <code>PP_ERROR_BADARGUMENT</code> will be returned. |
89 /// | 91 /// |
90 /// param[in] image_data A <code>PP_Resource</code> corresponding to an image | 92 /// param[in] image_data A <code>PP_Resource</code> corresponding to an image |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 /// | 181 /// |
180 /// @param[in] resource A <code>Resource</code> to test. | 182 /// @param[in] resource A <code>Resource</code> to test. |
181 /// | 183 /// |
182 /// @return True if <code>resource</code> is a compositor layer. | 184 /// @return True if <code>resource</code> is a compositor layer. |
183 static bool IsCompositorLayer(const Resource& resource); | 185 static bool IsCompositorLayer(const Resource& resource); |
184 }; | 186 }; |
185 | 187 |
186 } // namespace pp | 188 } // namespace pp |
187 | 189 |
188 #endif // PPAPI_CPP_COMPOSITOR_LAYER_H_ | 190 #endif // PPAPI_CPP_COMPOSITOR_LAYER_H_ |
OLD | NEW |