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

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

Issue 53493003: Turn on useUnfortunateSynchronousResizeMode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browsertests. Created 7 years, 1 month 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 | content/renderer/resizing_mode_selector.h » ('j') | 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) 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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 641
642 return RenderThread::Get()->Send(message); 642 return RenderThread::Get()->Send(message);
643 } 643 }
644 644
645 void RenderWidget::Resize(const gfx::Size& new_size, 645 void RenderWidget::Resize(const gfx::Size& new_size,
646 const gfx::Size& physical_backing_size, 646 const gfx::Size& physical_backing_size,
647 float overdraw_bottom_height, 647 float overdraw_bottom_height,
648 const gfx::Rect& resizer_rect, 648 const gfx::Rect& resizer_rect,
649 bool is_fullscreen, 649 bool is_fullscreen,
650 ResizeAck resize_ack) { 650 ResizeAck resize_ack) {
651 if (!resizing_mode_selector_->is_synchronous_mode()) { 651 if (resizing_mode_selector_->NeverUsesSynchronousResize()) {
652 // A resize ack shouldn't be requested if we have not ACK'd the previous 652 // A resize ack shouldn't be requested if we have not ACK'd the previous
653 // one. 653 // one.
654 DCHECK(resize_ack != SEND_RESIZE_ACK || !next_paint_is_resize_ack()); 654 DCHECK(resize_ack != SEND_RESIZE_ACK || !next_paint_is_resize_ack());
655 DCHECK(resize_ack == SEND_RESIZE_ACK || resize_ack == NO_RESIZE_ACK); 655 DCHECK(resize_ack == SEND_RESIZE_ACK || resize_ack == NO_RESIZE_ACK);
656 } 656 }
657 657
658 // Ignore this during shutdown. 658 // Ignore this during shutdown.
659 if (!webwidget_) 659 if (!webwidget_)
660 return; 660 return;
661 661
(...skipping 18 matching lines...) Expand all
680 680
681 size_ = new_size; 681 size_ = new_size;
682 682
683 paint_aggregator_.ClearPendingUpdate(); 683 paint_aggregator_.ClearPendingUpdate();
684 684
685 // When resizing, we want to wait to paint before ACK'ing the resize. This 685 // When resizing, we want to wait to paint before ACK'ing the resize. This
686 // ensures that we only resize as fast as we can paint. We only need to 686 // ensures that we only resize as fast as we can paint. We only need to
687 // send an ACK if we are resized to a non-empty rect. 687 // send an ACK if we are resized to a non-empty rect.
688 webwidget_->resize(new_size); 688 webwidget_->resize(new_size);
689 689
690 if (!resizing_mode_selector_->is_synchronous_mode()) { 690 if (resizing_mode_selector_->NeverUsesSynchronousResize()) {
691 // Resize should have caused an invalidation of the entire view. 691 // Resize should have caused an invalidation of the entire view.
692 DCHECK(new_size.IsEmpty() || is_accelerated_compositing_active_ || 692 DCHECK(new_size.IsEmpty() || is_accelerated_compositing_active_ ||
693 paint_aggregator_.HasPendingUpdate()); 693 paint_aggregator_.HasPendingUpdate());
694 } 694 }
695 } else if (!resizing_mode_selector_->is_synchronous_mode()) { 695 } else if (!resizing_mode_selector_->is_synchronous_mode()) {
696 resize_ack = NO_RESIZE_ACK; 696 resize_ack = NO_RESIZE_ACK;
697 } 697 }
698 698
699 if (new_size.IsEmpty() || physical_backing_size.IsEmpty()) { 699 if (new_size.IsEmpty() || physical_backing_size.IsEmpty()) {
700 // For empty size or empty physical_backing_size, there is no next paint 700 // For empty size or empty physical_backing_size, there is no next paint
(...skipping 2134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 GetURLForGraphicsContext3D(), 2835 GetURLForGraphicsContext3D(),
2836 gpu_channel_host.get(), 2836 gpu_channel_host.get(),
2837 swap_client, 2837 swap_client,
2838 attributes, 2838 attributes,
2839 false /* bind generates resources */, 2839 false /* bind generates resources */,
2840 limits)); 2840 limits));
2841 return context.Pass(); 2841 return context.Pass();
2842 } 2842 }
2843 2843
2844 } // namespace content 2844 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/resizing_mode_selector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698