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_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 } | 700 } |
701 | 701 |
702 bool RenderWidgetHostViewAura::ShouldCreateResizeLock() { | 702 bool RenderWidgetHostViewAura::ShouldCreateResizeLock() { |
703 // On Windows while resizing, the the resize locks makes us mis-paint a white | 703 // On Windows while resizing, the the resize locks makes us mis-paint a white |
704 // vertical strip (including the non-client area) if the content composition | 704 // vertical strip (including the non-client area) if the content composition |
705 // is lagging the UI composition. So here we disable the throttling so that | 705 // is lagging the UI composition. So here we disable the throttling so that |
706 // the UI bits can draw ahead of the content thereby reducing the amount of | 706 // the UI bits can draw ahead of the content thereby reducing the amount of |
707 // whiteout. Because this causes the content to be drawn at wrong sizes while | 707 // whiteout. Because this causes the content to be drawn at wrong sizes while |
708 // resizing we compensate by blocking the UI thread in Compositor::Draw() by | 708 // resizing we compensate by blocking the UI thread in Compositor::Draw() by |
709 // issuing a FinishAllRendering() if we are resizing. | 709 // issuing a FinishAllRendering() if we are resizing. |
710 #if defined (OS_WIN) | 710 #if defined(OS_WIN) |
711 return false; | 711 return false; |
712 #endif | 712 #else |
713 | |
714 if (resize_lock_) | 713 if (resize_lock_) |
715 return false; | 714 return false; |
716 | 715 |
717 if (host_->should_auto_resize()) | 716 if (host_->should_auto_resize()) |
718 return false; | 717 return false; |
719 if (!host_->is_accelerated_compositing_active()) | 718 if (!host_->is_accelerated_compositing_active()) |
720 return false; | 719 return false; |
721 | 720 |
722 gfx::Size desired_size = window_->bounds().size(); | 721 gfx::Size desired_size = window_->bounds().size(); |
723 if (desired_size == current_frame_size_) | 722 if (desired_size == current_frame_size_) |
724 return false; | 723 return false; |
725 | 724 |
726 aura::WindowTreeHost* host = window_->GetHost(); | 725 aura::WindowTreeHost* host = window_->GetHost(); |
727 if (!host) | 726 if (!host) |
728 return false; | 727 return false; |
729 | 728 |
730 ui::Compositor* compositor = host->compositor(); | 729 ui::Compositor* compositor = host->compositor(); |
731 if (!compositor) | 730 if (!compositor) |
732 return false; | 731 return false; |
733 | 732 |
734 return true; | 733 return true; |
| 734 #endif |
735 } | 735 } |
736 | 736 |
737 scoped_ptr<ResizeLock> RenderWidgetHostViewAura::CreateResizeLock( | 737 scoped_ptr<ResizeLock> RenderWidgetHostViewAura::CreateResizeLock( |
738 bool defer_compositor_lock) { | 738 bool defer_compositor_lock) { |
739 gfx::Size desired_size = window_->bounds().size(); | 739 gfx::Size desired_size = window_->bounds().size(); |
740 return scoped_ptr<ResizeLock>(new CompositorResizeLock( | 740 return scoped_ptr<ResizeLock>(new CompositorResizeLock( |
741 window_->GetHost()->dispatcher(), | 741 window_->GetHost()->dispatcher(), |
742 desired_size, | 742 desired_size, |
743 defer_compositor_lock, | 743 defer_compositor_lock, |
744 base::TimeDelta::FromMilliseconds(kResizeLockTimeoutMs))); | 744 base::TimeDelta::FromMilliseconds(kResizeLockTimeoutMs))); |
(...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3595 RenderWidgetHost* widget) { | 3595 RenderWidgetHost* widget) { |
3596 return new RenderWidgetHostViewAura(widget); | 3596 return new RenderWidgetHostViewAura(widget); |
3597 } | 3597 } |
3598 | 3598 |
3599 // static | 3599 // static |
3600 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 3600 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
3601 GetScreenInfoForWindow(results, NULL); | 3601 GetScreenInfoForWindow(results, NULL); |
3602 } | 3602 } |
3603 | 3603 |
3604 } // namespace content | 3604 } // namespace content |
OLD | NEW |