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

Side by Side Diff: Source/core/rendering/style/RenderStyle.cpp

Issue 23241010: Support subpixel values for text-shadow and box-shadow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed review comments Created 6 years, 11 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
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 reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 top = 0; 1256 top = 0;
1257 right = 0; 1257 right = 0;
1258 bottom = 0; 1258 bottom = 0;
1259 left = 0; 1259 left = 0;
1260 1260
1261 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1261 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1262 for (size_t i = 0; i < shadowCount; ++i) { 1262 for (size_t i = 0; i < shadowCount; ++i) {
1263 const ShadowData& shadow = shadowList->shadows()[i]; 1263 const ShadowData& shadow = shadowList->shadows()[i];
1264 if (shadow.style() == Inset) 1264 if (shadow.style() == Inset)
1265 continue; 1265 continue;
1266 int blurAndSpread = shadow.blur() + shadow.spread(); 1266 float blurAndSpread = shadow.blur() + shadow.spread();
1267 1267
1268 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread); 1268 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread);
1269 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread); 1269 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread);
1270 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread); 1270 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread);
1271 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread); 1271 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread);
1272 } 1272 }
1273 } 1273 }
1274 1274
1275 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowList* shadowList) const 1275 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowList* shadowList) const
1276 { 1276 {
1277 LayoutUnit top = 0; 1277 LayoutUnit top = 0;
1278 LayoutUnit right = 0; 1278 LayoutUnit right = 0;
1279 LayoutUnit bottom = 0; 1279 LayoutUnit bottom = 0;
1280 LayoutUnit left = 0; 1280 LayoutUnit left = 0;
1281 1281
1282 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1282 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1283 for (size_t i = 0; i < shadowCount; ++i) { 1283 for (size_t i = 0; i < shadowCount; ++i) {
1284 const ShadowData& shadow = shadowList->shadows()[i]; 1284 const ShadowData& shadow = shadowList->shadows()[i];
1285 if (shadow.style() == Normal) 1285 if (shadow.style() == Normal)
1286 continue; 1286 continue;
1287 int blurAndSpread = shadow.blur() + shadow.spread(); 1287 float blurAndSpread = shadow.blur() + shadow.spread();
1288 top = max<LayoutUnit>(top, shadow.y() + blurAndSpread); 1288 top = max<LayoutUnit>(top, shadow.y() + blurAndSpread);
1289 right = min<LayoutUnit>(right, shadow.x() - blurAndSpread); 1289 right = min<LayoutUnit>(right, shadow.x() - blurAndSpread);
1290 bottom = min<LayoutUnit>(bottom, shadow.y() - blurAndSpread); 1290 bottom = min<LayoutUnit>(bottom, shadow.y() - blurAndSpread);
1291 left = max<LayoutUnit>(left, shadow.x() + blurAndSpread); 1291 left = max<LayoutUnit>(left, shadow.x() + blurAndSpread);
1292 } 1292 }
1293 1293
1294 return LayoutBoxExtent(top, right, bottom, left); 1294 return LayoutBoxExtent(top, right, bottom, left);
1295 } 1295 }
1296 1296
1297 void RenderStyle::getShadowHorizontalExtent(const ShadowList* shadowList, Layout Unit &left, LayoutUnit &right) const 1297 void RenderStyle::getShadowHorizontalExtent(const ShadowList* shadowList, Layout Unit &left, LayoutUnit &right) const
1298 { 1298 {
1299 left = 0; 1299 left = 0;
1300 right = 0; 1300 right = 0;
1301 1301
1302 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1302 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1303 for (size_t i = 0; i < shadowCount; ++i) { 1303 for (size_t i = 0; i < shadowCount; ++i) {
1304 const ShadowData& shadow = shadowList->shadows()[i]; 1304 const ShadowData& shadow = shadowList->shadows()[i];
1305 if (shadow.style() == Inset) 1305 if (shadow.style() == Inset)
1306 continue; 1306 continue;
1307 int blurAndSpread = shadow.blur() + shadow.spread(); 1307 float blurAndSpread = shadow.blur() + shadow.spread();
1308 1308
1309 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread); 1309 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread);
1310 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread); 1310 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread);
1311 } 1311 }
1312 } 1312 }
1313 1313
1314 void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, LayoutUn it &top, LayoutUnit &bottom) const 1314 void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, LayoutUn it &top, LayoutUnit &bottom) const
1315 { 1315 {
1316 top = 0; 1316 top = 0;
1317 bottom = 0; 1317 bottom = 0;
1318 1318
1319 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1319 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1320 for (size_t i = 0; i < shadowCount; ++i) { 1320 for (size_t i = 0; i < shadowCount; ++i) {
1321 const ShadowData& shadow = shadowList->shadows()[i]; 1321 const ShadowData& shadow = shadowList->shadows()[i];
1322 if (shadow.style() == Inset) 1322 if (shadow.style() == Inset)
1323 continue; 1323 continue;
1324 int blurAndSpread = shadow.blur() + shadow.spread(); 1324 float blurAndSpread = shadow.blur() + shadow.spread();
1325 1325
1326 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread); 1326 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread);
1327 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread); 1327 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread);
1328 } 1328 }
1329 } 1329 }
1330 1330
1331 Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) c onst 1331 Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) c onst
1332 { 1332 {
1333 Color result; 1333 Color result;
1334 EBorderStyle borderStyle = BNONE; 1334 EBorderStyle borderStyle = BNONE;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 } 1591 }
1592 1592
1593 void RenderStyle::setBorderImageOutset(const BorderImageLengthBox& outset) 1593 void RenderStyle::setBorderImageOutset(const BorderImageLengthBox& outset)
1594 { 1594 {
1595 if (surround->border.m_image.outset() == outset) 1595 if (surround->border.m_image.outset() == outset)
1596 return; 1596 return;
1597 surround.access()->border.m_image.setOutset(outset); 1597 surround.access()->border.m_image.setOutset(outset);
1598 } 1598 }
1599 1599
1600 } // namespace WebCore 1600 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/style/ShadowData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698