Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: content/common/gpu/client/gl_helper.h

Issue 133813003: Add Async API unittests to readback format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code changed as per reviw comments. Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/client/gl_helper.cc » ('j') | content/common/gpu/client/gl_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698