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

Side by Side Diff: content/browser/renderer_host/compositing_iosurface_mac.mm

Issue 25022003: Report LatencyInfo through trace buffer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix compile error Created 7 years, 2 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 #include "content/browser/renderer_host/compositing_iosurface_mac.h" 5 #include "content/browser/renderer_host/compositing_iosurface_mac.h"
6 6
7 #include <OpenGL/CGLRenderers.h> 7 #include <OpenGL/CGLRenderers.h>
8 #include <OpenGL/OpenGL.h> 8 #include <OpenGL/OpenGL.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 490 }
491 491
492 if (!using_core_animation) { 492 if (!using_core_animation) {
493 CGLError cgl_error = CGLFlushDrawable(context_->cgl_context()); 493 CGLError cgl_error = CGLFlushDrawable(context_->cgl_context());
494 if (cgl_error != kCGLNoError) { 494 if (cgl_error != kCGLNoError) {
495 LOG(ERROR) << "CGLFlushDrawable error in DrawIOSurface: " << cgl_error; 495 LOG(ERROR) << "CGLFlushDrawable error in DrawIOSurface: " << cgl_error;
496 result = false; 496 result = false;
497 } 497 }
498 } 498 }
499 499
500 latency_info_.swap_timestamp = base::TimeTicks::HighResNow(); 500 latency_info_.AddLatencyNumber(
501 ui::INPUT_EVENT_LATENCY_TERMINATED_FRAME_SWAP_COMPONENT, 0, 0);
501 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info_); 502 RenderWidgetHostImpl::CompositorFrameDrawn(latency_info_);
502 latency_info_.Clear(); 503 latency_info_.Clear();
503 504
504 // Try to finish previous copy requests after flush to get better pipelining. 505 // Try to finish previous copy requests after flush to get better pipelining.
505 std::vector<base::Closure> copy_done_callbacks; 506 std::vector<base::Closure> copy_done_callbacks;
506 CheckIfAllCopiesAreFinishedWithinContext(false, &copy_done_callbacks); 507 CheckIfAllCopiesAreFinishedWithinContext(false, &copy_done_callbacks);
507 508
508 // Check if any of the drawing calls result in an error. 509 // Check if any of the drawing calls result in an error.
509 GetAndSaveGLError(); 510 GetAndSaveGLError();
510 if (gl_error_ != GL_NO_ERROR) { 511 if (gl_error_ != GL_NO_ERROR) {
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1057 } 1058 }
1058 1059
1059 GLenum CompositingIOSurfaceMac::GetAndSaveGLError() { 1060 GLenum CompositingIOSurfaceMac::GetAndSaveGLError() {
1060 GLenum gl_error = glGetError(); 1061 GLenum gl_error = glGetError();
1061 if (gl_error_ == GL_NO_ERROR) 1062 if (gl_error_ == GL_NO_ERROR)
1062 gl_error_ = gl_error; 1063 gl_error_ = gl_error;
1063 return gl_error; 1064 return gl_error;
1064 } 1065 }
1065 1066
1066 } // namespace content 1067 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698