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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSGradientValue.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2015 Google Inc. All rights reserved. 3 * Copyright (C) 2015 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 Color color; 97 Color color;
98 float offset; 98 float offset;
99 bool specified; 99 bool specified;
100 100
101 GradientStop() 101 GradientStop()
102 : offset(0) 102 : offset(0)
103 , specified(false) 103 , specified(false)
104 { } 104 { }
105 }; 105 };
106 106
107 static void replaceColorHintsWithColorStops(Vector<GradientStop>& stops, const W illBeHeapVector<CSSGradientColorStop, 2>& cssGradientStops) 107 static void replaceColorHintsWithColorStops(Vector<GradientStop>& stops, const H eapVector<CSSGradientColorStop, 2>& cssGradientStops)
108 { 108 {
109 // This algorithm will replace each color interpolation hint with 9 regular 109 // This algorithm will replace each color interpolation hint with 9 regular
110 // color stops. The color values for the new color stops will be calculated 110 // color stops. The color values for the new color stops will be calculated
111 // using the color weighting formula defined in the spec. The new color 111 // using the color weighting formula defined in the spec. The new color
112 // stops will be positioned in such a way that all the pixels between the tw o 112 // stops will be positioned in such a way that all the pixels between the tw o
113 // user defined color stops have color values close to the interpolation cur ve. 113 // user defined color stops have color values close to the interpolation cur ve.
114 // If the hint is closer to the left color stop, add 2 stops to the left and 114 // If the hint is closer to the left color stop, add 2 stops to the left and
115 // 6 to the right, else add 6 stops to the left and 2 to the right. 115 // 6 to the right, else add 6 stops to the left and 2 to the right.
116 // The color stops on the side with more space start midway because 116 // The color stops on the side with more space start midway because
117 // the curve approximates a line in that region. 117 // the curve approximates a line in that region.
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 566
567 bool CSSGradientValue::knownToBeOpaque(const LayoutObject& object) const 567 bool CSSGradientValue::knownToBeOpaque(const LayoutObject& object) const
568 { 568 {
569 for (auto& stop : m_stops) { 569 for (auto& stop : m_stops) {
570 if (!stop.isHint() && resolveStopColor(*stop.m_color, object).hasAlpha() ) 570 if (!stop.isHint() && resolveStopColor(*stop.m_color, object).hasAlpha() )
571 return false; 571 return false;
572 } 572 }
573 return true; 573 return true;
574 } 574 }
575 575
576 void CSSGradientValue::getStopColors(WillBeHeapVector<Color>& stopColors, const LayoutObject& object) const 576 void CSSGradientValue::getStopColors(HeapVector<Color>& stopColors, const Layout Object& object) const
577 { 577 {
578 for (auto& stop : m_stops) { 578 for (auto& stop : m_stops) {
579 if (!stop.isHint()) 579 if (!stop.isHint())
580 stopColors.append(resolveStopColor(*stop.m_color, object)); 580 stopColors.append(resolveStopColor(*stop.m_color, object));
581 } 581 }
582 582
583 } 583 }
584 584
585 DEFINE_TRACE_AFTER_DISPATCH(CSSGradientValue) 585 DEFINE_TRACE_AFTER_DISPATCH(CSSGradientValue)
586 { 586 {
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 visitor->trace(m_firstRadius); 1218 visitor->trace(m_firstRadius);
1219 visitor->trace(m_secondRadius); 1219 visitor->trace(m_secondRadius);
1220 visitor->trace(m_shape); 1220 visitor->trace(m_shape);
1221 visitor->trace(m_sizingBehavior); 1221 visitor->trace(m_sizingBehavior);
1222 visitor->trace(m_endHorizontalSize); 1222 visitor->trace(m_endHorizontalSize);
1223 visitor->trace(m_endVerticalSize); 1223 visitor->trace(m_endVerticalSize);
1224 CSSGradientValue::traceAfterDispatch(visitor); 1224 CSSGradientValue::traceAfterDispatch(visitor);
1225 } 1225 }
1226 1226
1227 } // namespace blink 1227 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGradientValue.h ('k') | third_party/WebKit/Source/core/css/CSSGridAutoRepeatValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698