Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: content/renderer/render_widget.cc

Issue 6995062: Fix RAF-stall that occurs when switching between WebGL animation and another tab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed root cause Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // Resize should have caused an invalidation of the entire view. 296 // Resize should have caused an invalidation of the entire view.
297 DCHECK(paint_aggregator_.HasPendingUpdate()); 297 DCHECK(paint_aggregator_.HasPendingUpdate());
298 } 298 }
299 299
300 // We will send the Resize_ACK flag once we paint again. 300 // We will send the Resize_ACK flag once we paint again.
301 set_next_paint_is_resize_ack(); 301 set_next_paint_is_resize_ack();
302 } 302 }
303 } 303 }
304 304
305 void RenderWidget::OnWasHidden() { 305 void RenderWidget::OnWasHidden() {
306 TRACE_EVENT0("renderer", "RenderWidget::OnWasHidden");
306 // Go into a mode where we stop generating paint and scrolling events. 307 // Go into a mode where we stop generating paint and scrolling events.
307 SetHidden(true); 308 SetHidden(true);
308 } 309 }
309 310
310 void RenderWidget::OnWasRestored(bool needs_repainting) { 311 void RenderWidget::OnWasRestored(bool needs_repainting) {
312 TRACE_EVENT0("renderer", "RenderWidget::OnWasRestored");
311 // During shutdown we can just ignore this message. 313 // During shutdown we can just ignore this message.
312 if (!webwidget_) 314 if (!webwidget_)
313 return; 315 return;
314 316
315 // See OnWasHidden 317 // See OnWasHidden
316 SetHidden(false); 318 SetHidden(false);
317 319
318 if (!needs_repainting && !needs_repainting_on_restore_) 320 if (!needs_repainting && !needs_repainting_on_restore_)
319 return; 321 return;
320 needs_repainting_on_restore_ = false; 322 needs_repainting_on_restore_ = false;
321 323
322 // Tag the next paint as a restore ack, which is picked up by 324 // Tag the next paint as a restore ack, which is picked up by
323 // DoDeferredUpdate when it sends out the next PaintRect message. 325 // DoDeferredUpdate when it sends out the next PaintRect message.
324 set_next_paint_is_restore_ack(); 326 set_next_paint_is_restore_ack();
325 327
326 // Generate a full repaint. 328 // Generate a full repaint.
327 if (!is_accelerated_compositing_active_) { 329 if (!is_accelerated_compositing_active_) {
328 didInvalidateRect(gfx::Rect(size_.width(), size_.height())); 330 didInvalidateRect(gfx::Rect(size_.width(), size_.height()));
329 } else { 331 } else {
330 #ifndef WTF_USE_THREADED_COMPOSITING 332 #ifdef WTF_USE_THREADED_COMPOSITING
331 webwidget_->composite(false); 333 webwidget_->composite(false);
332 #else 334 #else
333 scheduleComposite(); 335 scheduleComposite();
334 #endif 336 #endif
335 } 337 }
336 } 338 }
337 339
338 void RenderWidget::OnWasSwappedOut() { 340 void RenderWidget::OnWasSwappedOut() {
339 // If we have been swapped out and no one else is using this process, 341 // If we have been swapped out and no one else is using this process,
340 // it's safe to exit now. If we get swapped back in, we will call 342 // it's safe to exit now. If we get swapped back in, we will call
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
1349 1351
1350 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { 1352 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) {
1351 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); 1353 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin();
1352 i != plugin_window_moves_.end(); ++i) { 1354 i != plugin_window_moves_.end(); ++i) {
1353 if (i->window == window) { 1355 if (i->window == window) {
1354 plugin_window_moves_.erase(i); 1356 plugin_window_moves_.erase(i);
1355 break; 1357 break;
1356 } 1358 }
1357 } 1359 }
1358 } 1360 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698