| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 // representation. |callback| is invoked with the copy result when the copy | 175 // representation. |callback| is invoked with the copy result when the copy |
| 176 // operation has completed. | 176 // operation has completed. |
| 177 // Note that the src_texture will have the min/mag filter set to GL_LINEAR | 177 // Note that the src_texture will have the min/mag filter set to GL_LINEAR |
| 178 // and wrap_s/t set to CLAMP_TO_EDGE in this call. | 178 // and wrap_s/t set to CLAMP_TO_EDGE in this call. |
| 179 void CropScaleReadbackAndCleanTexture( | 179 void CropScaleReadbackAndCleanTexture( |
| 180 GLuint src_texture, | 180 GLuint src_texture, |
| 181 const gfx::Size& src_size, | 181 const gfx::Size& src_size, |
| 182 const gfx::Rect& src_subrect, | 182 const gfx::Rect& src_subrect, |
| 183 const gfx::Size& dst_size, | 183 const gfx::Size& dst_size, |
| 184 unsigned char* out, | 184 unsigned char* out, |
| 185 bool readback_config_rgb565, | 185 const SkBitmap::Config config, |
| 186 const base::Callback<void(bool)>& callback); | 186 const base::Callback<void(bool)>& callback); |
| 187 | 187 |
| 188 // Copies the block of pixels specified with |src_subrect| from |src_mailbox|, | 188 // Copies the block of pixels specified with |src_subrect| from |src_mailbox|, |
| 189 // scales it to |dst_size|, and writes it into |out|. | 189 // scales it to |dst_size|, and writes it into |out|. |
| 190 // |src_size| is the size of |src_mailbox|. The result is of format GL_BGRA | 190 // |src_size| is the size of |src_mailbox|. The result is of format GL_BGRA |
| 191 // and is potentially flipped vertically to make it a correct image | 191 // and is potentially flipped vertically to make it a correct image |
| 192 // representation. |callback| is invoked with the copy result when the copy | 192 // representation. |callback| is invoked with the copy result when the copy |
| 193 // operation has completed. | 193 // operation has completed. |
| 194 // Note that the texture bound to src_mailbox will have the min/mag filter set | 194 // Note that the texture bound to src_mailbox will have the min/mag filter set |
| 195 // to GL_LINEAR and wrap_s/t set to CLAMP_TO_EDGE in this call. src_mailbox is | 195 // to GL_LINEAR and wrap_s/t set to CLAMP_TO_EDGE in this call. src_mailbox is |
| 196 // assumed to be GL_TEXTURE_2D. | 196 // assumed to be GL_TEXTURE_2D. |
| 197 void CropScaleReadbackAndCleanMailbox( | 197 void CropScaleReadbackAndCleanMailbox( |
| 198 const gpu::Mailbox& src_mailbox, | 198 const gpu::Mailbox& src_mailbox, |
| 199 uint32 sync_point, | 199 uint32 sync_point, |
| 200 const gfx::Size& src_size, | 200 const gfx::Size& src_size, |
| 201 const gfx::Rect& src_subrect, | 201 const gfx::Rect& src_subrect, |
| 202 const gfx::Size& dst_size, | 202 const gfx::Size& dst_size, |
| 203 unsigned char* out, | 203 unsigned char* out, |
| 204 bool readback_config_rgb565, | 204 const SkBitmap::Config config, |
| 205 const base::Callback<void(bool)>& callback); | 205 const base::Callback<void(bool)>& callback); |
| 206 | 206 |
| 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, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, | 355 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, |
| 356 uint32 sync_point, | 356 uint32 sync_point, |
| 357 const scoped_refptr<media::VideoFrame>& target, | 357 const scoped_refptr<media::VideoFrame>& target, |
| 358 const base::Callback<void(bool)>& callback) = 0; | 358 const base::Callback<void(bool)>& callback) = 0; |
| 359 virtual GLHelper::ScalerInterface* scaler() = 0; | 359 virtual GLHelper::ScalerInterface* scaler() = 0; |
| 360 }; | 360 }; |
| 361 | 361 |
| 362 } // namespace content | 362 } // namespace content |
| 363 | 363 |
| 364 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ | 364 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ |
| OLD | NEW |