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

Side by Side Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 833283003: Reland "Add new latency_info for tracking browser composite time." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments Created 5 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 #include "content/browser/renderer_host/compositor_impl_android.h" 5 #include "content/browser/renderer_host/compositor_impl_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 swap_buffers_completion_callback_( 74 swap_buffers_completion_callback_(
75 base::Bind(&OutputSurfaceWithoutParent::OnSwapBuffersCompleted, 75 base::Bind(&OutputSurfaceWithoutParent::OnSwapBuffersCompleted,
76 base::Unretained(this))) { 76 base::Unretained(this))) {
77 capabilities_.adjust_deadline_for_parent = false; 77 capabilities_.adjust_deadline_for_parent = false;
78 capabilities_.max_frames_pending = 2; 78 capabilities_.max_frames_pending = 2;
79 compositor_impl_ = compositor_impl; 79 compositor_impl_ = compositor_impl;
80 main_thread_ = base::MessageLoopProxy::current(); 80 main_thread_ = base::MessageLoopProxy::current();
81 } 81 }
82 82
83 virtual void SwapBuffers(cc::CompositorFrame* frame) override { 83 virtual void SwapBuffers(cc::CompositorFrame* frame) override {
84 for (auto& latency : frame->metadata.latency_info) {
85 latency.AddLatencyNumber(
86 ui::INPUT_EVENT_BROWSER_SWAP_BUFFER_COMPONENT, 0, 0);
jdduke (slow) 2015/01/06 16:01:43 Hmm, I actually don't see this component used anyw
87 }
88
84 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info); 89 GetCommandBufferProxy()->SetLatencyInfo(frame->metadata.latency_info);
85 DCHECK(frame->gl_frame_data->sub_buffer_rect == 90 DCHECK(frame->gl_frame_data->sub_buffer_rect ==
86 gfx::Rect(frame->gl_frame_data->size)); 91 gfx::Rect(frame->gl_frame_data->size));
87 context_provider_->ContextSupport()->Swap(); 92 context_provider_->ContextSupport()->Swap();
88 client_->DidSwapBuffers(); 93 client_->DidSwapBuffers();
89 } 94 }
90 95
91 virtual bool BindToClient(cc::OutputSurfaceClient* client) override { 96 virtual bool BindToClient(cc::OutputSurfaceClient* client) override {
92 if (!OutputSurface::BindToClient(client)) 97 if (!OutputSurface::BindToClient(client))
93 return false; 98 return false;
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 700
696 void CompositorImpl::SetNeedsAnimate() { 701 void CompositorImpl::SetNeedsAnimate() {
697 needs_animate_ = true; 702 needs_animate_ = true;
698 if (!host_) 703 if (!host_)
699 return; 704 return;
700 705
701 host_->SetNeedsAnimate(); 706 host_->SetNeedsAnimate();
702 } 707 }
703 708
704 } // namespace content 709 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698