| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_widget_host.h" | 5 #include "chrome/browser/renderer_host/render_widget_host.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 void RenderWidgetHost::WasRestored() { | 219 void RenderWidgetHost::WasRestored() { |
| 220 // When we create the widget, it is created as *not* hidden. | 220 // When we create the widget, it is created as *not* hidden. |
| 221 if (!is_hidden_) | 221 if (!is_hidden_) |
| 222 return; | 222 return; |
| 223 is_hidden_ = false; | 223 is_hidden_ = false; |
| 224 | 224 |
| 225 BackingStore* backing_store = BackingStoreManager::Lookup(this); | 225 BackingStore* backing_store = BackingStoreManager::Lookup(this); |
| 226 // If we already have a backing store for this widget, then we don't need to | 226 // If we already have a backing store for this widget, then we don't need to |
| 227 // repaint on restore _unless_ we know that our backing store is invalid. | 227 // repaint on restore _unless_ we know that our backing store is invalid. |
| 228 // When accelerated compositing is on, we must always repaint, even when |
| 229 // the backing store exists. |
| 228 bool needs_repainting; | 230 bool needs_repainting; |
| 229 if (needs_repainting_on_restore_ || !backing_store) { | 231 if (needs_repainting_on_restore_ || !backing_store || |
| 232 is_gpu_rendering_active()) { |
| 230 needs_repainting = true; | 233 needs_repainting = true; |
| 231 needs_repainting_on_restore_ = false; | 234 needs_repainting_on_restore_ = false; |
| 232 } else { | 235 } else { |
| 233 needs_repainting = false; | 236 needs_repainting = false; |
| 234 } | 237 } |
| 235 Send(new ViewMsg_WasRestored(routing_id_, needs_repainting)); | 238 Send(new ViewMsg_WasRestored(routing_id_, needs_repainting)); |
| 236 | 239 |
| 237 process_->WidgetRestored(); | 240 process_->WidgetRestored(); |
| 238 | 241 |
| 239 bool is_visible = true; | 242 bool is_visible = true; |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 // of this key event. | 1175 // of this key event. |
| 1173 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { | 1176 if (!processed && !is_hidden_ && !front_item.skip_in_browser) { |
| 1174 UnhandledKeyboardEvent(front_item); | 1177 UnhandledKeyboardEvent(front_item); |
| 1175 | 1178 |
| 1176 // WARNING: This RenderWidgetHost can be deallocated at this point | 1179 // WARNING: This RenderWidgetHost can be deallocated at this point |
| 1177 // (i.e. in the case of Ctrl+W, where the call to | 1180 // (i.e. in the case of Ctrl+W, where the call to |
| 1178 // UnhandledKeyboardEvent destroys this RenderWidgetHost). | 1181 // UnhandledKeyboardEvent destroys this RenderWidgetHost). |
| 1179 } | 1182 } |
| 1180 } | 1183 } |
| 1181 } | 1184 } |
| OLD | NEW |