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

Side by Side Diff: Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 678163002: Oilpan: move SVG property hierarchy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased upto r185213 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 } 753 }
754 754
755 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value) 755 float StyleBuilderConverter::convertSpacing(StyleResolverState& state, CSSValue* value)
756 { 756 {
757 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 757 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
758 if (primitiveValue->getValueID() == CSSValueNormal) 758 if (primitiveValue->getValueID() == CSSValueNormal)
759 return 0; 759 return 0;
760 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( )); 760 return primitiveValue->computeLength<float>(state.cssToLengthConversionData( ));
761 } 761 }
762 762
763 PassRefPtr<SVGLengthList> StyleBuilderConverter::convertStrokeDasharray(StyleRes olverState&, CSSValue* value) 763 PassRefPtrWillBeRawPtr<SVGLengthList> StyleBuilderConverter::convertStrokeDashar ray(StyleResolverState&, CSSValue* value)
764 { 764 {
765 if (!value->isValueList()) { 765 if (!value->isValueList())
766 return SVGRenderStyle::initialStrokeDashArray(); 766 return SVGRenderStyle::initialStrokeDashArray();
767 }
768 767
769 CSSValueList* dashes = toCSSValueList(value); 768 CSSValueList* dashes = toCSSValueList(value);
770 769
771 RefPtr<SVGLengthList> array = SVGLengthList::create(); 770 RefPtrWillBeRawPtr<SVGLengthList> array = SVGLengthList::create();
772 size_t length = dashes->length(); 771 size_t length = dashes->length();
773 for (size_t i = 0; i < length; ++i) { 772 for (size_t i = 0; i < length; ++i) {
774 CSSValue* currValue = dashes->item(i); 773 CSSValue* currValue = dashes->item(i);
775 if (!currValue->isPrimitiveValue()) 774 if (!currValue->isPrimitiveValue())
776 continue; 775 continue;
777 776
778 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i)); 777 CSSPrimitiveValue* dash = toCSSPrimitiveValue(dashes->item(i));
779 array->append(SVGLength::fromCSSPrimitiveValue(dash)); 778 array->append(SVGLength::fromCSSPrimitiveValue(dash));
780 } 779 }
781 780
(...skipping 10 matching lines...) Expand all
792 791
793 Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue * value) 792 Color StyleBuilderConverter::convertSVGColor(StyleResolverState& state, CSSValue * value)
794 { 793 {
795 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 794 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
796 if (primitiveValue->isRGBColor()) 795 if (primitiveValue->isRGBColor())
797 return primitiveValue->getRGBA32Value(); 796 return primitiveValue->getRGBA32Value();
798 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor); 797 ASSERT(primitiveValue->getValueID() == CSSValueCurrentcolor);
799 return state.style()->color(); 798 return state.style()->color();
800 } 799 }
801 800
802 PassRefPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleResolverState &, CSSValue* value) 801 PassRefPtrWillBeRawPtr<SVGLength> StyleBuilderConverter::convertSVGLength(StyleR esolverState&, CSSValue* value)
803 { 802 {
804 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value)); 803 return SVGLength::fromCSSPrimitiveValue(toCSSPrimitiveValue(value));
805 } 804 }
806 805
807 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value) 806 float StyleBuilderConverter::convertTextStrokeWidth(StyleResolverState& state, C SSValue* value)
808 { 807 {
809 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 808 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
810 if (primitiveValue->getValueID()) { 809 if (primitiveValue->getValueID()) {
811 float multiplier = convertLineWidth<float>(state, value); 810 float multiplier = convertLineWidth<float>(state, value);
812 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData()); 811 return CSSPrimitiveValue::create(multiplier / 48, CSSPrimitiveValue::CSS _EMS)->computeLength<float>(state.cssToLengthConversionData());
(...skipping 11 matching lines...) Expand all
824 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); 823 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2));
825 824
826 return TransformOrigin( 825 return TransformOrigin(
827 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , 826 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) ,
828 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) , 827 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) ,
829 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ) 828 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu eZ)
830 ); 829 );
831 } 830 }
832 831
833 } // namespace blink 832 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderConverter.h ('k') | Source/core/css/resolver/StyleResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698