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

Side by Side Diff: Source/platform/graphics/filters/SpotLightSource.h

Issue 1355713004: Drop virtual LightSource::create (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/filters/PointLightSource.h ('k') | no next file » | 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) 2008 Alex Mathews <possessedpenguinbob@gmail.com> 2 * Copyright (C) 2008 Alex Mathews <possessedpenguinbob@gmail.com>
3 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 4 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
5 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 18 matching lines...) Expand all
29 namespace blink { 29 namespace blink {
30 30
31 class PLATFORM_EXPORT SpotLightSource : public LightSource { 31 class PLATFORM_EXPORT SpotLightSource : public LightSource {
32 public: 32 public:
33 static PassRefPtr<SpotLightSource> create(const FloatPoint3D& position, 33 static PassRefPtr<SpotLightSource> create(const FloatPoint3D& position,
34 const FloatPoint3D& direction, float specularExponent, float limitingCon eAngle) 34 const FloatPoint3D& direction, float specularExponent, float limitingCon eAngle)
35 { 35 {
36 return adoptRef(new SpotLightSource(position, direction, specularExponen t, limitingConeAngle)); 36 return adoptRef(new SpotLightSource(position, direction, specularExponen t, limitingConeAngle));
37 } 37 }
38 38
39 PassRefPtr<LightSource> create(const FloatPoint3D& scale, const FloatSize& o ffset) const override
40 {
41 FloatPoint3D position(m_position.x() * scale.x() - offset.width(), m_pos ition.y() * scale.y() - offset.height(), m_position.z() * scale.z());
42 FloatPoint3D direction(m_direction.x() * scale.x() - offset.width(), m_d irection.y() * scale.y() - offset.height(), m_direction.z() * scale.z());
43 return adoptRef(new SpotLightSource(position, direction, m_specularExpon ent, m_limitingConeAngle));
44 }
45
46 const FloatPoint3D& position() const { return m_position; } 39 const FloatPoint3D& position() const { return m_position; }
47 const FloatPoint3D& direction() const { return m_direction; } 40 const FloatPoint3D& direction() const { return m_direction; }
48 float specularExponent() const { return m_specularExponent; } 41 float specularExponent() const { return m_specularExponent; }
49 float limitingConeAngle() const { return m_limitingConeAngle; } 42 float limitingConeAngle() const { return m_limitingConeAngle; }
50 43
51 bool setPosition(const FloatPoint3D&) override; 44 bool setPosition(const FloatPoint3D&) override;
52 bool setPointsAt(const FloatPoint3D&) override; 45 bool setPointsAt(const FloatPoint3D&) override;
53 46
54 bool setSpecularExponent(float) override; 47 bool setSpecularExponent(float) override;
55 bool setLimitingConeAngle(float) override; 48 bool setLimitingConeAngle(float) override;
(...skipping 14 matching lines...) Expand all
70 FloatPoint3D m_position; 63 FloatPoint3D m_position;
71 FloatPoint3D m_direction; 64 FloatPoint3D m_direction;
72 65
73 float m_specularExponent; 66 float m_specularExponent;
74 float m_limitingConeAngle; 67 float m_limitingConeAngle;
75 }; 68 };
76 69
77 } // namespace blink 70 } // namespace blink
78 71
79 #endif // SpotLightSource_h 72 #endif // SpotLightSource_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/filters/PointLightSource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698