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

Side by Side Diff: Source/core/platform/graphics/filters/DistantLightSource.cpp

Issue 54803002: Centralize TextStream functions to remove RenderTreeAsText dependency of the filters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsLayer.cpp ('k') | Source/core/platform/graphics/filters/FEBlend.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698