OLD | NEW |
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 "chrome/browser/renderer_host/render_widget_host_view_views.h" | 5 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 | 770 |
771 about_to_validate_and_paint_ = true; | 771 about_to_validate_and_paint_ = true; |
772 BackingStore* backing_store = host_->GetBackingStore(true); | 772 BackingStore* backing_store = host_->GetBackingStore(true); |
773 // Calling GetBackingStore maybe have changed |invalid_rect_|... | 773 // Calling GetBackingStore maybe have changed |invalid_rect_|... |
774 about_to_validate_and_paint_ = false; | 774 about_to_validate_and_paint_ = false; |
775 | 775 |
776 gfx::Rect paint_rect = gfx::Rect(0, 0, kMaxWindowWidth, kMaxWindowHeight); | 776 gfx::Rect paint_rect = gfx::Rect(0, 0, kMaxWindowWidth, kMaxWindowHeight); |
777 paint_rect = paint_rect.Intersect(invalid_rect_); | 777 paint_rect = paint_rect.Intersect(invalid_rect_); |
778 | 778 |
779 if (backing_store) { | 779 if (backing_store) { |
780 #if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) | 780 #if defined(TOOLKIT_USES_GTK) |
781 // Only render the widget if it is attached to a window; there's a short | 781 // Only render the widget if it is attached to a window; there's a short |
782 // period where this object isn't attached to a window but hasn't been | 782 // period where this object isn't attached to a window but hasn't been |
783 // Destroy()ed yet and it receives paint messages... | 783 // Destroy()ed yet and it receives paint messages... |
784 if (IsReadyToPaint()) { | 784 if (IsReadyToPaint()) { |
785 #endif | 785 #endif |
786 if (!visually_deemphasized_) { | 786 if (!visually_deemphasized_) { |
787 // In the common case, use XCopyArea. We don't draw more than once, so | 787 // In the common case, use XCopyArea. We don't draw more than once, so |
788 // we don't need to double buffer. | 788 // we don't need to double buffer. |
789 if (IsPopup()) { | 789 if (IsPopup()) { |
790 origin.SetPoint(origin.x() + paint_rect.x(), | 790 origin.SetPoint(origin.x() + paint_rect.x(), |
791 origin.y() + paint_rect.y()); | 791 origin.y() + paint_rect.y()); |
792 paint_rect.SetRect(0, 0, paint_rect.width(), paint_rect.height()); | 792 paint_rect.SetRect(0, 0, paint_rect.width(), paint_rect.height()); |
793 } | 793 } |
794 static_cast<BackingStoreSkia*>(backing_store)->SkiaShowRect( | 794 static_cast<BackingStoreSkia*>(backing_store)->SkiaShowRect( |
795 gfx::Point(paint_rect.x(), paint_rect.y()), canvas); | 795 gfx::Point(paint_rect.x(), paint_rect.y()), canvas); |
796 } else { | 796 } else { |
797 // TODO(sad) | 797 // TODO(sad) |
798 NOTIMPLEMENTED(); | 798 NOTIMPLEMENTED(); |
799 } | 799 } |
800 #if defined(TOOLKIT_USES_GTK) && !defined(USE_AURA) | 800 #if defined(TOOLKIT_USES_GTK) |
801 } | 801 } |
802 #endif | 802 #endif |
803 if (!whiteout_start_time_.is_null()) { | 803 if (!whiteout_start_time_.is_null()) { |
804 base::TimeDelta whiteout_duration = base::TimeTicks::Now() - | 804 base::TimeDelta whiteout_duration = base::TimeTicks::Now() - |
805 whiteout_start_time_; | 805 whiteout_start_time_; |
806 UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); | 806 UMA_HISTOGRAM_TIMES("MPArch.RWHH_WhiteoutDuration", whiteout_duration); |
807 | 807 |
808 // Reset the start time to 0 so that we start recording again the next | 808 // Reset the start time to 0 so that we start recording again the next |
809 // time the backing store is NULL... | 809 // time the backing store is NULL... |
810 whiteout_start_time_ = base::TimeTicks(); | 810 whiteout_start_time_ = base::TimeTicks(); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 } | 1008 } |
1009 #endif | 1009 #endif |
1010 | 1010 |
1011 #if defined(USE_AURA) | 1011 #if defined(USE_AURA) |
1012 // static | 1012 // static |
1013 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1013 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1014 RenderWidgetHost* widget) { | 1014 RenderWidgetHost* widget) { |
1015 return new RenderWidgetHostViewViews(widget); | 1015 return new RenderWidgetHostViewViews(widget); |
1016 } | 1016 } |
1017 #endif | 1017 #endif |
OLD | NEW |