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

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

Issue 1252933003: Shrink SVG paint-order to take less bits (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Align with review comments Created 5 years, 4 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 | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/style/SVGComputedStyle.h » ('j') | 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) 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 707
708 return LengthPoint( 708 return LengthPoint(
709 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) , 709 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX) ,
710 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY) 710 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY)
711 ); 711 );
712 } 712 }
713 713
714 EPaintOrder StyleBuilderConverter::convertPaintOrder(StyleResolverState&, CSSVal ue* cssPaintOrder) 714 EPaintOrder StyleBuilderConverter::convertPaintOrder(StyleResolverState&, CSSVal ue* cssPaintOrder)
715 { 715 {
716 if (cssPaintOrder->isValueList()) { 716 if (cssPaintOrder->isValueList()) {
717 int paintOrder = 0; 717 const CSSValueList& orderTypeList = *toCSSValueList(cssPaintOrder);
718 const CSSValueList& list = *toCSSValueList(cssPaintOrder); 718 switch (toCSSPrimitiveValue(orderTypeList.item(0))->getValueID()) {
719 for (size_t i = 0; i < list.length(); ++i) { 719 case CSSValueFill:
720 EPaintOrderType paintOrderType = PT_NONE; 720 return orderTypeList.length() > 1 ? PaintOrderFillMarkersStroke : Pa intOrderFillStrokeMarkers;
721 switch (toCSSPrimitiveValue(list.item(i))->getValueID()) { 721 case CSSValueStroke:
722 case CSSValueFill: 722 return orderTypeList.length() > 1 ? PaintOrderStrokeMarkersFill : Pa intOrderStrokeFillMarkers;
723 paintOrderType = PT_FILL; 723 case CSSValueMarkers:
724 break; 724 return orderTypeList.length() > 1 ? PaintOrderMarkersStrokeFill : Pa intOrderMarkersFillStroke;
725 case CSSValueStroke: 725 default:
726 paintOrderType = PT_STROKE; 726 ASSERT_NOT_REACHED();
727 break; 727 return PaintOrderNormal;
728 case CSSValueMarkers:
729 paintOrderType = PT_MARKERS;
730 break;
731 default:
732 ASSERT_NOT_REACHED();
733 break;
734 }
735
736 paintOrder |= (paintOrderType << kPaintOrderBitwidth*i);
737 } 728 }
738 return (EPaintOrder)paintOrder;
739 } 729 }
740 730
741 return PO_NORMAL; 731 return PaintOrderNormal;
742 } 732 }
743 733
744 Length StyleBuilderConverter::convertQuirkyLength(StyleResolverState& state, CSS Value* value) 734 Length StyleBuilderConverter::convertQuirkyLength(StyleResolverState& state, CSS Value* value)
745 { 735 {
746 Length length = convertLengthOrAuto(state, value); 736 Length length = convertLengthOrAuto(state, value);
747 // This is only for margins which use __qem 737 // This is only for margins which use __qem
748 length.setQuirk(toCSSPrimitiveValue(value)->isQuirkValue()); 738 length.setQuirk(toCSSPrimitiveValue(value)->isQuirkValue());
749 return length; 739 return length;
750 } 740 }
751 741
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 double sz = 1; 962 double sz = 1;
973 if (list.length() >= 2) 963 if (list.length() >= 2)
974 sy = toCSSPrimitiveValue(list.item(1))->getDoubleValue(); 964 sy = toCSSPrimitiveValue(list.item(1))->getDoubleValue();
975 if (list.length() == 3) 965 if (list.length() == 3)
976 sz = toCSSPrimitiveValue(list.item(2))->getDoubleValue(); 966 sz = toCSSPrimitiveValue(list.item(2))->getDoubleValue();
977 967
978 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D); 968 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D);
979 } 969 }
980 970
981 } // namespace blink 971 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/parser/CSSPropertyParser.cpp ('k') | Source/core/style/SVGComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698