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

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

Issue 577273003: Add new latency_info for tracking browser composite time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: made slack constant Created 6 years, 3 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 OutputSurfaceWithoutParent(const scoped_refptr< 59 OutputSurfaceWithoutParent(const scoped_refptr<
60 content::ContextProviderCommandBuffer>& context_provider, 60 content::ContextProviderCommandBuffer>& context_provider,
61 base::WeakPtr<content::CompositorImpl> compositor_impl) 61 base::WeakPtr<content::CompositorImpl> compositor_impl)
62 : cc::OutputSurface(context_provider) { 62 : cc::OutputSurface(context_provider) {
63 capabilities_.adjust_deadline_for_parent = false; 63 capabilities_.adjust_deadline_for_parent = false;
64 compositor_impl_ = compositor_impl; 64 compositor_impl_ = compositor_impl;
65 main_thread_ = base::MessageLoopProxy::current(); 65 main_thread_ = base::MessageLoopProxy::current();
66 } 66 }
67 67
68 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE { 68 virtual void SwapBuffers(cc::CompositorFrame* frame) OVERRIDE {
69 for (size_t i = 0; i < frame->metadata.latency_info.size(); i++) {
70 frame->metadata.latency_info[i].AddLatencyNumber(
71 ui::INPUT_EVENT_BROWSER_SWAP_BUFFER_COMPONENT, 0, 0);
72 }
73
69 content::ContextProviderCommandBuffer* provider_command_buffer = 74 content::ContextProviderCommandBuffer* provider_command_buffer =
70 static_cast<content::ContextProviderCommandBuffer*>( 75 static_cast<content::ContextProviderCommandBuffer*>(
71 context_provider_.get()); 76 context_provider_.get());
72 content::CommandBufferProxyImpl* command_buffer_proxy = 77 content::CommandBufferProxyImpl* command_buffer_proxy =
73 provider_command_buffer->GetCommandBufferProxy(); 78 provider_command_buffer->GetCommandBufferProxy();
74 DCHECK(command_buffer_proxy); 79 DCHECK(command_buffer_proxy);
75 command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info); 80 command_buffer_proxy->SetLatencyInfo(frame->metadata.latency_info);
76 81
77 OutputSurface::SwapBuffers(frame); 82 OutputSurface::SwapBuffers(frame);
78 } 83 }
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 } 674 }
670 675
671 void CompositorImpl::SetNeedsAnimate() { 676 void CompositorImpl::SetNeedsAnimate() {
672 if (!host_) 677 if (!host_)
673 return; 678 return;
674 679
675 host_->SetNeedsAnimate(); 680 host_->SetNeedsAnimate();
676 } 681 }
677 682
678 } // namespace content 683 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698