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

Side by Side Diff: Source/core/rendering/RenderObject.cpp

Issue 160903002: Move RenderLayer repainting to repaint-after-layout framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Rebase to master Created 6 years, 9 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 | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderView.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 // A positioned object has no effect on the min/max width of its con taining block ever. 734 // A positioned object has no effect on the min/max width of its con taining block ever.
735 // We can optimize this case and not go up any further. 735 // We can optimize this case and not go up any further.
736 break; 736 break;
737 o = container; 737 o = container;
738 } 738 }
739 } 739 }
740 740
741 void RenderObject::setLayerNeedsFullRepaint() 741 void RenderObject::setLayerNeedsFullRepaint()
742 { 742 {
743 ASSERT(hasLayer()); 743 ASSERT(hasLayer());
744 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsF ullRepaint); 744 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
745 setShouldDoFullRepaintAfterLayout(true);
746 else
747 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(Ne edsFullRepaint);
745 } 748 }
746 749
747 void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout() 750 void RenderObject::setLayerNeedsFullRepaintForPositionedMovementLayout()
748 { 751 {
749 ASSERT(hasLayer()); 752 ASSERT(hasLayer());
750 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsF ullRepaintForPositionedMovementLayout); 753 toRenderLayerModelObject(this)->layer()->repainter().setRepaintStatus(NeedsF ullRepaintForPositionedMovementLayout);
751 } 754 }
752 755
753 RenderBlock* RenderObject::containerForFixedPosition(const RenderLayerModelObjec t* repaintContainer, bool* repaintContainerSkipped) const 756 RenderBlock* RenderObject::containerForFixedPosition(const RenderLayerModelObjec t* repaintContainer, bool* repaintContainerSkipped) const
754 { 757 {
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 } 1618 }
1616 1619
1617 void RenderObject::repaintOverflowIfNeeded() 1620 void RenderObject::repaintOverflowIfNeeded()
1618 { 1621 {
1619 if (shouldRepaintOverflow()) 1622 if (shouldRepaintOverflow())
1620 repaintOverflow(); 1623 repaintOverflow();
1621 } 1624 }
1622 1625
1623 bool RenderObject::checkForRepaint() const 1626 bool RenderObject::checkForRepaint() const
1624 { 1627 {
1628 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
1629 return !document().view()->needsFullRepaint() && everHadLayout();
1630
1625 return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayou t(); 1631 return !document().view()->needsFullRepaint() && !hasLayer() && everHadLayou t();
1626 } 1632 }
1627 1633
1628 bool RenderObject::checkForRepaintDuringLayout() const 1634 bool RenderObject::checkForRepaintDuringLayout() const
1629 { 1635 {
1630 return !RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && checkForRepai nt(); 1636 return !RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && checkForRepai nt();
1631 } 1637 }
1632 1638
1633 LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const 1639 LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const
1634 { 1640 {
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
3307 { 3313 {
3308 ASSERT_NOT_REACHED(); 3314 ASSERT_NOT_REACHED();
3309 return false; 3315 return false;
3310 } 3316 }
3311 3317
3312 bool RenderObject::isRelayoutBoundaryForInspector() const 3318 bool RenderObject::isRelayoutBoundaryForInspector() const
3313 { 3319 {
3314 return objectIsRelayoutBoundary(this); 3320 return objectIsRelayoutBoundary(this);
3315 } 3321 }
3316 3322
3323 LayoutRect RenderObject::newOutlineRect()
3324 {
3325 ASSERT(hasOutline());
3326
3327 OutlineRects& outlineRects = view()->outlineRects();
3328 OutlineRects::iterator it = outlineRects.find(this);
3329 if (it == outlineRects.end())
3330 return outlineBoundsForRepaint(containerForRepaint());
3331 return it->value->newOutlineRect;
3332 }
3333
3334 void RenderObject::setNewOutlineRect(const LayoutRect& rect)
3335 {
3336 ASSERT(hasOutline());
3337
3338 OutlineRects& outlineRects = view()->outlineRects();
3339 OutlineRects::iterator it = outlineRects.find(this);
3340 if (it == outlineRects.end())
3341 outlineRects.set(this, adoptPtr(new OutlineRectInfo()));
3342
3343 outlineRects.get(this)->newOutlineRect = rect;
3344 }
3345
3346 LayoutRect RenderObject::oldOutlineRect()
3347 {
3348 ASSERT(hasOutline());
3349
3350 OutlineRects& outlineRects = view()->outlineRects();
3351 OutlineRects::iterator it = outlineRects.find(this);
3352 if (it == outlineRects.end())
3353 return LayoutRect();
3354 return it->value->oldOutlineRect;
3355 }
3356
3357 void RenderObject::setOldOutlineRect(const LayoutRect& rect)
3358 {
3359 ASSERT(hasOutline());
3360
3361 OutlineRects& outlineRects = view()->outlineRects();
3362 OutlineRects::iterator it = outlineRects.find(this);
3363 if (it == outlineRects.end())
3364 outlineRects.set(this, adoptPtr(new OutlineRectInfo()));
3365 outlineRects.get(this)->oldOutlineRect = rect;
3366 }
3367
3368 void RenderObject::clearRepaintState()
3369 {
3370 setShouldDoFullRepaintAfterLayout(false);
3371 setShouldDoFullRepaintIfSelfPaintingLayer(false);
3372 setShouldRepaintOverflow(false);
3373 setLayoutDidGetCalled(false);
3374
3375 OutlineRects& outlineRects = view()->outlineRects();
3376 OutlineRects::iterator it = outlineRects.find(this);
3377 if (it != outlineRects.end())
3378 outlineRects.remove(it);
3379 }
3380
3317 } // namespace WebCore 3381 } // namespace WebCore
3318 3382
3319 #ifndef NDEBUG 3383 #ifndef NDEBUG
3320 3384
3321 void showTree(const WebCore::RenderObject* object) 3385 void showTree(const WebCore::RenderObject* object)
3322 { 3386 {
3323 if (object) 3387 if (object)
3324 object->showTreeForThis(); 3388 object->showTreeForThis();
3325 } 3389 }
3326 3390
(...skipping 12 matching lines...) Expand all
3339 { 3403 {
3340 if (object1) { 3404 if (object1) {
3341 const WebCore::RenderObject* root = object1; 3405 const WebCore::RenderObject* root = object1;
3342 while (root->parent()) 3406 while (root->parent())
3343 root = root->parent(); 3407 root = root->parent();
3344 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3408 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3345 } 3409 }
3346 } 3410 }
3347 3411
3348 #endif 3412 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/core/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698