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

Side by Side Diff: sky/engine/platform/LengthFunctions.cpp

Issue 714783003: Remove some straggling zoom-related code. (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
« no previous file with comments | « sky/engine/platform/Length.h ('k') | sky/engine/platform/fonts/FontDescription.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) 1999 Lars Knoll (knoll@kde.org) 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved. 6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 case FillAvailable: 44 case FillAvailable:
45 case Auto: 45 case Auto:
46 return static_cast<float>(maximumValue); 46 return static_cast<float>(maximumValue);
47 case Calculated: 47 case Calculated:
48 return length.nonNanCalculatedValue(maximumValue); 48 return length.nonNanCalculatedValue(maximumValue);
49 case Intrinsic: 49 case Intrinsic:
50 case MinIntrinsic: 50 case MinIntrinsic:
51 case MinContent: 51 case MinContent:
52 case MaxContent: 52 case MaxContent:
53 case FitContent: 53 case FitContent:
54 case ExtendToZoom:
55 case DeviceWidth: 54 case DeviceWidth:
56 case DeviceHeight: 55 case DeviceHeight:
57 case MaxSizeNone: 56 case MaxSizeNone:
58 ASSERT_NOT_REACHED(); 57 ASSERT_NOT_REACHED();
59 return 0; 58 return 0;
60 } 59 }
61 ASSERT_NOT_REACHED(); 60 ASSERT_NOT_REACHED();
62 return 0; 61 return 0;
63 } 62 }
64 63
65 LayoutUnit minimumValueForLength(const Length& length, LayoutUnit maximumValue) 64 LayoutUnit minimumValueForLength(const Length& length, LayoutUnit maximumValue)
66 { 65 {
67 switch (length.type()) { 66 switch (length.type()) {
68 case Fixed: 67 case Fixed:
69 return length.value(); 68 return length.value();
70 case Percent: 69 case Percent:
71 // Don't remove the extra cast to float. It is needed for rounding on 32 -bit Intel machines that use the FPU stack. 70 // Don't remove the extra cast to float. It is needed for rounding on 32 -bit Intel machines that use the FPU stack.
72 return static_cast<float>(maximumValue * length.percent() / 100.0f); 71 return static_cast<float>(maximumValue * length.percent() / 100.0f);
73 case Calculated: 72 case Calculated:
74 return length.nonNanCalculatedValue(maximumValue); 73 return length.nonNanCalculatedValue(maximumValue);
75 case FillAvailable: 74 case FillAvailable:
76 case Auto: 75 case Auto:
77 return 0; 76 return 0;
78 case Intrinsic: 77 case Intrinsic:
79 case MinIntrinsic: 78 case MinIntrinsic:
80 case MinContent: 79 case MinContent:
81 case MaxContent: 80 case MaxContent:
82 case FitContent: 81 case FitContent:
83 case ExtendToZoom:
84 case DeviceWidth: 82 case DeviceWidth:
85 case DeviceHeight: 83 case DeviceHeight:
86 case MaxSizeNone: 84 case MaxSizeNone:
87 ASSERT_NOT_REACHED(); 85 ASSERT_NOT_REACHED();
88 return 0; 86 return 0;
89 } 87 }
90 ASSERT_NOT_REACHED(); 88 ASSERT_NOT_REACHED();
91 return 0; 89 return 0;
92 } 90 }
93 91
(...skipping 12 matching lines...) Expand all
106 case Calculated: 104 case Calculated:
107 return minimumValueForLength(length, maximumValue); 105 return minimumValueForLength(length, maximumValue);
108 case FillAvailable: 106 case FillAvailable:
109 case Auto: 107 case Auto:
110 return maximumValue; 108 return maximumValue;
111 case Intrinsic: 109 case Intrinsic:
112 case MinIntrinsic: 110 case MinIntrinsic:
113 case MinContent: 111 case MinContent:
114 case MaxContent: 112 case MaxContent:
115 case FitContent: 113 case FitContent:
116 case ExtendToZoom:
117 case DeviceWidth: 114 case DeviceWidth:
118 case DeviceHeight: 115 case DeviceHeight:
119 case MaxSizeNone: 116 case MaxSizeNone:
120 ASSERT_NOT_REACHED(); 117 ASSERT_NOT_REACHED();
121 return 0; 118 return 0;
122 } 119 }
123 ASSERT_NOT_REACHED(); 120 ASSERT_NOT_REACHED();
124 return 0; 121 return 0;
125 } 122 }
126 123
127 FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatSize& boxSize) 124 FloatSize floatSizeForLengthSize(const LengthSize& lengthSize, const FloatSize& boxSize)
128 { 125 {
129 return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width()), f loatValueForLength(lengthSize.height(), boxSize.height())); 126 return FloatSize(floatValueForLength(lengthSize.width(), boxSize.width()), f loatValueForLength(lengthSize.height(), boxSize.height()));
130 } 127 }
131 128
132 } // namespace blink 129 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/Length.h ('k') | sky/engine/platform/fonts/FontDescription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698