OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 University of Szeged | 2 * Copyright (C) 2010 University of Szeged |
3 * Copyright (C) 2010 Zoltan Herczeg | 3 * Copyright (C) 2010 Zoltan Herczeg |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "platform/graphics/Color.h" | 31 #include "platform/graphics/Color.h" |
32 #include "platform/graphics/filters/FilterEffect.h" | 32 #include "platform/graphics/filters/FilterEffect.h" |
33 | 33 |
34 // Common base class for FEDiffuseLighting and FESpecularLighting | 34 // Common base class for FEDiffuseLighting and FESpecularLighting |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class LightSource; | 38 class LightSource; |
39 | 39 |
40 class PLATFORM_EXPORT FELighting : public FilterEffect { | 40 class PLATFORM_EXPORT FELighting : public FilterEffect { |
41 public: | |
42 PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) overrid
e; | |
43 | |
44 protected: | 41 protected: |
45 enum LightingType { | 42 enum LightingType { |
46 DiffuseLighting, | 43 DiffuseLighting, |
47 SpecularLighting | 44 SpecularLighting |
48 }; | 45 }; |
49 | 46 |
| 47 PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder&) overrid
e; |
| 48 |
50 FloatRect mapPaintRect(const FloatRect&, bool forward = true) final; | 49 FloatRect mapPaintRect(const FloatRect&, bool forward = true) final; |
51 bool affectsTransparentPixels() override { return true; } | 50 bool affectsTransparentPixels() override { return true; } |
52 | 51 |
53 FELighting(Filter*, LightingType, const Color&, float, float, float, float,
PassRefPtr<LightSource>); | 52 FELighting(Filter*, LightingType, const Color&, float, float, float, float,
PassRefPtr<LightSource>); |
54 | 53 |
55 LightingType m_lightingType; | 54 LightingType m_lightingType; |
56 RefPtr<LightSource> m_lightSource; | 55 RefPtr<LightSource> m_lightSource; |
57 | 56 |
58 Color m_lightingColor; | 57 Color m_lightingColor; |
59 float m_surfaceScale; | 58 float m_surfaceScale; |
60 float m_diffuseConstant; | 59 float m_diffuseConstant; |
61 float m_specularConstant; | 60 float m_specularConstant; |
62 float m_specularExponent; | 61 float m_specularExponent; |
63 }; | 62 }; |
64 | 63 |
65 } // namespace blink | 64 } // namespace blink |
66 | 65 |
67 #endif // FELighting_h | 66 #endif // FELighting_h |
OLD | NEW |