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 28 matching lines...) Expand all Loading... |
39 FELighting::FELighting(Filter* filter, | 39 FELighting::FELighting(Filter* filter, |
40 LightingType lightingType, | 40 LightingType lightingType, |
41 const Color& lightingColor, | 41 const Color& lightingColor, |
42 float surfaceScale, | 42 float surfaceScale, |
43 float diffuseConstant, | 43 float diffuseConstant, |
44 float specularConstant, | 44 float specularConstant, |
45 float specularExponent, | 45 float specularExponent, |
46 PassRefPtr<LightSource> lightSource) | 46 PassRefPtr<LightSource> lightSource) |
47 : FilterEffect(filter), | 47 : FilterEffect(filter), |
48 m_lightingType(lightingType), | 48 m_lightingType(lightingType), |
49 m_lightSource(lightSource), | 49 m_lightSource(std::move(lightSource)), |
50 m_lightingColor(lightingColor), | 50 m_lightingColor(lightingColor), |
51 m_surfaceScale(surfaceScale), | 51 m_surfaceScale(surfaceScale), |
52 m_diffuseConstant(std::max(diffuseConstant, 0.0f)), | 52 m_diffuseConstant(std::max(diffuseConstant, 0.0f)), |
53 m_specularConstant(std::max(specularConstant, 0.0f)), | 53 m_specularConstant(std::max(specularConstant, 0.0f)), |
54 m_specularExponent(clampTo(specularExponent, 1.0f, 128.0f)) {} | 54 m_specularExponent(clampTo(specularExponent, 1.0f, 128.0f)) {} |
55 | 55 |
56 sk_sp<SkImageFilter> FELighting::createImageFilter() { | 56 sk_sp<SkImageFilter> FELighting::createImageFilter() { |
57 if (!m_lightSource) | 57 if (!m_lightSource) |
58 return createTransparentBlack(); | 58 return createTransparentBlack(); |
59 | 59 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 lightColor.rgb(), m_surfaceScale, m_diffuseConstant, std::move(input), | 116 lightColor.rgb(), m_surfaceScale, m_diffuseConstant, std::move(input), |
117 &rect); | 117 &rect); |
118 } | 118 } |
119 default: | 119 default: |
120 ASSERT_NOT_REACHED(); | 120 ASSERT_NOT_REACHED(); |
121 return nullptr; | 121 return nullptr; |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 } // namespace blink | 125 } // namespace blink |
OLD | NEW |