12#define FILTER_WIDTH_SMALL SkIntToScalar(32)
13#define FILTER_HEIGHT_SMALL SkIntToScalar(32)
14#define FILTER_WIDTH_LARGE SkIntToScalar(256)
15#define FILTER_HEIGHT_LARGE SkIntToScalar(256)
26 paint.setImageFilter(std::move(imageFilter));
27 for (
int i = 0;
i < loops;
i++) {
44 return distantDirection;
90 static SkColor white(0xFFFFFFFF);
104 return fIsSmall ?
"lightingpointlitdiffuse_small" :
"lightingpointlitdiffuse_large";
122 return fIsSmall ?
"lightingdistantlitdiffuse_small" :
"lightingdistantlitdiffuse_large";
140 return fIsSmall ?
"lightingspotlitdiffuse_small" :
"lightingspotlitdiffuse_large";
159 return fIsSmall ?
"lightingpointlitspecular_small" :
"lightingpointlitspecular_large";
178 return fIsSmall ?
"lightingdistantlitspecular_small" :
"lightingdistantlitspecular_large";
197 return fIsSmall ?
"lightingspotlitspecular_small" :
"lightingspotlitspecular_large";
#define FILTER_WIDTH_SMALL
#define FILTER_WIDTH_LARGE
#define FILTER_HEIGHT_SMALL
#define FILTER_HEIGHT_LARGE
#define SkDegreesToRadians(degrees)
#define SkScalarSin(radians)
#define SkScalarCos(radians)
static SkColor GetWhite()
static SkScalar GetShininess()
static SkScalar GetSurfaceScale()
static SkPoint3 GetSpotTarget()
static SkPoint3 GetSpotLocation()
void draw(int loops, SkCanvas *canvas, sk_sp< SkImageFilter > imageFilter) const
static SkScalar GetCutoffAngle()
LightingBaseBench(bool small)
static SkScalar GetSpotExponent()
static SkPoint3 GetDistantDirection()
static SkPoint3 GetPointLocation()
void onDraw(int loops, SkCanvas *canvas) override
LightingDistantLitDiffuseBench(bool small)
const char * onGetName() override
LightingDistantLitSpecularBench(bool small)
const char * onGetName() override
void onDraw(int loops, SkCanvas *canvas) override
void onDraw(int loops, SkCanvas *canvas) override
const char * onGetName() override
LightingPointLitDiffuseBench(bool small)
void onDraw(int loops, SkCanvas *canvas) override
LightingPointLitSpecularBench(bool small)
const char * onGetName() override
const char * onGetName() override
LightingSpotLitDiffuseBench(bool small)
void onDraw(int loops, SkCanvas *canvas) override
const char * onGetName() override
LightingSpotLitSpecularBench(bool small)
void onDraw(int loops, SkCanvas *canvas) override
void drawRect(const SkRect &rect, const SkPaint &paint)
static sk_sp< SkImageFilter > PointLitDiffuse(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DistantLitSpecular(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DistantLitDiffuse(const SkPoint3 &direction, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > PointLitSpecular(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitDiffuse(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > SpotLitSpecular(const SkPoint3 &location, const SkPoint3 &target, SkScalar falloffExponent, SkScalar cutoffAngle, SkColor lightColor, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
static constexpr SkRect MakeWH(float w, float h)