OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/render_widget_host.h" | 5 #include "content/browser/renderer_host/render_widget_host.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 | 1029 |
1030 // If gpu process does painting, scroll_rect and copy_rects are always empty | 1030 // If gpu process does painting, scroll_rect and copy_rects are always empty |
1031 // and backing store is never used. | 1031 // and backing store is never used. |
1032 if (dib) { | 1032 if (dib) { |
1033 if (dib->size() < size) { | 1033 if (dib->size() < size) { |
1034 DLOG(WARNING) << "Transport DIB too small for given rectangle"; | 1034 DLOG(WARNING) << "Transport DIB too small for given rectangle"; |
1035 content::RecordAction( | 1035 content::RecordAction( |
1036 UserMetricsAction("BadMessageTerminate_RWH1")); | 1036 UserMetricsAction("BadMessageTerminate_RWH1")); |
1037 process()->ReceivedBadMessage(); | 1037 process()->ReceivedBadMessage(); |
1038 } else { | 1038 } else { |
| 1039 UNSHIPPED_TRACE_EVENT_INSTANT2("test_latency", "UpdateRect", |
| 1040 "x+y", params.bitmap_rect.x() + params.bitmap_rect.y(), |
| 1041 "color", 0xffffff & *static_cast<uint32*>(dib->memory())); |
| 1042 UNSHIPPED_TRACE_EVENT_INSTANT1("test_latency", "UpdateRectWidth", |
| 1043 "width", params.bitmap_rect.width()); |
| 1044 |
1039 // Scroll the backing store. | 1045 // Scroll the backing store. |
1040 if (!params.scroll_rect.IsEmpty()) { | 1046 if (!params.scroll_rect.IsEmpty()) { |
1041 ScrollBackingStoreRect(params.dx, params.dy, | 1047 ScrollBackingStoreRect(params.dx, params.dy, |
1042 params.scroll_rect, | 1048 params.scroll_rect, |
1043 params.view_size); | 1049 params.view_size); |
1044 } | 1050 } |
1045 | 1051 |
1046 // Paint the backing store. This will update it with the | 1052 // Paint the backing store. This will update it with the |
1047 // renderer-supplied bits. The view will read out of the backing store | 1053 // renderer-supplied bits. The view will read out of the backing store |
1048 // later to actually draw to the screen. | 1054 // later to actually draw to the screen. |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 ui_shim->Send(new AcceleratedSurfaceMsg_BuffersSwappedACK(route_id)); | 1537 ui_shim->Send(new AcceleratedSurfaceMsg_BuffersSwappedACK(route_id)); |
1532 } | 1538 } |
1533 | 1539 |
1534 // static | 1540 // static |
1535 void RenderWidgetHost::AcknowledgePostSubBuffer(int32 route_id, | 1541 void RenderWidgetHost::AcknowledgePostSubBuffer(int32 route_id, |
1536 int gpu_host_id) { | 1542 int gpu_host_id) { |
1537 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); | 1543 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(gpu_host_id); |
1538 if (ui_shim) | 1544 if (ui_shim) |
1539 ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id)); | 1545 ui_shim->Send(new AcceleratedSurfaceMsg_PostSubBufferACK(route_id)); |
1540 } | 1546 } |
OLD | NEW |