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

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 1603983002: Fix partial painting with render pipeline throttling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Invalidate paint for unthrottled frame. Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 3700 matching lines...) Expand 10 before | Expand all | Expand 10 after
3711 return ScrollBehaviorInstant; 3711 return ScrollBehaviorInstant;
3712 } 3712 }
3713 3713
3714 void FrameView::paint(GraphicsContext& context, const CullRect& cullRect) const 3714 void FrameView::paint(GraphicsContext& context, const CullRect& cullRect) const
3715 { 3715 {
3716 paint(context, GlobalPaintNormalPhase, cullRect); 3716 paint(context, GlobalPaintNormalPhase, cullRect);
3717 } 3717 }
3718 3718
3719 void FrameView::paint(GraphicsContext& context, const GlobalPaintFlags globalPai ntFlags, const CullRect& cullRect) const 3719 void FrameView::paint(GraphicsContext& context, const GlobalPaintFlags globalPai ntFlags, const CullRect& cullRect) const
3720 { 3720 {
3721 // TODO(skyostil): Remove this early-out in favor of painting cached scrollb ars.
3722 if (shouldThrottleRendering())
3723 return;
3724 FramePainter(*this).paint(context, globalPaintFlags, cullRect); 3721 FramePainter(*this).paint(context, globalPaintFlags, cullRect);
3725 } 3722 }
3726 3723
3727 void FrameView::paintContents(GraphicsContext& context, const GlobalPaintFlags g lobalPaintFlags, const IntRect& damageRect) const 3724 void FrameView::paintContents(GraphicsContext& context, const GlobalPaintFlags g lobalPaintFlags, const IntRect& damageRect) const
3728 { 3725 {
3729 if (shouldThrottleRendering())
3730 return;
3731 FramePainter(*this).paintContents(context, globalPaintFlags, damageRect); 3726 FramePainter(*this).paintContents(context, globalPaintFlags, damageRect);
3732 } 3727 }
3733 3728
3734 bool FrameView::isPointInScrollbarCorner(const IntPoint& pointInRootFrame) 3729 bool FrameView::isPointInScrollbarCorner(const IntPoint& pointInRootFrame)
3735 { 3730 {
3736 if (!scrollbarCornerPresent()) 3731 if (!scrollbarCornerPresent())
3737 return false; 3732 return false;
3738 3733
3739 IntPoint framePoint = convertFromRootFrame(pointInRootFrame); 3734 IntPoint framePoint = convertFromRootFrame(pointInRootFrame);
3740 3735
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
4016 const SecurityOrigin* origin = frame().securityContext()->securityOrigin(); 4011 const SecurityOrigin* origin = frame().securityContext()->securityOrigin();
4017 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) { 4012 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) {
4018 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->sec urityOrigin(); 4013 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->sec urityOrigin();
4019 if (!origin->canAccess(parentOrigin)) { 4014 if (!origin->canAccess(parentOrigin)) {
4020 m_crossOriginForThrottling = true; 4015 m_crossOriginForThrottling = true;
4021 break; 4016 break;
4022 } 4017 }
4023 } 4018 }
4024 4019
4025 bool becameUnthrottled = wasThrottled && !canThrottleRendering(); 4020 bool becameUnthrottled = wasThrottled && !canThrottleRendering();
4026 if (becameUnthrottled) 4021 if (becameUnthrottled) {
4022 // Start ticking animation frames again if necessary.
4027 page()->animator().scheduleVisualUpdate(m_frame.get()); 4023 page()->animator().scheduleVisualUpdate(m_frame.get());
4024 // Force a full repaint of this frame to ensure we are not left with a
4025 // partially painted version of this frame's contents if we skipped
4026 // painting them while the frame was throttled.
4027 if (LayoutView* layoutView = this->layoutView())
4028 layoutView->setShouldDoFullPaintInvalidation(PaintInvalidationBecame Visible);
4029 }
4028 } 4030 }
4029 4031
4030 bool FrameView::shouldThrottleRendering() const 4032 bool FrameView::shouldThrottleRendering() const
4031 { 4033 {
4032 return canThrottleRendering() && lifecycle().throttlingAllowed(); 4034 return canThrottleRendering() && lifecycle().throttlingAllowed();
4033 } 4035 }
4034 4036
4035 bool FrameView::canThrottleRendering() const 4037 bool FrameView::canThrottleRendering() const
4036 { 4038 {
4037 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4039 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4038 return false; 4040 return false;
4039 return m_hiddenForThrottling && m_crossOriginForThrottling; 4041 return m_hiddenForThrottling && m_crossOriginForThrottling;
4040 } 4042 }
4041 4043
4042 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4044 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4043 { 4045 {
4044 ASSERT(layoutView()); 4046 ASSERT(layoutView());
4045 return *layoutView(); 4047 return *layoutView();
4046 } 4048 }
4047 4049
4048 } // namespace blink 4050 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698