OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The Android Open Source Project | 2 * Copyright 2012 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkLightingImageFilter.h" | 8 #include "SkLightingImageFilter.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 surfaceScale, ks, shininess, input, cropRect)); | 860 surfaceScale, ks, shininess, input, cropRect)); |
861 } | 861 } |
862 | 862 |
863 SkLightingImageFilter::~SkLightingImageFilter() { | 863 SkLightingImageFilter::~SkLightingImageFilter() { |
864 fLight->unref(); | 864 fLight->unref(); |
865 } | 865 } |
866 | 866 |
867 SkLightingImageFilter::SkLightingImageFilter(SkFlattenableReadBuffer& buffer) | 867 SkLightingImageFilter::SkLightingImageFilter(SkFlattenableReadBuffer& buffer) |
868 : INHERITED(buffer) | 868 : INHERITED(buffer) |
869 { | 869 { |
870 fLight = buffer.readFlattenableT<SkLight>(); | 870 fLight = buffer.readLight(); |
871 fSurfaceScale = buffer.readScalar(); | 871 fSurfaceScale = buffer.readScalar(); |
872 } | 872 } |
873 | 873 |
874 void SkLightingImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const { | 874 void SkLightingImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const { |
875 this->INHERITED::flatten(buffer); | 875 this->INHERITED::flatten(buffer); |
876 buffer.writeFlattenable(fLight); | 876 buffer.writeFlattenable(fLight); |
877 buffer.writeScalar(fSurfaceScale); | 877 buffer.writeScalar(fSurfaceScale); |
878 } | 878 } |
879 | 879 |
880 /////////////////////////////////////////////////////////////////////////////// | 880 /////////////////////////////////////////////////////////////////////////////// |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 | 1559 |
1560 #endif | 1560 #endif |
1561 | 1561 |
1562 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) | 1562 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) |
1563 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) | 1563 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) |
1564 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) | 1564 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) |
1565 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDistantLight) | 1565 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDistantLight) |
1566 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPointLight) | 1566 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPointLight) |
1567 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpotLight) | 1567 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpotLight) |
1568 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1568 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |