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

Unified Diff: cc/trees/thread_proxy.cc

Issue 363003002: Add duration estimation data to RenderingStats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ProxyTimingHistory adds samples. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« cc/trees/thread_proxy.h ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/thread_proxy.cc
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc
index 22922e2211af8f78465c613034bab1ae2878d727..cb1a52739af6ce5e2e9bbba332f14fb44be8b6c9 100644
--- a/cc/trees/thread_proxy.cc
+++ b/cc/trees/thread_proxy.cc
@@ -11,7 +11,6 @@
#include "base/bind.h"
#include "base/debug/trace_event.h"
#include "base/debug/trace_event_synthetic_delay.h"
-#include "base/metrics/histogram.h"
#include "cc/base/swap_promise.h"
#include "cc/debug/benchmark_instrumentation.h"
#include "cc/debug/devtools_instrumentation.h"
@@ -75,7 +74,10 @@ ThreadProxy::ThreadProxy(
: Proxy(impl_task_runner),
main_thread_only_vars_unsafe_(this, layer_tree_host->id()),
main_thread_or_blocked_vars_unsafe_(layer_tree_host),
- compositor_thread_vars_unsafe_(this, layer_tree_host->id()) {
+ compositor_thread_vars_unsafe_(
+ this,
+ layer_tree_host->id(),
+ layer_tree_host->rendering_stats_instrumentation()) {
TRACE_EVENT0("cc", "ThreadProxy::ThreadProxy");
DCHECK(IsMainThread());
DCHECK(this->layer_tree_host());
@@ -108,8 +110,10 @@ ThreadProxy::MainThreadOrBlockedMainThread::contents_texture_manager() {
return layer_tree_host->contents_texture_manager();
}
-ThreadProxy::CompositorThreadOnly::CompositorThreadOnly(ThreadProxy* proxy,
- int layer_tree_host_id)
+ThreadProxy::CompositorThreadOnly::CompositorThreadOnly(
+ ThreadProxy* proxy,
+ int layer_tree_host_id,
+ RenderingStatsInstrumentation* rendering_stats_instrumentation)
: layer_tree_host_id(layer_tree_host_id),
contents_texture_manager(NULL),
commit_completion_event(NULL),
@@ -124,6 +128,7 @@ ThreadProxy::CompositorThreadOnly::CompositorThreadOnly(ThreadProxy* proxy,
base::Bind(&ThreadProxy::RenewTreePriority, base::Unretained(proxy)),
base::TimeDelta::FromMilliseconds(
kSmoothnessTakesPriorityExpirationDelay * 1000)),
+ timing_history(rendering_stats_instrumentation),
weak_factory(proxy) {
}
@@ -1050,7 +1055,6 @@ DrawResult ThreadProxy::DrawSwapInternal(bool forced_draw) {
DCHECK(impl().layer_tree_host_impl.get());
impl().timing_history.DidStartDrawing();
- base::TimeDelta draw_duration_estimate = DrawDurationEstimate();
base::AutoReset<bool> mark_inside(&impl().inside_draw, true);
if (impl().did_commit_after_animating) {
@@ -1125,31 +1129,8 @@ DrawResult ThreadProxy::DrawSwapInternal(bool forced_draw) {
if (draw_frame)
CheckOutputSurfaceStatusOnImplThread();
- if (result == DRAW_SUCCESS) {
- base::TimeDelta draw_duration = impl().timing_history.DidFinishDrawing();
-
- base::TimeDelta draw_duration_overestimate;
- base::TimeDelta draw_duration_underestimate;
- if (draw_duration > draw_duration_estimate)
- draw_duration_underestimate = draw_duration - draw_duration_estimate;
- else
- draw_duration_overestimate = draw_duration_estimate - draw_duration;
- UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDuration",
- draw_duration,
- base::TimeDelta::FromMilliseconds(1),
- base::TimeDelta::FromMilliseconds(100),
- 50);
- UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationUnderestimate",
- draw_duration_underestimate,
- base::TimeDelta::FromMilliseconds(1),
- base::TimeDelta::FromMilliseconds(100),
- 50);
- UMA_HISTOGRAM_CUSTOM_TIMES("Renderer.DrawDurationOverestimate",
- draw_duration_overestimate,
- base::TimeDelta::FromMilliseconds(1),
- base::TimeDelta::FromMilliseconds(100),
- 50);
- }
+ if (result == DRAW_SUCCESS)
+ impl().timing_history.DidFinishDrawing();
DCHECK_NE(INVALID_RESULT, result);
return result;
« cc/trees/thread_proxy.h ('K') | « cc/trees/thread_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698