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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2782153002: Fix for performance regression on high dpi devices. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | no next file » | 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 Antti Koivisto (koivisto@kde.org) 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 includeLogicalLeftEdge, includeLogicalRightEdge); 1483 includeLogicalLeftEdge, includeLogicalRightEdge);
1484 } 1484 }
1485 1485
1486 FloatRoundedRect ComputedStyle::getRoundedInnerBorderFor( 1486 FloatRoundedRect ComputedStyle::getRoundedInnerBorderFor(
1487 const LayoutRect& borderRect, 1487 const LayoutRect& borderRect,
1488 const LayoutRectOutsets& insets, 1488 const LayoutRectOutsets& insets,
1489 bool includeLogicalLeftEdge, 1489 bool includeLogicalLeftEdge,
1490 bool includeLogicalRightEdge) const { 1490 bool includeLogicalRightEdge) const {
1491 LayoutRect innerRect(borderRect); 1491 LayoutRect innerRect(borderRect);
1492 innerRect.expand(insets); 1492 innerRect.expand(insets);
1493 innerRect.size().clampNegativeToZero(); 1493 LayoutSize innerRectSize = innerRect.size();
1494 innerRectSize.clampNegativeToZero();
1495 innerRect.setSize(innerRectSize);
1494 1496
1495 FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect)); 1497 FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect));
1496 1498
1497 if (hasBorderRadius()) { 1499 if (hasBorderRadius()) {
1498 FloatRoundedRect::Radii radii = getRoundedBorderFor(borderRect).getRadii(); 1500 FloatRoundedRect::Radii radii = getRoundedBorderFor(borderRect).getRadii();
1499 // Insets use negative values. 1501 // Insets use negative values.
1500 radii.shrink(-insets.top().toFloat(), -insets.bottom().toFloat(), 1502 radii.shrink(-insets.top().toFloat(), -insets.bottom().toFloat(),
1501 -insets.left().toFloat(), -insets.right().toFloat()); 1503 -insets.left().toFloat(), -insets.right().toFloat());
1502 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), 1504 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(),
1503 includeLogicalLeftEdge, 1505 includeLogicalLeftEdge,
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2475 if (value < 0) 2477 if (value < 0)
2476 fvalue -= 0.5f; 2478 fvalue -= 0.5f;
2477 else 2479 else
2478 fvalue += 0.5f; 2480 fvalue += 0.5f;
2479 } 2481 }
2480 2482
2481 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2483 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2482 } 2484 }
2483 2485
2484 } // namespace blink 2486 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698