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

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

Issue 1031813002: Use proper tracing category in image/tab capture trace logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reuploaded patchset! Created 5 years, 8 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
« no previous file with comments | « content/browser/media/capture/web_contents_video_capture_device.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 void GLHelper::CopyTextureToImpl::ReadbackAsync( 486 void GLHelper::CopyTextureToImpl::ReadbackAsync(
487 const gfx::Size& dst_size, 487 const gfx::Size& dst_size,
488 int32 bytes_per_row, 488 int32 bytes_per_row,
489 int32 row_stride_bytes, 489 int32 row_stride_bytes,
490 unsigned char* out, 490 unsigned char* out,
491 GLenum format, 491 GLenum format,
492 GLenum type, 492 GLenum type,
493 size_t bytes_per_pixel, 493 size_t bytes_per_pixel,
494 const base::Callback<void(bool)>& callback) { 494 const base::Callback<void(bool)>& callback) {
495 TRACE_EVENT0("mirror", "GLHelper::CopyTextureToImpl::ReadbackAsync"); 495 TRACE_EVENT0("gpu.capture", "GLHelper::CopyTextureToImpl::ReadbackAsync");
496 Request* request = 496 Request* request =
497 new Request(dst_size, bytes_per_row, row_stride_bytes, out, callback); 497 new Request(dst_size, bytes_per_row, row_stride_bytes, out, callback);
498 request_queue_.push(request); 498 request_queue_.push(request);
499 request->buffer = 0u; 499 request->buffer = 0u;
500 500
501 gl_->GenBuffers(1, &request->buffer); 501 gl_->GenBuffers(1, &request->buffer);
502 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, request->buffer); 502 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, request->buffer);
503 gl_->BufferData(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 503 gl_->BufferData(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM,
504 bytes_per_pixel * dst_size.GetArea(), 504 bytes_per_pixel * dst_size.GetArea(),
505 NULL, 505 NULL,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 gfx::Rect(src_size), 700 gfx::Rect(src_size),
701 dst_size, 701 dst_size,
702 vertically_flip_texture, 702 vertically_flip_texture,
703 false, 703 false,
704 kRGBA_8888_SkColorType, // GL_RGBA 704 kRGBA_8888_SkColorType, // GL_RGBA
705 quality); 705 quality);
706 } 706 }
707 707
708 void GLHelper::CopyTextureToImpl::ReadbackDone(Request* finished_request, 708 void GLHelper::CopyTextureToImpl::ReadbackDone(Request* finished_request,
709 int bytes_per_pixel) { 709 int bytes_per_pixel) {
710 TRACE_EVENT0("mirror", 710 TRACE_EVENT0("gpu.capture",
711 "GLHelper::CopyTextureToImpl::CheckReadbackFramebufferComplete"); 711 "GLHelper::CopyTextureToImpl::CheckReadbackFramebufferComplete");
712 finished_request->done = true; 712 finished_request->done = true;
713 713
714 FinishRequestHelper finish_request_helper; 714 FinishRequestHelper finish_request_helper;
715 715
716 // We process transfer requests in the order they were received, regardless 716 // We process transfer requests in the order they were received, regardless
717 // of the order we get the callbacks in. 717 // of the order we get the callbacks in.
718 while (!request_queue_.empty()) { 718 while (!request_queue_.empty()) {
719 Request* request = request_queue_.front(); 719 Request* request = request_queue_.front();
720 if (!request->done) { 720 if (!request->done) {
(...skipping 24 matching lines...) Expand all
745 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0); 745 gl_->BindBuffer(GL_PIXEL_PACK_TRANSFER_BUFFER_CHROMIUM, 0);
746 } 746 }
747 FinishRequest(request, result, &finish_request_helper); 747 FinishRequest(request, result, &finish_request_helper);
748 } 748 }
749 } 749 }
750 750
751 void GLHelper::CopyTextureToImpl::FinishRequest( 751 void GLHelper::CopyTextureToImpl::FinishRequest(
752 Request* request, 752 Request* request,
753 bool result, 753 bool result,
754 FinishRequestHelper* finish_request_helper) { 754 FinishRequestHelper* finish_request_helper) {
755 TRACE_EVENT0("mirror", "GLHelper::CopyTextureToImpl::FinishRequest"); 755 TRACE_EVENT0("gpu.capture", "GLHelper::CopyTextureToImpl::FinishRequest");
756 DCHECK(request_queue_.front() == request); 756 DCHECK(request_queue_.front() == request);
757 request_queue_.pop(); 757 request_queue_.pop();
758 request->result = result; 758 request->result = result;
759 ScopedFlush flush(gl_); 759 ScopedFlush flush(gl_);
760 if (request->query != 0) { 760 if (request->query != 0) {
761 gl_->DeleteQueriesEXT(1, &request->query); 761 gl_->DeleteQueriesEXT(1, &request->query);
762 request->query = 0; 762 request->query = 0;
763 } 763 }
764 if (request->buffer != 0) { 764 if (request->buffer != 0) {
765 gl_->DeleteBuffers(1, &request->buffer); 765 gl_->DeleteBuffers(1, &request->buffer);
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 InitCopyTextToImpl(); 1376 InitCopyTextToImpl();
1377 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, 1377 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality,
1378 src_size, 1378 src_size,
1379 src_subrect, 1379 src_subrect,
1380 dst_size, 1380 dst_size,
1381 flip_vertically, 1381 flip_vertically,
1382 use_mrt); 1382 use_mrt);
1383 } 1383 }
1384 1384
1385 } // namespace content 1385 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/capture/web_contents_video_capture_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698