| OLD | NEW |
| 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" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "cc/base/switches.h" | 18 #include "cc/base/switches.h" |
| 19 #include "cc/debug/benchmark_instrumentation.h" |
| 19 #include "cc/output/output_surface.h" | 20 #include "cc/output/output_surface.h" |
| 20 #include "cc/trees/layer_tree_host.h" | 21 #include "cc/trees/layer_tree_host.h" |
| 21 #include "content/child/npapi/webplugin.h" | 22 #include "content/child/npapi/webplugin.h" |
| 22 #include "content/common/gpu/client/context_provider_command_buffer.h" | 23 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 23 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 24 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 24 #include "content/common/input_messages.h" | 25 #include "content/common/input_messages.h" |
| 25 #include "content/common/swapped_out_messages.h" | 26 #include "content/common/swapped_out_messages.h" |
| 26 #include "content/common/view_messages.h" | 27 #include "content/common/view_messages.h" |
| 27 #include "content/public/common/content_switches.h" | 28 #include "content/public/common/content_switches.h" |
| 28 #include "content/renderer/cursor_utils.h" | 29 #include "content/renderer/cursor_utils.h" |
| (...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1480 | 1481 |
| 1481 // Calculate filtered time per frame: | 1482 // Calculate filtered time per frame: |
| 1482 float frame_time_elapsed = static_cast<float>(delay.InSecondsF()); | 1483 float frame_time_elapsed = static_cast<float>(delay.InSecondsF()); |
| 1483 filtered_time_per_frame_ = | 1484 filtered_time_per_frame_ = |
| 1484 0.9f * filtered_time_per_frame_ + 0.1f * frame_time_elapsed; | 1485 0.9f * filtered_time_per_frame_ + 0.1f * frame_time_elapsed; |
| 1485 } | 1486 } |
| 1486 last_do_deferred_update_time_ = frame_begin_ticks; | 1487 last_do_deferred_update_time_ = frame_begin_ticks; |
| 1487 | 1488 |
| 1488 if (!is_accelerated_compositing_active_) { | 1489 if (!is_accelerated_compositing_active_) { |
| 1489 legacy_software_mode_stats_->IncrementFrameCount(1, true); | 1490 legacy_software_mode_stats_->IncrementFrameCount(1, true); |
| 1490 legacy_software_mode_stats_->IssueTraceEventForMainThreadStats(); | 1491 cc::BenchmarkInstrumentation::IssueMainThreadRenderingStatsEvent( |
| 1492 legacy_software_mode_stats_->main_thread_rendering_stats()); |
| 1491 legacy_software_mode_stats_->AccumulateAndClearMainThreadStats(); | 1493 legacy_software_mode_stats_->AccumulateAndClearMainThreadStats(); |
| 1492 } | 1494 } |
| 1493 | 1495 |
| 1494 // OK, save the pending update to a local since painting may cause more | 1496 // OK, save the pending update to a local since painting may cause more |
| 1495 // invalidation. Some WebCore rendering objects only layout when painted. | 1497 // invalidation. Some WebCore rendering objects only layout when painted. |
| 1496 PaintAggregator::PendingUpdate update; | 1498 PaintAggregator::PendingUpdate update; |
| 1497 paint_aggregator_.PopPendingUpdate(&update); | 1499 paint_aggregator_.PopPendingUpdate(&update); |
| 1498 | 1500 |
| 1499 gfx::Rect scroll_damage = update.GetScrollDamage(); | 1501 gfx::Rect scroll_damage = update.GetScrollDamage(); |
| 1500 gfx::Rect bounds = gfx::UnionRects(update.GetPaintBounds(), scroll_damage); | 1502 gfx::Rect bounds = gfx::UnionRects(update.GetPaintBounds(), scroll_damage); |
| (...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2816 kDefaultCommandBufferSize, | 2818 kDefaultCommandBufferSize, |
| 2817 kDefaultStartTransferBufferSize, | 2819 kDefaultStartTransferBufferSize, |
| 2818 kDefaultMinTransferBufferSize, | 2820 kDefaultMinTransferBufferSize, |
| 2819 kDefaultMaxTransferBufferSize, | 2821 kDefaultMaxTransferBufferSize, |
| 2820 mapped_memory_reclaim_limit)) | 2822 mapped_memory_reclaim_limit)) |
| 2821 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 2823 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
| 2822 return context.Pass(); | 2824 return context.Pass(); |
| 2823 } | 2825 } |
| 2824 | 2826 |
| 2825 } // namespace content | 2827 } // namespace content |
| OLD | NEW |