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

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

Issue 296493003: [Android WebView] Fix DevTools Screencast slowness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: PS5 + changed discussed off-line Created 6 years, 7 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 | Annotate | Revision Log
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // operation has completed. 166 // operation has completed.
167 // Note that the src_texture will have the min/mag filter set to GL_LINEAR 167 // Note that the src_texture will have the min/mag filter set to GL_LINEAR
168 // and wrap_s/t set to CLAMP_TO_EDGE in this call. 168 // and wrap_s/t set to CLAMP_TO_EDGE in this call.
169 void CropScaleReadbackAndCleanTexture( 169 void CropScaleReadbackAndCleanTexture(
170 GLuint src_texture, 170 GLuint src_texture,
171 const gfx::Size& src_size, 171 const gfx::Size& src_size,
172 const gfx::Rect& src_subrect, 172 const gfx::Rect& src_subrect,
173 const gfx::Size& dst_size, 173 const gfx::Size& dst_size,
174 unsigned char* out, 174 unsigned char* out,
175 const SkBitmap::Config config, 175 const SkBitmap::Config config,
176 const base::Callback<void(bool)>& callback); 176 const base::Callback<void(bool)>& callback,
177 GLHelper::ScalerQuality quality);
177 178
178 // Copies the block of pixels specified with |src_subrect| from |src_mailbox|, 179 // Copies the block of pixels specified with |src_subrect| from |src_mailbox|,
179 // scales it to |dst_size|, and writes it into |out|. 180 // scales it to |dst_size|, and writes it into |out|.
180 // |src_size| is the size of |src_mailbox|. The result is of format GL_BGRA 181 // |src_size| is the size of |src_mailbox|. The result is of format GL_BGRA
181 // and is potentially flipped vertically to make it a correct image 182 // and is potentially flipped vertically to make it a correct image
182 // representation. |callback| is invoked with the copy result when the copy 183 // representation. |callback| is invoked with the copy result when the copy
183 // operation has completed. 184 // operation has completed.
184 // Note that the texture bound to src_mailbox will have the min/mag filter set 185 // Note that the texture bound to src_mailbox will have the min/mag filter set
185 // to GL_LINEAR and wrap_s/t set to CLAMP_TO_EDGE in this call. src_mailbox is 186 // to GL_LINEAR and wrap_s/t set to CLAMP_TO_EDGE in this call. src_mailbox is
186 // assumed to be GL_TEXTURE_2D. 187 // assumed to be GL_TEXTURE_2D.
187 void CropScaleReadbackAndCleanMailbox( 188 void CropScaleReadbackAndCleanMailbox(
188 const gpu::Mailbox& src_mailbox, 189 const gpu::Mailbox& src_mailbox,
189 uint32 sync_point, 190 uint32 sync_point,
190 const gfx::Size& src_size, 191 const gfx::Size& src_size,
191 const gfx::Rect& src_subrect, 192 const gfx::Rect& src_subrect,
192 const gfx::Size& dst_size, 193 const gfx::Size& dst_size,
193 unsigned char* out, 194 unsigned char* out,
194 const SkBitmap::Config config, 195 const SkBitmap::Config config,
195 const base::Callback<void(bool)>& callback); 196 const base::Callback<void(bool)>& callback,
197 GLHelper::ScalerQuality quality);
196 198
197 // Copies the texture data out of |texture| into |out|. |size| is the 199 // Copies the texture data out of |texture| into |out|. |size| is the
198 // size of the texture. No post processing is applied to the pixels. The 200 // size of the texture. No post processing is applied to the pixels. The
199 // texture is assumed to have a format of GL_RGBA with a pixel type of 201 // texture is assumed to have a format of GL_RGBA with a pixel type of
200 // GL_UNSIGNED_BYTE. This is a blocking call that calls glReadPixels on the 202 // GL_UNSIGNED_BYTE. This is a blocking call that calls glReadPixels on the
201 // current OpenGL context. 203 // current OpenGL context.
202 void ReadbackTextureSync(GLuint texture, 204 void ReadbackTextureSync(GLuint texture,
203 const gfx::Rect& src_rect, 205 const gfx::Rect& src_rect,
204 unsigned char* out, 206 unsigned char* out,
205 SkBitmap::Config format); 207 SkBitmap::Config format);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 virtual void ReadbackYUV(const gpu::Mailbox& mailbox, 362 virtual void ReadbackYUV(const gpu::Mailbox& mailbox,
361 uint32 sync_point, 363 uint32 sync_point,
362 const scoped_refptr<media::VideoFrame>& target, 364 const scoped_refptr<media::VideoFrame>& target,
363 const base::Callback<void(bool)>& callback) = 0; 365 const base::Callback<void(bool)>& callback) = 0;
364 virtual GLHelper::ScalerInterface* scaler() = 0; 366 virtual GLHelper::ScalerInterface* scaler() = 0;
365 }; 367 };
366 368
367 } // namespace content 369 } // namespace content
368 370
369 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_ 371 #endif // CONTENT_COMMON_GPU_CLIENT_GL_HELPER_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | content/common/gpu/client/gl_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698