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 CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
7 | 7 |
8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Copies the texture data out of |texture| into |out|. |size| is the | 207 // Copies the texture data out of |texture| into |out|. |size| is the |
208 // size of the texture. No post processing is applied to the pixels. The | 208 // size of the texture. No post processing is applied to the pixels. The |
209 // texture is assumed to have a format of GL_RGBA with a pixel type of | 209 // texture is assumed to have a format of GL_RGBA with a pixel type of |
210 // GL_UNSIGNED_BYTE. This is a blocking call that calls glReadPixels on the | 210 // GL_UNSIGNED_BYTE. This is a blocking call that calls glReadPixels on the |
211 // current OpenGL context. | 211 // current OpenGL context. |
212 void ReadbackTextureSync(GLuint texture, | 212 void ReadbackTextureSync(GLuint texture, |
213 const gfx::Rect& src_rect, | 213 const gfx::Rect& src_rect, |
214 unsigned char* out, | 214 unsigned char* out, |
215 SkBitmap::Config format); | 215 SkBitmap::Config format); |
216 | 216 |
| 217 void ReadbackTextureAsync(GLuint texture, |
| 218 const gfx::Size& dst_size, |
| 219 unsigned char* out, |
| 220 SkBitmap::Config config, |
| 221 const base::Callback<void(bool)>& callback); |
| 222 |
217 // Creates a copy of the specified texture. |size| is the size of the texture. | 223 // Creates a copy of the specified texture. |size| is the size of the texture. |
218 // Note that the src_texture will have the min/mag filter set to GL_LINEAR | 224 // Note that the src_texture will have the min/mag filter set to GL_LINEAR |
219 // and wrap_s/t set to CLAMP_TO_EDGE in this call. | 225 // and wrap_s/t set to CLAMP_TO_EDGE in this call. |
220 GLuint CopyTexture(GLuint texture, const gfx::Size& size); | 226 GLuint CopyTexture(GLuint texture, const gfx::Size& size); |
221 | 227 |
222 // Creates a scaled copy of the specified texture. |src_size| is the size of | 228 // Creates a scaled copy of the specified texture. |src_size| is the size of |
223 // the texture and |dst_size| is the size of the resulting copy. | 229 // the texture and |dst_size| is the size of the resulting copy. |
224 // Note that the src_texture will have the min/mag filter set to GL_LINEAR | 230 // Note that the src_texture will have the min/mag filter set to GL_LINEAR |
225 // and wrap_s/t set to CLAMP_TO_EDGE in this call. | 231 // and wrap_s/t set to CLAMP_TO_EDGE in this call. |
226 GLuint CopyAndScaleTexture(GLuint texture, | 232 GLuint CopyAndScaleTexture(GLuint texture, |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, | 361 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, |
356 uint32 sync_point, | 362 uint32 sync_point, |
357 const scoped_refptr<media::VideoFrame>& target, | 363 const scoped_refptr<media::VideoFrame>& target, |
358 const base::Callback<void(bool)>& callback) = 0; | 364 const base::Callback<void(bool)>& callback) = 0; |
359 virtual GLHelper::ScalerInterface* scaler() = 0; | 365 virtual GLHelper::ScalerInterface* scaler() = 0; |
360 }; | 366 }; |
361 | 367 |
362 } // namespace content | 368 } // namespace content |
363 | 369 |
364 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 370 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
OLD | NEW |