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 #include "content/common/gpu/client/gl_helper.h" | 5 #include "content/common/gpu/client/gl_helper.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 406 |
407 void GLHelper::CopyTextureToImpl::ReadbackAsync( | 407 void GLHelper::CopyTextureToImpl::ReadbackAsync( |
408 const gfx::Size& dst_size, | 408 const gfx::Size& dst_size, |
409 int32 bytes_per_row, | 409 int32 bytes_per_row, |
410 int32 row_stride_bytes, | 410 int32 row_stride_bytes, |
411 unsigned char* out, | 411 unsigned char* out, |
412 GLenum format, | 412 GLenum format, |
413 GLenum type, | 413 GLenum type, |
414 size_t bytes_per_pixel, | 414 size_t bytes_per_pixel, |
415 const base::Callback<void(bool)>& callback) { | 415 const base::Callback<void(bool)>& callback) { |
| 416 TRACE_EVENT0("mirror", "GLHelper::CopyTextureToImpl::ReadbackAsync"); |
416 Request* request = | 417 Request* request = |
417 new Request(dst_size, bytes_per_row, row_stride_bytes, out, callback); | 418 new Request(dst_size, bytes_per_row, row_stride_bytes, out, callback); |
418 request_queue_.push(request); | 419 request_queue_.push(request); |
419 request->buffer = 0u; | 420 request->buffer = 0u; |
420 | 421 |
421 gl_->GenBuffers(1, &request->buffer); | 422 gl_->GenBuffers(1, &request->buffer); |
422 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, request->buffer); | 423 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, request->buffer); |
423 gl_->BufferData(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, | 424 gl_->BufferData(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, |
424 bytes_per_pixel * dst_size.GetArea(), | 425 bytes_per_pixel * dst_size.GetArea(), |
425 NULL, | 426 NULL, |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, | 1235 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, |
1235 src_size, | 1236 src_size, |
1236 src_subrect, | 1237 src_subrect, |
1237 dst_size, | 1238 dst_size, |
1238 dst_subrect, | 1239 dst_subrect, |
1239 flip_vertically, | 1240 flip_vertically, |
1240 use_mrt); | 1241 use_mrt); |
1241 } | 1242 } |
1242 | 1243 |
1243 } // namespace content | 1244 } // namespace content |
OLD | NEW |