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

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: Undo changes to LayerTreeAsText. 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FramePainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3709 matching lines...) Expand 10 before | Expand all | Expand 10 after
3720 return ScrollBehaviorInstant; 3720 return ScrollBehaviorInstant;
3721 } 3721 }
3722 3722
3723 void FrameView::paint(GraphicsContext& context, const CullRect& cullRect) const 3723 void FrameView::paint(GraphicsContext& context, const CullRect& cullRect) const
3724 { 3724 {
3725 paint(context, GlobalPaintNormalPhase, cullRect); 3725 paint(context, GlobalPaintNormalPhase, cullRect);
3726 } 3726 }
3727 3727
3728 void FrameView::paint(GraphicsContext& context, const GlobalPaintFlags globalPai ntFlags, const CullRect& cullRect) const 3728 void FrameView::paint(GraphicsContext& context, const GlobalPaintFlags globalPai ntFlags, const CullRect& cullRect) const
3729 { 3729 {
3730 // TODO(skyostil): Remove this early-out in favor of painting cached scrollb ars.
3731 if (shouldThrottleRendering())
3732 return;
3733 FramePainter(*this).paint(context, globalPaintFlags, cullRect); 3730 FramePainter(*this).paint(context, globalPaintFlags, cullRect);
3734 } 3731 }
3735 3732
3736 void FrameView::paintContents(GraphicsContext& context, const GlobalPaintFlags g lobalPaintFlags, const IntRect& damageRect) const 3733 void FrameView::paintContents(GraphicsContext& context, const GlobalPaintFlags g lobalPaintFlags, const IntRect& damageRect) const
3737 { 3734 {
3738 if (shouldThrottleRendering())
3739 return;
3740 FramePainter(*this).paintContents(context, globalPaintFlags, damageRect); 3735 FramePainter(*this).paintContents(context, globalPaintFlags, damageRect);
3741 } 3736 }
3742 3737
3743 bool FrameView::isPointInScrollbarCorner(const IntPoint& pointInRootFrame) 3738 bool FrameView::isPointInScrollbarCorner(const IntPoint& pointInRootFrame)
3744 { 3739 {
3745 if (!scrollbarCornerPresent()) 3740 if (!scrollbarCornerPresent())
3746 return false; 3741 return false;
3747 3742
3748 IntPoint framePoint = convertFromRootFrame(pointInRootFrame); 3743 IntPoint framePoint = convertFromRootFrame(pointInRootFrame);
3749 3744
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
4025 const SecurityOrigin* origin = frame().securityContext()->securityOrigin(); 4020 const SecurityOrigin* origin = frame().securityContext()->securityOrigin();
4026 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) { 4021 for (Frame* parentFrame = m_frame->tree().parent(); parentFrame; parentFrame = parentFrame->tree().parent()) {
4027 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->sec urityOrigin(); 4022 const SecurityOrigin* parentOrigin = parentFrame->securityContext()->sec urityOrigin();
4028 if (!origin->canAccess(parentOrigin)) { 4023 if (!origin->canAccess(parentOrigin)) {
4029 m_crossOriginForThrottling = true; 4024 m_crossOriginForThrottling = true;
4030 break; 4025 break;
4031 } 4026 }
4032 } 4027 }
4033 4028
4034 bool becameUnthrottled = wasThrottled && !canThrottleRendering(); 4029 bool becameUnthrottled = wasThrottled && !canThrottleRendering();
4035 if (becameUnthrottled) 4030 if (becameUnthrottled) {
4031 // Start ticking animation frames again if necessary.
4036 page()->animator().scheduleVisualUpdate(m_frame.get()); 4032 page()->animator().scheduleVisualUpdate(m_frame.get());
4033 // Force a full repaint of this frame to ensure we are not left with a
4034 // partially painted version of this frame's contents if we skipped
4035 // painting them while the frame was throttled.
4036 if (LayoutView* layoutView = this->layoutView())
4037 layoutView->setShouldDoFullPaintInvalidation(PaintInvalidationBecame Visible);
4038 }
4037 } 4039 }
4038 4040
4039 bool FrameView::shouldThrottleRendering() const 4041 bool FrameView::shouldThrottleRendering() const
4040 { 4042 {
4041 return canThrottleRendering() && lifecycle().throttlingAllowed(); 4043 return canThrottleRendering() && lifecycle().throttlingAllowed();
4042 } 4044 }
4043 4045
4044 bool FrameView::canThrottleRendering() const 4046 bool FrameView::canThrottleRendering() const
4045 { 4047 {
4046 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) 4048 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled())
4047 return false; 4049 return false;
4048 return m_hiddenForThrottling && m_crossOriginForThrottling; 4050 return m_hiddenForThrottling && m_crossOriginForThrottling;
4049 } 4051 }
4050 4052
4051 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4053 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4052 { 4054 {
4053 ASSERT(layoutView()); 4055 ASSERT(layoutView());
4054 return *layoutView(); 4056 return *layoutView();
4055 } 4057 }
4056 4058
4057 } // namespace blink 4059 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/FramePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698