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

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

Issue 2771093003: Performance fix for high dpi devices. (Closed)
Patch Set: Created 3 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 | « 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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 includeLogicalLeftEdge, includeLogicalRightEdge); 1509 includeLogicalLeftEdge, includeLogicalRightEdge);
1510 } 1510 }
1511 1511
1512 FloatRoundedRect ComputedStyle::getRoundedInnerBorderFor( 1512 FloatRoundedRect ComputedStyle::getRoundedInnerBorderFor(
1513 const LayoutRect& borderRect, 1513 const LayoutRect& borderRect,
1514 const LayoutRectOutsets& insets, 1514 const LayoutRectOutsets& insets,
1515 bool includeLogicalLeftEdge, 1515 bool includeLogicalLeftEdge,
1516 bool includeLogicalRightEdge) const { 1516 bool includeLogicalRightEdge) const {
1517 LayoutRect innerRect(borderRect); 1517 LayoutRect innerRect(borderRect);
1518 innerRect.expand(insets); 1518 innerRect.expand(insets);
1519 innerRect.size().clampNegativeToZero();
1519 1520
1520 FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect)); 1521 FloatRoundedRect roundedRect(pixelSnappedIntRect(innerRect));
1521 1522
1522 if (hasBorderRadius()) { 1523 if (hasBorderRadius()) {
1523 FloatRoundedRect::Radii radii = getRoundedBorderFor(borderRect).getRadii(); 1524 FloatRoundedRect::Radii radii = getRoundedBorderFor(borderRect).getRadii();
1524 // Insets use negative values. 1525 // Insets use negative values.
1525 radii.shrink(-insets.top().toFloat(), -insets.bottom().toFloat(), 1526 radii.shrink(-insets.top().toFloat(), -insets.bottom().toFloat(),
1526 -insets.left().toFloat(), -insets.right().toFloat()); 1527 -insets.left().toFloat(), -insets.right().toFloat());
1527 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(), 1528 roundedRect.includeLogicalEdges(radii, isHorizontalWritingMode(),
1528 includeLogicalLeftEdge, 1529 includeLogicalLeftEdge,
(...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after
2502 if (value < 0) 2503 if (value < 0)
2503 fvalue -= 0.5f; 2504 fvalue -= 0.5f;
2504 else 2505 else
2505 fvalue += 0.5f; 2506 fvalue += 0.5f;
2506 } 2507 }
2507 2508
2508 return roundForImpreciseConversion<int>(fvalue / zoomFactor); 2509 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
2509 } 2510 }
2510 2511
2511 } // namespace blink 2512 } // 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