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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 } | 979 } |
980 | 980 |
981 bool is_repaint_ack = | 981 bool is_repaint_ack = |
982 ViewHostMsg_UpdateRect_Flags::is_repaint_ack(params.flags); | 982 ViewHostMsg_UpdateRect_Flags::is_repaint_ack(params.flags); |
983 if (is_repaint_ack) { | 983 if (is_repaint_ack) { |
984 repaint_ack_pending_ = false; | 984 repaint_ack_pending_ = false; |
985 TimeDelta delta = TimeTicks::Now() - repaint_start_time_; | 985 TimeDelta delta = TimeTicks::Now() - repaint_start_time_; |
986 UMA_HISTOGRAM_TIMES("MPArch.RWH_RepaintDelta", delta); | 986 UMA_HISTOGRAM_TIMES("MPArch.RWH_RepaintDelta", delta); |
987 } | 987 } |
988 | 988 |
989 DCHECK(!params.bitmap_rect.IsEmpty()); | |
990 DCHECK(!params.view_size.IsEmpty()); | 989 DCHECK(!params.view_size.IsEmpty()); |
991 | 990 |
992 bool was_async = false; | 991 bool was_async = false; |
993 if (!is_accelerated_compositing_active_) { | 992 if (!is_accelerated_compositing_active_) { |
| 993 DCHECK(!params.bitmap_rect.IsEmpty()); |
994 const size_t size = params.bitmap_rect.height() * | 994 const size_t size = params.bitmap_rect.height() * |
995 params.bitmap_rect.width() * 4; | 995 params.bitmap_rect.width() * 4; |
996 TransportDIB* dib = process_->GetTransportDIB(params.bitmap); | 996 TransportDIB* dib = process_->GetTransportDIB(params.bitmap); |
997 | 997 |
998 // If gpu process does painting, scroll_rect and copy_rects are always empty | 998 // If gpu process does painting, scroll_rect and copy_rects are always empty |
999 // and backing store is never used. | 999 // and backing store is never used. |
1000 if (dib) { | 1000 if (dib) { |
1001 if (dib->size() < size) { | 1001 if (dib->size() < size) { |
1002 DLOG(WARNING) << "Transport DIB too small for given rectangle"; | 1002 DLOG(WARNING) << "Transport DIB too small for given rectangle"; |
1003 UserMetrics::RecordAction( | 1003 UserMetrics::RecordAction( |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 pending_mouse_lock_request_ = false; | 1464 pending_mouse_lock_request_ = false; |
1465 if (!view_ || !view_->HasFocus()|| !view_->LockMouse()) { | 1465 if (!view_ || !view_->HasFocus()|| !view_->LockMouse()) { |
1466 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); | 1466 Send(new ViewMsg_LockMouse_ACK(routing_id_, false)); |
1467 return false; | 1467 return false; |
1468 } else { | 1468 } else { |
1469 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); | 1469 Send(new ViewMsg_LockMouse_ACK(routing_id_, true)); |
1470 return true; | 1470 return true; |
1471 } | 1471 } |
1472 } | 1472 } |
1473 } | 1473 } |
OLD | NEW |