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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 if (window_->bounds().size() != rect.size() && | 733 if (window_->bounds().size() != rect.size() && |
734 host_->is_accelerated_compositing_active()) { | 734 host_->is_accelerated_compositing_active()) { |
735 aura::RootWindow* root_window = window_->GetRootWindow(); | 735 aura::RootWindow* root_window = window_->GetRootWindow(); |
736 ui::Compositor* compositor = root_window ? | 736 ui::Compositor* compositor = root_window ? |
737 root_window->compositor() : NULL; | 737 root_window->compositor() : NULL; |
738 if (root_window && compositor) { | 738 if (root_window && compositor) { |
739 // Listen to changes in the compositor lock state. | 739 // Listen to changes in the compositor lock state. |
740 if (!compositor->HasObserver(this)) | 740 if (!compositor->HasObserver(this)) |
741 compositor->AddObserver(this); | 741 compositor->AddObserver(this); |
742 | 742 |
| 743 // On Windows while resizing, the the resize locks makes us mis-paint a white |
| 744 // vertical strip (including the non-client area) if the content composition is |
| 745 // lagging the UI composition. So here we disable the throttling so that the UI |
| 746 // bits can draw ahead of the content thereby reducing the amount of whiteout. |
| 747 // Because this causes the content to be drawn at wrong sizes while resizing |
| 748 // we compensated by another hack in Compositor::Draw that blocks the UI thread |
| 749 // for a fixed amount of time. |
| 750 #if !defined (OS_WIN) |
743 bool defer_compositor_lock = | 751 bool defer_compositor_lock = |
744 can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || | 752 can_lock_compositor_ == NO_PENDING_RENDERER_FRAME || |
745 can_lock_compositor_ == NO_PENDING_COMMIT; | 753 can_lock_compositor_ == NO_PENDING_COMMIT; |
746 | 754 |
747 if (can_lock_compositor_ == YES) | 755 if (can_lock_compositor_ == YES) |
748 can_lock_compositor_ = YES_DID_LOCK; | 756 can_lock_compositor_ = YES_DID_LOCK; |
749 | 757 |
750 resize_locks_.push_back(make_linked_ptr( | 758 resize_locks_.push_back(make_linked_ptr( |
751 new ResizeLock(root_window, rect.size(), defer_compositor_lock))); | 759 new ResizeLock(root_window, rect.size(), defer_compositor_lock))); |
| 760 #endif |
752 } | 761 } |
753 } | 762 } |
754 window_->SetBounds(rect); | 763 window_->SetBounds(rect); |
755 host_->WasResized(); | 764 host_->WasResized(); |
756 } | 765 } |
757 | 766 |
758 gfx::NativeView RenderWidgetHostViewAura::GetNativeView() const { | 767 gfx::NativeView RenderWidgetHostViewAura::GetNativeView() const { |
759 return window_; | 768 return window_; |
760 } | 769 } |
761 | 770 |
(...skipping 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2583 RenderWidgetHost* widget) { | 2592 RenderWidgetHost* widget) { |
2584 return new RenderWidgetHostViewAura(widget); | 2593 return new RenderWidgetHostViewAura(widget); |
2585 } | 2594 } |
2586 | 2595 |
2587 // static | 2596 // static |
2588 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 2597 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
2589 GetScreenInfoForWindow(results, NULL); | 2598 GetScreenInfoForWindow(results, NULL); |
2590 } | 2599 } |
2591 | 2600 |
2592 } // namespace content | 2601 } // namespace content |
OLD | NEW |