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

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: missed a virtual test Created 7 years 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 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 top = 0; 1268 top = 0;
1269 right = 0; 1269 right = 0;
1270 bottom = 0; 1270 bottom = 0;
1271 left = 0; 1271 left = 0;
1272 1272
1273 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1273 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1274 for (size_t i = 0; i < shadowCount; ++i) { 1274 for (size_t i = 0; i < shadowCount; ++i) {
1275 const ShadowData& shadow = shadowList->shadows()[i]; 1275 const ShadowData& shadow = shadowList->shadows()[i];
1276 if (shadow.style() == Inset) 1276 if (shadow.style() == Inset)
1277 continue; 1277 continue;
1278 int blurAndSpread = shadow.blur() + shadow.spread(); 1278 float blurAndSpread = shadow.blur() + shadow.spread();
1279 1279
1280 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread); 1280 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread);
1281 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread); 1281 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread);
1282 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread); 1282 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread);
1283 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread); 1283 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread);
1284 } 1284 }
1285 } 1285 }
1286 1286
1287 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowList* shadowList) const 1287 LayoutBoxExtent RenderStyle::getShadowInsetExtent(const ShadowList* shadowList) const
1288 { 1288 {
1289 LayoutUnit top = 0; 1289 LayoutUnit top = 0;
1290 LayoutUnit right = 0; 1290 LayoutUnit right = 0;
1291 LayoutUnit bottom = 0; 1291 LayoutUnit bottom = 0;
1292 LayoutUnit left = 0; 1292 LayoutUnit left = 0;
1293 1293
1294 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1294 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1295 for (size_t i = 0; i < shadowCount; ++i) { 1295 for (size_t i = 0; i < shadowCount; ++i) {
1296 const ShadowData& shadow = shadowList->shadows()[i]; 1296 const ShadowData& shadow = shadowList->shadows()[i];
1297 if (shadow.style() == Normal) 1297 if (shadow.style() == Normal)
1298 continue; 1298 continue;
1299 int blurAndSpread = shadow.blur() + shadow.spread(); 1299 float blurAndSpread = shadow.blur() + shadow.spread();
1300 top = max<LayoutUnit>(top, shadow.y() + blurAndSpread); 1300 top = max<LayoutUnit>(top, shadow.y() + blurAndSpread);
1301 right = min<LayoutUnit>(right, shadow.x() - blurAndSpread); 1301 right = min<LayoutUnit>(right, shadow.x() - blurAndSpread);
1302 bottom = min<LayoutUnit>(bottom, shadow.y() - blurAndSpread); 1302 bottom = min<LayoutUnit>(bottom, shadow.y() - blurAndSpread);
1303 left = max<LayoutUnit>(left, shadow.x() + blurAndSpread); 1303 left = max<LayoutUnit>(left, shadow.x() + blurAndSpread);
1304 } 1304 }
1305 1305
1306 return LayoutBoxExtent(top, right, bottom, left); 1306 return LayoutBoxExtent(top, right, bottom, left);
1307 } 1307 }
1308 1308
1309 void RenderStyle::getShadowHorizontalExtent(const ShadowList* shadowList, Layout Unit &left, LayoutUnit &right) const 1309 void RenderStyle::getShadowHorizontalExtent(const ShadowList* shadowList, Layout Unit &left, LayoutUnit &right) const
1310 { 1310 {
1311 left = 0; 1311 left = 0;
1312 right = 0; 1312 right = 0;
1313 1313
1314 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1314 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1315 for (size_t i = 0; i < shadowCount; ++i) { 1315 for (size_t i = 0; i < shadowCount; ++i) {
1316 const ShadowData& shadow = shadowList->shadows()[i]; 1316 const ShadowData& shadow = shadowList->shadows()[i];
1317 if (shadow.style() == Inset) 1317 if (shadow.style() == Inset)
1318 continue; 1318 continue;
1319 int blurAndSpread = shadow.blur() + shadow.spread(); 1319 float blurAndSpread = shadow.blur() + shadow.spread();
1320 1320
1321 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread); 1321 left = min<LayoutUnit>(left, shadow.x() - blurAndSpread);
1322 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread); 1322 right = max<LayoutUnit>(right, shadow.x() + blurAndSpread);
1323 } 1323 }
1324 } 1324 }
1325 1325
1326 void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, LayoutUn it &top, LayoutUnit &bottom) const 1326 void RenderStyle::getShadowVerticalExtent(const ShadowList* shadowList, LayoutUn it &top, LayoutUnit &bottom) const
1327 { 1327 {
1328 top = 0; 1328 top = 0;
1329 bottom = 0; 1329 bottom = 0;
1330 1330
1331 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0; 1331 size_t shadowCount = shadowList ? shadowList->shadows().size() : 0;
1332 for (size_t i = 0; i < shadowCount; ++i) { 1332 for (size_t i = 0; i < shadowCount; ++i) {
1333 const ShadowData& shadow = shadowList->shadows()[i]; 1333 const ShadowData& shadow = shadowList->shadows()[i];
1334 if (shadow.style() == Inset) 1334 if (shadow.style() == Inset)
1335 continue; 1335 continue;
1336 int blurAndSpread = shadow.blur() + shadow.spread(); 1336 float blurAndSpread = shadow.blur() + shadow.spread();
1337 1337
1338 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread); 1338 top = min<LayoutUnit>(top, shadow.y() - blurAndSpread);
1339 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread); 1339 bottom = max<LayoutUnit>(bottom, shadow.y() + blurAndSpread);
1340 } 1340 }
1341 } 1341 }
1342 1342
1343 Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) c onst 1343 Color RenderStyle::colorIncludingFallback(int colorProperty, bool visitedLink) c onst
1344 { 1344 {
1345 Color result; 1345 Color result;
1346 EBorderStyle borderStyle = BNONE; 1346 EBorderStyle borderStyle = BNONE;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1603 } 1603 }
1604 1604
1605 void RenderStyle::setBorderImageOutset(const BorderImageLengthBox& outset) 1605 void RenderStyle::setBorderImageOutset(const BorderImageLengthBox& outset)
1606 { 1606 {
1607 if (surround->border.m_image.outset() == outset) 1607 if (surround->border.m_image.outset() == outset)
1608 return; 1608 return;
1609 surround.access()->border.m_image.setOutset(outset); 1609 surround.access()->border.m_image.setOutset(outset);
1610 } 1610 }
1611 1611
1612 } // namespace WebCore 1612 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698