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

Side by Side Diff: content/renderer/render_widget.cc

Issue 15682010: Support plumbing LatencyInfo through the old software path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 handling_input_event_ = false; 721 handling_input_event_ = false;
722 return; 722 return;
723 } 723 }
724 724
725 const char* const event_name = GetEventName(input_event->type); 725 const char* const event_name = GetEventName(input_event->type);
726 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent", 726 TRACE_EVENT1("renderer", "RenderWidget::OnHandleInputEvent",
727 "event", event_name); 727 "event", event_name);
728 728
729 if (compositor_) 729 if (compositor_)
730 compositor_->SetLatencyInfo(latency_info); 730 compositor_->SetLatencyInfo(latency_info);
731 else
732 latency_info_.MergeWith(latency_info);
731 733
732 base::TimeDelta now = base::TimeDelta::FromInternalValue( 734 base::TimeDelta now = base::TimeDelta::FromInternalValue(
733 base::TimeTicks::Now().ToInternalValue()); 735 base::TimeTicks::Now().ToInternalValue());
734 736
735 int64 delta = static_cast<int64>( 737 int64 delta = static_cast<int64>(
736 (now.InSecondsF() - input_event->timeStampSeconds) * 738 (now.InSecondsF() - input_event->timeStampSeconds) *
737 base::Time::kMicrosecondsPerSecond); 739 base::Time::kMicrosecondsPerSecond);
738 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Renderer", delta, 0, 1000000, 100); 740 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.Renderer", delta, 0, 1000000, 100);
739 base::HistogramBase* counter_for_type = 741 base::HistogramBase* counter_for_type =
740 base::Histogram::FactoryGet( 742 base::Histogram::FactoryGet(
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 pending_update_params_->scroll_rect = update.scroll_rect; 1207 pending_update_params_->scroll_rect = update.scroll_rect;
1206 pending_update_params_->view_size = size_; 1208 pending_update_params_->view_size = size_;
1207 pending_update_params_->plugin_window_moves.swap(plugin_window_moves_); 1209 pending_update_params_->plugin_window_moves.swap(plugin_window_moves_);
1208 pending_update_params_->flags = next_paint_flags_; 1210 pending_update_params_->flags = next_paint_flags_;
1209 pending_update_params_->scroll_offset = GetScrollOffset(); 1211 pending_update_params_->scroll_offset = GetScrollOffset();
1210 pending_update_params_->needs_ack = true; 1212 pending_update_params_->needs_ack = true;
1211 pending_update_params_->scale_factor = device_scale_factor_; 1213 pending_update_params_->scale_factor = device_scale_factor_;
1212 next_paint_flags_ = 0; 1214 next_paint_flags_ = 0;
1213 need_update_rect_for_auto_resize_ = false; 1215 need_update_rect_for_auto_resize_ = false;
1214 1216
1217 if (!is_accelerated_compositing_active_)
1218 pending_update_params_->latency_info = latency_info_;
1219
1220 latency_info_.Clear();
1221
1215 if (update.scroll_rect.IsEmpty() && 1222 if (update.scroll_rect.IsEmpty() &&
1216 !is_accelerated_compositing_active_ && 1223 !is_accelerated_compositing_active_ &&
1217 GetBitmapForOptimizedPluginPaint(bounds, &dib, &optimized_copy_location, 1224 GetBitmapForOptimizedPluginPaint(bounds, &dib, &optimized_copy_location,
1218 &optimized_copy_rect, 1225 &optimized_copy_rect,
1219 &dib_scale_factor)) { 1226 &dib_scale_factor)) {
1220 // Only update the part of the plugin that actually changed. 1227 // Only update the part of the plugin that actually changed.
1221 optimized_copy_rect.Intersect(bounds); 1228 optimized_copy_rect.Intersect(bounds);
1222 pending_update_params_->bitmap = dib->id(); 1229 pending_update_params_->bitmap = dib->id();
1223 pending_update_params_->bitmap_rect = optimized_copy_location; 1230 pending_update_params_->bitmap_rect = optimized_copy_location;
1224 pending_update_params_->copy_rects.push_back(optimized_copy_rect); 1231 pending_update_params_->copy_rects.push_back(optimized_copy_rect);
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 2397
2391 if (!context->Initialize( 2398 if (!context->Initialize(
2392 attributes, 2399 attributes,
2393 false /* bind generates resources */, 2400 false /* bind generates resources */,
2394 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) ) 2401 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE) )
2395 return NULL; 2402 return NULL;
2396 return context.release(); 2403 return context.release();
2397 } 2404 }
2398 2405
2399 } // namespace content 2406 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698