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 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 if (fractional_scale) { | 1228 if (fractional_scale) { |
1229 // Damage might not be DPI aligned. Inflate rect to compensate. | 1229 // Damage might not be DPI aligned. Inflate rect to compensate. |
1230 rect.Inset(-1, -1); | 1230 rect.Inset(-1, -1); |
1231 } | 1231 } |
1232 PaintRect(rect, pixel_bounds.origin(), canvas.get()); | 1232 PaintRect(rect, pixel_bounds.origin(), canvas.get()); |
1233 } | 1233 } |
1234 | 1234 |
1235 // Software FPS tick for performance tests. The accelerated path traces the | 1235 // Software FPS tick for performance tests. The accelerated path traces the |
1236 // frame events in didCommitAndDrawCompositorFrame. See throughput_tests.cc. | 1236 // frame events in didCommitAndDrawCompositorFrame. See throughput_tests.cc. |
1237 // NOTE: Tests may break if this event is renamed or moved. | 1237 // NOTE: Tests may break if this event is renamed or moved. |
1238 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickSW"); | 1238 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickSW", |
| 1239 TRACE_EVENT_SCOPE_THREAD); |
1239 } else { // Accelerated compositing path | 1240 } else { // Accelerated compositing path |
1240 // Begin painting. | 1241 // Begin painting. |
1241 // If painting is done via the gpu process then we don't set any damage | 1242 // If painting is done via the gpu process then we don't set any damage |
1242 // rects to save the browser process from doing unecessary work. | 1243 // rects to save the browser process from doing unecessary work. |
1243 pending_update_params_->bitmap_rect = bounds; | 1244 pending_update_params_->bitmap_rect = bounds; |
1244 pending_update_params_->scroll_rect = gfx::Rect(); | 1245 pending_update_params_->scroll_rect = gfx::Rect(); |
1245 // We don't need an ack, because we're not sharing a DIB with the browser. | 1246 // We don't need an ack, because we're not sharing a DIB with the browser. |
1246 // If it needs to (e.g. composited UI), the GPU process does its own ACK | 1247 // If it needs to (e.g. composited UI), the GPU process does its own ACK |
1247 // with the browser for the GPU surface. | 1248 // with the browser for the GPU surface. |
1248 pending_update_params_->needs_ack = false; | 1249 pending_update_params_->needs_ack = false; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 Send(pending_input_event_ack_.release()); | 1470 Send(pending_input_event_ack_.release()); |
1470 } | 1471 } |
1471 | 1472 |
1472 void RenderWidget::DidCommitCompositorFrame() { | 1473 void RenderWidget::DidCommitCompositorFrame() { |
1473 } | 1474 } |
1474 | 1475 |
1475 void RenderWidget::didCommitAndDrawCompositorFrame() { | 1476 void RenderWidget::didCommitAndDrawCompositorFrame() { |
1476 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); | 1477 TRACE_EVENT0("gpu", "RenderWidget::didCommitAndDrawCompositorFrame"); |
1477 // Accelerated FPS tick for performance tests. See throughput_tests.cc. | 1478 // Accelerated FPS tick for performance tests. See throughput_tests.cc. |
1478 // NOTE: Tests may break if this event is renamed or moved. | 1479 // NOTE: Tests may break if this event is renamed or moved. |
1479 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickGPU"); | 1480 UNSHIPPED_TRACE_EVENT_INSTANT0("test_fps", "TestFrameTickGPU", |
| 1481 TRACE_EVENT_SCOPE_THREAD); |
1480 // Notify subclasses that we initiated the paint operation. | 1482 // Notify subclasses that we initiated the paint operation. |
1481 DidInitiatePaint(); | 1483 DidInitiatePaint(); |
1482 } | 1484 } |
1483 | 1485 |
1484 void RenderWidget::didCompleteSwapBuffers() { | 1486 void RenderWidget::didCompleteSwapBuffers() { |
1485 TRACE_EVENT0("renderer", "RenderWidget::didCompleteSwapBuffers"); | 1487 TRACE_EVENT0("renderer", "RenderWidget::didCompleteSwapBuffers"); |
1486 | 1488 |
1487 // Notify subclasses threaded composited rendering was flushed to the screen. | 1489 // Notify subclasses threaded composited rendering was flushed to the screen. |
1488 DidFlushPaint(); | 1490 DidFlushPaint(); |
1489 | 1491 |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 | 2310 |
2309 if (!context->Initialize( | 2311 if (!context->Initialize( |
2310 attributes, | 2312 attributes, |
2311 false /* bind generates resources */, | 2313 false /* bind generates resources */, |
2312 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) | 2314 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
) |
2313 return NULL; | 2315 return NULL; |
2314 return context.release(); | 2316 return context.release(); |
2315 } | 2317 } |
2316 | 2318 |
2317 } // namespace content | 2319 } // namespace content |
OLD | NEW |