15d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com/*
25d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com * Copyright 2013 Google Inc.
35d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com *
45d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com * Use of this source code is governed by a BSD-style license that can be
55d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com * found in the LICENSE file.
65d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com */
7f168b86d7fafc5c20c87bebc6fd393cb17e120catfarina#include "Benchmark.h"
85d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#include "SkBitmapSource.h"
95d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#include "SkCanvas.h"
105d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#include "SkDevice.h"
115d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#include "SkLightingImageFilter.h"
125d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
135d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#define FILTER_WIDTH_SMALL  SkIntToScalar(32)
145d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#define FILTER_HEIGHT_SMALL SkIntToScalar(32)
155d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#define FILTER_WIDTH_LARGE  SkIntToScalar(256)
165d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com#define FILTER_HEIGHT_LARGE SkIntToScalar(256)
175d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
18f168b86d7fafc5c20c87bebc6fd393cb17e120catfarinaclass LightingBaseBench : public Benchmark {
195d71adf4b187b41858139675a499a704af15b2cbsugoi@google.compublic:
20410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.com    LightingBaseBench(bool small) : fIsSmall(small) { }
215d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
225d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprotected:
233361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org    void draw(const int loops, SkCanvas* canvas, SkImageFilter* imageFilter) const {
245d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        SkRect r = fIsSmall ? SkRect::MakeWH(FILTER_WIDTH_SMALL, FILTER_HEIGHT_SMALL) :
255d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com                              SkRect::MakeWH(FILTER_WIDTH_LARGE, FILTER_HEIGHT_LARGE);
265d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        SkPaint paint;
275d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        paint.setImageFilter(imageFilter)->unref();
283361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org        for (int i = 0; i < loops; i++) {
29c289743864e2ab926a95e617a5cd1d29b26d1825mtklein@google.com            canvas->drawRect(r, paint);
30c289743864e2ab926a95e617a5cd1d29b26d1825mtklein@google.com        }
315d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
325d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
335d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkPoint3 getPointLocation() {
345d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkPoint3 pointLocation(0, 0, SkIntToScalar(10));
355d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return pointLocation;
365d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
375d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
385d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkPoint3 getDistantDirection() {
395d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar azimuthRad = SkDegreesToRadians(SkIntToScalar(225));
405d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar elevationRad = SkDegreesToRadians(SkIntToScalar(5));
415d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkPoint3 distantDirection(SkScalarMul(SkScalarCos(azimuthRad),
425d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com                                                     SkScalarCos(elevationRad)),
435d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com                                         SkScalarMul(SkScalarSin(azimuthRad),
445d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com                                                     SkScalarCos(elevationRad)),
455d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com                                         SkScalarSin(elevationRad));
465d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return distantDirection;
475d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
485d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
495d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkPoint3 getSpotLocation() {
505d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkPoint3 spotLocation(SkIntToScalar(-10), SkIntToScalar(-10), SkIntToScalar(20));
515d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return spotLocation;
525d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
535d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
545d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkPoint3 getSpotTarget() {
555d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkPoint3 spotTarget(SkIntToScalar(40), SkIntToScalar(40), 0);
565d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return spotTarget;
575d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
585d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
595d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkScalar getSpotExponent() {
605d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar spotExponent = SK_Scalar1;
615d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return spotExponent;
625d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
635d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
645d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkScalar getCutoffAngle() {
655d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar cutoffAngle = SkIntToScalar(15);
665d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return cutoffAngle;
675d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
685d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
695d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkScalar getKd() {
705d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar kd = SkIntToScalar(2);
715d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return kd;
725d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
735d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
745d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkScalar getKs() {
755d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar ks = SkIntToScalar(1);
765d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return ks;
775d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
785d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
795d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkScalar getShininess() {
805d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar shininess = SkIntToScalar(8);
815d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return shininess;
825d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
835d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
845d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkScalar getSurfaceScale() {
855d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkScalar surfaceScale = SkIntToScalar(1);
865d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return surfaceScale;
875d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
885d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
895d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    static SkColor getWhite() {
905d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        static SkColor white(0xFFFFFFFF);
915d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return white;
925d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
935d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
945d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    bool fIsSmall;
95f168b86d7fafc5c20c87bebc6fd393cb17e120catfarina    typedef Benchmark INHERITED;
965d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com};
975d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
985d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comclass LightingPointLitDiffuseBench : public LightingBaseBench {
995d71adf4b187b41858139675a499a704af15b2cbsugoi@google.compublic:
100410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.com    LightingPointLitDiffuseBench(bool small) : INHERITED(small) {
1015d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1025d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1035d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprotected:
1045d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    virtual const char* onGetName() SK_OVERRIDE {
1055d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return fIsSmall ? "lightingpointlitdiffuse_small" : "lightingpointlitdiffuse_large";
1065d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1075d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1083361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org    virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
1093361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org        draw(loops, canvas, SkLightingImageFilter::CreatePointLitDiffuse(getPointLocation(),
1103361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getWhite(),
1113361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getSurfaceScale(),
1123361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getKd()));
1135d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1145d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1155d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprivate:
1165d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    typedef LightingBaseBench INHERITED;
1175d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com};
1185d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1195d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comclass LightingDistantLitDiffuseBench : public LightingBaseBench {
1205d71adf4b187b41858139675a499a704af15b2cbsugoi@google.compublic:
121410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.com    LightingDistantLitDiffuseBench(bool small) : INHERITED(small) {
1225d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1235d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1245d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprotected:
1255d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    virtual const char* onGetName() SK_OVERRIDE {
1265d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return fIsSmall ? "lightingdistantlitdiffuse_small" : "lightingdistantlitdiffuse_large";
1275d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1285d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1293361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org    virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
1303361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org        draw(loops, canvas, SkLightingImageFilter::CreateDistantLitDiffuse(getDistantDirection(),
1313361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                           getWhite(),
1323361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                           getSurfaceScale(),
1333361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                           getKd()));
1345d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1355d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1365d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprivate:
1375d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    typedef LightingBaseBench INHERITED;
1385d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com};
1395d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1405d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comclass LightingSpotLitDiffuseBench : public LightingBaseBench {
1415d71adf4b187b41858139675a499a704af15b2cbsugoi@google.compublic:
142410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.com    LightingSpotLitDiffuseBench(bool small) : INHERITED(small) {
1435d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1445d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1455d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprotected:
1465d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    virtual const char* onGetName() SK_OVERRIDE {
1475d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return fIsSmall ? "lightingspotlitdiffuse_small" : "lightingspotlitdiffuse_large";
1485d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1495d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1503361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org    virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
1513361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org        draw(loops, canvas, SkLightingImageFilter::CreateSpotLitDiffuse(getSpotLocation(),
1523361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                        getSpotTarget(),
1533361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                        getSpotExponent(),
1543361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                        getCutoffAngle(),
1553361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                        getWhite(),
1563361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                        getSurfaceScale(),
1573361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                        getKd()));
1585d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1595d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1605d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprivate:
1615d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    typedef LightingBaseBench INHERITED;
1625d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com};
1635d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1645d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comclass LightingPointLitSpecularBench : public LightingBaseBench {
1655d71adf4b187b41858139675a499a704af15b2cbsugoi@google.compublic:
166410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.com    LightingPointLitSpecularBench(bool small) : INHERITED(small) {
1675d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1685d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1695d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprotected:
1705d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    virtual const char* onGetName() SK_OVERRIDE {
1715d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return fIsSmall ? "lightingpointlitspecular_small" : "lightingpointlitspecular_large";
1725d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1735d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1743361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org    virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
1753361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org        draw(loops, canvas, SkLightingImageFilter::CreatePointLitSpecular(getPointLocation(),
1763361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                          getWhite(),
1773361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                          getSurfaceScale(),
1783361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                          getKs(),
1793361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                          getShininess()));
1805d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1815d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1825d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprivate:
1835d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    typedef LightingBaseBench INHERITED;
1845d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com};
1855d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1865d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comclass LightingDistantLitSpecularBench : public LightingBaseBench {
1875d71adf4b187b41858139675a499a704af15b2cbsugoi@google.compublic:
188410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.com    LightingDistantLitSpecularBench(bool small) : INHERITED(small) {
1895d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1905d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1915d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprotected:
1925d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    virtual const char* onGetName() SK_OVERRIDE {
1935d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return fIsSmall ? "lightingdistantlitspecular_small" : "lightingdistantlitspecular_large";
1945d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
1955d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
1963361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org    virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
1973361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org        draw(loops, canvas, SkLightingImageFilter::CreateDistantLitSpecular(getDistantDirection(),
1983361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                            getWhite(),
1993361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                            getSurfaceScale(),
2003361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                            getKs(),
2013361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                            getShininess()));
2025d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
2035d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
2045d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprivate:
2055d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    typedef LightingBaseBench INHERITED;
2065d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com};
2075d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
2085d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comclass LightingSpotLitSpecularBench : public LightingBaseBench {
2095d71adf4b187b41858139675a499a704af15b2cbsugoi@google.compublic:
210410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.com    LightingSpotLitSpecularBench(bool small) : INHERITED(small) {
2115d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
2125d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
2135d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprotected:
2145d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    virtual const char* onGetName() SK_OVERRIDE {
2155d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com        return fIsSmall ? "lightingspotlitspecular_small" : "lightingspotlitspecular_large";
2165d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
2175d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
2183361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org    virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
2193361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org        draw(loops, canvas, SkLightingImageFilter::CreateSpotLitSpecular(getSpotLocation(),
2203361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getSpotTarget(),
2213361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getSpotExponent(),
2223361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getCutoffAngle(),
2233361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getWhite(),
2243361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getSurfaceScale(),
2253361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getKs(),
2263361471a3504ecd0351ff70f4c42d8d6fee963d4commit-bot@chromium.org                                                                         getShininess()));
2275d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    }
2285d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
2295d71adf4b187b41858139675a499a704af15b2cbsugoi@google.comprivate:
2305d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com    typedef LightingBaseBench INHERITED;
2315d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com};
2325d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
2335d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com///////////////////////////////////////////////////////////////////////////////
2345d71adf4b187b41858139675a499a704af15b2cbsugoi@google.com
235410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingPointLitDiffuseBench(true); )
236410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingPointLitDiffuseBench(false); )
237410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingDistantLitDiffuseBench(true); )
238410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingDistantLitDiffuseBench(false); )
239410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingSpotLitDiffuseBench(true); )
240410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingSpotLitDiffuseBench(false); )
241410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingPointLitSpecularBench(true); )
242410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingPointLitSpecularBench(false); )
243410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingDistantLitSpecularBench(true); )
244410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingDistantLitSpecularBench(false); )
245410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingSpotLitSpecularBench(true); )
246410e6e80f00a6c660675c80904807a041c7b7d2amtklein@google.comDEF_BENCH( return new LightingSpotLitSpecularBench(false); )
247