#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
-///////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
/*
SkLightingShader TODOs:
};
SK_TO_STRING_OVERRIDE()
- SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(LightingShader)
+ SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkLightingShaderImpl)
protected:
void flatten(SkWriteBuffer&) const override;
SkLightingShader::Light fLight;
SkColor fAmbientColor; // linear (unpremul) color
+ friend class SkLightingShader;
+
typedef SkShader INHERITED;
};
for (int i = 0; i < n; ++i) {
SkASSERT(0xFF == SkColorGetA(tmpNormal2[i])); // opaque -> unpremul
- norm.set(SkIntToScalar(SkColorGetR(tmpNormal2[i]))-127.0f,
- SkIntToScalar(SkColorGetG(tmpNormal2[i]))-127.0f,
- SkIntToScalar(SkColorGetB(tmpNormal2[i]))-127.0f);
+ norm.set(SkIntToScalar(SkGetPackedR32(tmpNormal2[i]))-127.0f,
+ SkIntToScalar(SkGetPackedG32(tmpNormal2[i]))-127.0f,
+ SkIntToScalar(SkGetPackedB32(tmpNormal2[i]))-127.0f);
norm.normalize();
SkColor diffColor = SkUnPreMultiply::PMColorToColor(tmpColor2[i]);
}
///////////////////////////////////////////////////////////////////////////////
+
+SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader)
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl)
+SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
+
+///////////////////////////////////////////////////////////////////////////////
#include "SkLayerRasterizer.h"
#include "SkLerpXfermode.h"
#include "SkLightingImageFilter.h"
+#include "../effects/SkLightingShader.h"
#include "SkLocalMatrixShader.h"
#include "SkLumaColorFilter.h"
#include "SkMagnifierImageFilter.h"
SkColorFilter::InitializeFlattenables();
SkGradientShader::InitializeFlattenables();
SkLightingImageFilter::InitializeFlattenables();
+ SkLightingShader::InitializeFlattenables();
SkTableColorFilter::InitializeFlattenables();
SkXfermode::InitializeFlattenables();
}
#include "SkLayerRasterizer.h"
#include "SkLerpXfermode.h"
#include "SkLightingImageFilter.h"
+#include "../effects/SkLightingShader.h"
#include "SkLocalMatrixShader.h"
#include "SkLumaColorFilter.h"
#include "SkMagnifierImageFilter.h"
SkColorFilter::InitializeFlattenables();
SkGradientShader::InitializeFlattenables();
SkLightingImageFilter::InitializeFlattenables();
+ SkLightingShader::InitializeFlattenables();
SkTableColorFilter::InitializeFlattenables();
SkXfermode::InitializeFlattenables();
}