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" |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 for (size_t i = 0; i < copy_rects.size(); ++i) { | 1634 for (size_t i = 0; i < copy_rects.size(); ++i) { |
1635 gfx::Rect rect = copy_rects[i]; | 1635 gfx::Rect rect = copy_rects[i]; |
1636 if (fractional_scale) { | 1636 if (fractional_scale) { |
1637 // Damage might not be DPI aligned. Inflate rect to compensate. | 1637 // Damage might not be DPI aligned. Inflate rect to compensate. |
1638 rect.Inset(-1, -1); | 1638 rect.Inset(-1, -1); |
1639 } | 1639 } |
1640 PaintRect(rect, pixel_bounds.origin(), canvas.get()); | 1640 PaintRect(rect, pixel_bounds.origin(), canvas.get()); |
1641 } | 1641 } |
1642 | 1642 |
1643 // Software FPS tick for performance tests. The accelerated path traces the | 1643 // Software FPS tick for performance tests. The accelerated path traces the |
1644 // frame events in didCommitAndDrawCompositorFrame. See throughput_tests.cc. | 1644 // frame events in didCommitAndDrawCompositorFrame. See |
| 1645 // tab_capture_performancetest.cc. |
1645 // NOTE: Tests may break if this event is renamed or moved. | 1646 // NOTE: Tests may break if this event is renamed or moved. |
1646 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickSW", | 1647 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickSW", |
1647 TRACE_EVENT_SCOPE_THREAD); | 1648 TRACE_EVENT_SCOPE_THREAD); |
1648 } else { // Accelerated compositing path | 1649 } else { // Accelerated compositing path |
1649 // Begin painting. | 1650 // Begin painting. |
1650 // If painting is done via the gpu process then we don't set any damage | 1651 // If painting is done via the gpu process then we don't set any damage |
1651 // rects to save the browser process from doing unecessary work. | 1652 // rects to save the browser process from doing unecessary work. |
1652 pending_update_params_->bitmap_rect = bounds; | 1653 pending_update_params_->bitmap_rect = bounds; |
1653 pending_update_params_->scroll_rect = gfx::Rect(); | 1654 pending_update_params_->scroll_rect = gfx::Rect(); |
1654 // We don't need an ack, because we're not sharing a DIB with the browser. | 1655 // We don't need an ack, because we're not sharing a DIB with the browser. |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1882 void RenderWidget::didBecomeReadyForAdditionalInput() { | 1883 void RenderWidget::didBecomeReadyForAdditionalInput() { |
1883 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); | 1884 TRACE_EVENT0("renderer", "RenderWidget::didBecomeReadyForAdditionalInput"); |
1884 FlushPendingInputEventAck(); | 1885 FlushPendingInputEventAck(); |
1885 } | 1886 } |
1886 | 1887 |
1887 void RenderWidget::DidCommitCompositorFrame() { | 1888 void RenderWidget::DidCommitCompositorFrame() { |
1888 } | 1889 } |
1889 | 1890 |
1890 void RenderWidget::didCommitAndDrawCompositorFrame() { | 1891 void RenderWidget::didCommitAndDrawCompositorFrame() { |
1891 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); | 1892 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); |
1892 // Accelerated FPS tick for performance tests. See throughput_tests.cc. | 1893 // Accelerated FPS tick for performance tests. See |
1893 // NOTE: Tests may break if this event is renamed or moved. | 1894 // tab_capture_performancetest.cc. NOTE: Tests may break if this event is |
| 1895 // renamed or moved. |
1894 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickGPU", | 1896 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickGPU", |
1895 TRACE_EVENT_SCOPE_THREAD); | 1897 TRACE_EVENT_SCOPE_THREAD); |
1896 // Notify subclasses that we initiated the paint operation. | 1898 // Notify subclasses that we initiated the paint operation. |
1897 DidInitiatePaint(); | 1899 DidInitiatePaint(); |
1898 } | 1900 } |
1899 | 1901 |
1900 void RenderWidget::didCompleteSwapBuffers() { | 1902 void RenderWidget::didCompleteSwapBuffers() { |
1901 TRACE_EVENT0("renderer", "RenderWidget::didCompleteSwapBuffers"); | 1903 TRACE_EVENT0("renderer", "RenderWidget::didCompleteSwapBuffers"); |
1902 | 1904 |
1903 // Notify subclasses threaded composited rendering was flushed to the screen. | 1905 // Notify subclasses threaded composited rendering was flushed to the screen. |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 surface_id(), | 2869 surface_id(), |
2868 GetURLForGraphicsContext3D(), | 2870 GetURLForGraphicsContext3D(), |
2869 gpu_channel_host.get(), | 2871 gpu_channel_host.get(), |
2870 attributes, | 2872 attributes, |
2871 false /* bind generates resources */, | 2873 false /* bind generates resources */, |
2872 limits)); | 2874 limits)); |
2873 return context.Pass(); | 2875 return context.Pass(); |
2874 } | 2876 } |
2875 | 2877 |
2876 } // namespace content | 2878 } // namespace content |
OLD | NEW |