OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org> | 5 * Copyright (C) 2010 Zoltan Herczeg <zherczeg@webkit.org> |
6 * Copyright (C) 2011 University of Szeged | 6 * Copyright (C) 2011 University of Szeged |
7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> | 7 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 14 matching lines...) Expand all Loading... |
25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 25 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
26 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "core/platform/graphics/filters/DistantLightSource.h" | 33 #include "core/platform/graphics/filters/DistantLightSource.h" |
34 | 34 |
35 #include "core/rendering/RenderTreeAsText.h" | 35 #include "platform/text/TextStream.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 void DistantLightSource::initPaintingData(PaintingData& paintingData) | 39 void DistantLightSource::initPaintingData(PaintingData& paintingData) |
40 { | 40 { |
41 float azimuth = deg2rad(m_azimuth); | 41 float azimuth = deg2rad(m_azimuth); |
42 float elevation = deg2rad(m_elevation); | 42 float elevation = deg2rad(m_elevation); |
43 paintingData.lightVector.setX(cosf(azimuth) * cosf(elevation)); | 43 paintingData.lightVector.setX(cosf(azimuth) * cosf(elevation)); |
44 paintingData.lightVector.setY(sinf(azimuth) * cosf(elevation)); | 44 paintingData.lightVector.setY(sinf(azimuth) * cosf(elevation)); |
45 paintingData.lightVector.setZ(sinf(elevation)); | 45 paintingData.lightVector.setZ(sinf(elevation)); |
(...skipping 22 matching lines...) Expand all Loading... |
68 | 68 |
69 TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const | 69 TextStream& DistantLightSource::externalRepresentation(TextStream& ts) const |
70 { | 70 { |
71 ts << "[type=DISTANT-LIGHT] "; | 71 ts << "[type=DISTANT-LIGHT] "; |
72 ts << "[azimuth=\"" << azimuth() << "\"]"; | 72 ts << "[azimuth=\"" << azimuth() << "\"]"; |
73 ts << "[elevation=\"" << elevation() << "\"]"; | 73 ts << "[elevation=\"" << elevation() << "\"]"; |
74 return ts; | 74 return ts; |
75 } | 75 } |
76 | 76 |
77 } // namespace WebCore | 77 } // namespace WebCore |
OLD | NEW |