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

Side by Side Diff: Source/core/rendering/compositing/RenderLayerCompositor.cpp

Issue 226523005: Remove IntSize::area, and rename IntSize::area_safe() to IntSize::area() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/platform/geometry/IntSize.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) 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 return true; 651 return true;
652 } 652 }
653 return false; 653 return false;
654 } 654 }
655 655
656 bool RenderLayerCompositor::squashingWouldExceedSparsityTolerance(const RenderLa yer* candidate, const RenderLayerCompositor::SquashingState& squashingState) 656 bool RenderLayerCompositor::squashingWouldExceedSparsityTolerance(const RenderLa yer* candidate, const RenderLayerCompositor::SquashingState& squashingState)
657 { 657 {
658 IntRect bounds = candidate->ancestorDependentProperties().clippedAbsoluteBou ndingBox; 658 IntRect bounds = candidate->ancestorDependentProperties().clippedAbsoluteBou ndingBox;
659 IntRect newBoundingRect = squashingState.boundingRect; 659 IntRect newBoundingRect = squashingState.boundingRect;
660 newBoundingRect.unite(bounds); 660 newBoundingRect.unite(bounds);
661 const uint64_t newBoundingRectArea = newBoundingRect.size().area_safe(); 661 const uint64_t newBoundingRectArea = newBoundingRect.size().area();
662 const uint64_t newSquashedArea = squashingState.totalAreaOfSquashedRects + b ounds.size().area_safe(); 662 const uint64_t newSquashedArea = squashingState.totalAreaOfSquashedRects + b ounds.size().area();
663 return newBoundingRectArea > gSquashingSparsityTolerance * newSquashedArea; 663 return newBoundingRectArea > gSquashingSparsityTolerance * newSquashedArea;
664 } 664 }
665 665
666 bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer * layer, const RenderLayerCompositor::SquashingState& squashingState) 666 bool RenderLayerCompositor::canSquashIntoCurrentSquashingOwner(const RenderLayer * layer, const RenderLayerCompositor::SquashingState& squashingState)
667 { 667 {
668 if (squashingWouldExceedSparsityTolerance(layer, squashingState)) 668 if (squashingWouldExceedSparsityTolerance(layer, squashingState))
669 return false; 669 return false;
670 670
671 // FIXME: this is not efficient, since it walks up the tree . We should stor e these values on the AncestorDependentPropertiesCache. 671 // FIXME: this is not efficient, since it walks up the tree . We should stor e these values on the AncestorDependentPropertiesCache.
672 ASSERT(squashingState.hasMostRecentMapping); 672 ASSERT(squashingState.hasMostRecentMapping);
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 } else if (graphicsLayer == m_scrollLayer.get()) { 1700 } else if (graphicsLayer == m_scrollLayer.get()) {
1701 name = "LocalFrame Scrolling Layer"; 1701 name = "LocalFrame Scrolling Layer";
1702 } else { 1702 } else {
1703 ASSERT_NOT_REACHED(); 1703 ASSERT_NOT_REACHED();
1704 } 1704 }
1705 1705
1706 return name; 1706 return name;
1707 } 1707 }
1708 1708
1709 } // namespace WebCore 1709 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/platform/geometry/IntSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698