| 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/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 return view_->GetCompositingSurface(); | 228 return view_->GetCompositingSurface(); |
| 229 return gfx::GLSurfaceHandle(); | 229 return gfx::GLSurfaceHandle(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void RenderWidgetHostImpl::CompositingSurfaceUpdated() { | 232 void RenderWidgetHostImpl::CompositingSurfaceUpdated() { |
| 233 GpuSurfaceTracker::Get()->SetSurfaceHandle( | 233 GpuSurfaceTracker::Get()->SetSurfaceHandle( |
| 234 surface_id_, GetCompositingSurface()); | 234 surface_id_, GetCompositingSurface()); |
| 235 process_->SurfaceUpdated(surface_id_); | 235 process_->SurfaceUpdated(surface_id_); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void RenderWidgetHostImpl::ResetSizeAndRepaintPendingFlags() { | |
| 239 resize_ack_pending_ = false; | |
| 240 repaint_ack_pending_ = false; | |
| 241 in_flight_size_.SetSize(0, 0); | |
| 242 } | |
| 243 | |
| 244 void RenderWidgetHostImpl::Init() { | 238 void RenderWidgetHostImpl::Init() { |
| 245 DCHECK(process_->HasConnection()); | 239 DCHECK(process_->HasConnection()); |
| 246 | 240 |
| 247 renderer_initialized_ = true; | 241 renderer_initialized_ = true; |
| 248 | 242 |
| 249 GpuSurfaceTracker::Get()->SetSurfaceHandle( | 243 GpuSurfaceTracker::Get()->SetSurfaceHandle( |
| 250 surface_id_, GetCompositingSurface()); | 244 surface_id_, GetCompositingSurface()); |
| 251 | 245 |
| 252 // Send the ack along with the information on placement. | 246 // Send the ack along with the information on placement. |
| 253 Send(new ViewMsg_CreatingNew_ACK(routing_id_, GetNativeViewId())); | 247 Send(new ViewMsg_CreatingNew_ACK(routing_id_, GetNativeViewId())); |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 next_selection_range_.reset(); | 1104 next_selection_range_.reset(); |
| 1111 | 1105 |
| 1112 // Must reset these to ensure that gesture events work with a new renderer. | 1106 // Must reset these to ensure that gesture events work with a new renderer. |
| 1113 gesture_event_filter_->Reset(); | 1107 gesture_event_filter_->Reset(); |
| 1114 | 1108 |
| 1115 // Must reset these to ensure that keyboard events work with a new renderer. | 1109 // Must reset these to ensure that keyboard events work with a new renderer. |
| 1116 key_queue_.clear(); | 1110 key_queue_.clear(); |
| 1117 suppress_next_char_events_ = false; | 1111 suppress_next_char_events_ = false; |
| 1118 | 1112 |
| 1119 // Reset some fields in preparation for recovering from a crash. | 1113 // Reset some fields in preparation for recovering from a crash. |
| 1120 ResetSizeAndRepaintPendingFlags(); | 1114 resize_ack_pending_ = false; |
| 1115 repaint_ack_pending_ = false; |
| 1116 |
| 1117 in_flight_size_.SetSize(0, 0); |
| 1121 current_size_.SetSize(0, 0); | 1118 current_size_.SetSize(0, 0); |
| 1122 is_hidden_ = false; | 1119 is_hidden_ = false; |
| 1123 is_accelerated_compositing_active_ = false; | 1120 is_accelerated_compositing_active_ = false; |
| 1124 | 1121 |
| 1125 // Reset this to ensure the hung renderer mechanism is working properly. | 1122 // Reset this to ensure the hung renderer mechanism is working properly. |
| 1126 in_flight_event_count_ = 0; | 1123 in_flight_event_count_ = 0; |
| 1127 | 1124 |
| 1128 if (view_) { | 1125 if (view_) { |
| 1129 GpuSurfaceTracker::Get()->SetSurfaceHandle(surface_id_, | 1126 GpuSurfaceTracker::Get()->SetSurfaceHandle(surface_id_, |
| 1130 gfx::GLSurfaceHandle()); | 1127 gfx::GLSurfaceHandle()); |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2054 // indicate that no callback is in progress (i.e. without this line | 2051 // indicate that no callback is in progress (i.e. without this line |
| 2055 // DelayedAutoResized will not get called again). | 2052 // DelayedAutoResized will not get called again). |
| 2056 new_auto_size_.SetSize(0, 0); | 2053 new_auto_size_.SetSize(0, 0); |
| 2057 if (!should_auto_resize_) | 2054 if (!should_auto_resize_) |
| 2058 return; | 2055 return; |
| 2059 | 2056 |
| 2060 OnRenderAutoResized(new_size); | 2057 OnRenderAutoResized(new_size); |
| 2061 } | 2058 } |
| 2062 | 2059 |
| 2063 } // namespace content | 2060 } // namespace content |
| OLD | NEW |