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

Side by Side Diff: sky/engine/core/css/CSSGradientValue.cpp

Issue 711203002: Remove zoom() and effectiveZoom(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 value = pair->second(); 401 value = pair->second();
402 402
403 if (originID == CSSValueRight || originID == CSSValueBottom) { 403 if (originID == CSSValueRight || originID == CSSValueBottom) {
404 // For right/bottom, the offset is relative to the far edge. 404 // For right/bottom, the offset is relative to the far edge.
405 origin = edgeDistance; 405 origin = edgeDistance;
406 sign = -1; 406 sign = -1;
407 } 407 }
408 } 408 }
409 409
410 if (value->isNumber()) 410 if (value->isNumber())
411 return origin + sign * value->getFloatValue() * conversionData.zoom(); 411 return origin + sign * value->getFloatValue();
412 412
413 if (value->isPercentage()) 413 if (value->isPercentage())
414 return origin + sign * value->getFloatValue() / 100.f * edgeDistance; 414 return origin + sign * value->getFloatValue() / 100.f * edgeDistance;
415 415
416 if (value->isCalculatedPercentageWithLength()) 416 if (value->isCalculatedPercentageWithLength())
417 return origin + sign * value->cssCalcValue()->toCalcValue(conversionData )->evaluate(edgeDistance); 417 return origin + sign * value->cssCalcValue()->toCalcValue(conversionData )->evaluate(edgeDistance);
418 418
419 switch (value->getValueID()) { 419 switch (value->getValueID()) {
420 case CSSValueTop: 420 case CSSValueTop:
421 ASSERT(!isHorizontal); 421 ASSERT(!isHorizontal);
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 } 912 }
913 913
914 result.append(')'); 914 result.append(')');
915 return result.toString(); 915 return result.toString();
916 } 916 }
917 917
918 float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const CSS ToLengthConversionData& conversionData, float* widthOrHeight) 918 float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const CSS ToLengthConversionData& conversionData, float* widthOrHeight)
919 { 919 {
920 float result = 0; 920 float result = 0;
921 if (radius->isNumber()) // Can the radius be a percentage? 921 if (radius->isNumber()) // Can the radius be a percentage?
922 result = radius->getFloatValue() * conversionData.zoom(); 922 result = radius->getFloatValue();
923 else if (widthOrHeight && radius->isPercentage()) 923 else if (widthOrHeight && radius->isPercentage())
924 result = *widthOrHeight * radius->getFloatValue() / 100; 924 result = *widthOrHeight * radius->getFloatValue() / 100;
925 else 925 else
926 result = radius->computeLength<float>(conversionData); 926 result = radius->computeLength<float>(conversionData);
927 927
928 return result; 928 return result;
929 } 929 }
930 930
931 static float distanceToClosestCorner(const FloatPoint& p, const FloatSize& size, FloatPoint& corner) 931 static float distanceToClosestCorner(const FloatPoint& p, const FloatSize& size, FloatPoint& corner)
932 { 932 {
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 visitor->trace(m_firstRadius); 1198 visitor->trace(m_firstRadius);
1199 visitor->trace(m_secondRadius); 1199 visitor->trace(m_secondRadius);
1200 visitor->trace(m_shape); 1200 visitor->trace(m_shape);
1201 visitor->trace(m_sizingBehavior); 1201 visitor->trace(m_sizingBehavior);
1202 visitor->trace(m_endHorizontalSize); 1202 visitor->trace(m_endHorizontalSize);
1203 visitor->trace(m_endVerticalSize); 1203 visitor->trace(m_endVerticalSize);
1204 CSSGradientValue::traceAfterDispatch(visitor); 1204 CSSGradientValue::traceAfterDispatch(visitor);
1205 } 1205 }
1206 1206
1207 } // namespace blink 1207 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/animation/css/CSSAnimatableValueFactory.cpp ('k') | sky/engine/core/css/CSSMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698