44 surface->getCanvas()->drawPaint(bgPaint);
46 fCubeImage =
surface->makeImageSnapshot();
51 SkScalar radius = viewportWidth / 2.f;
53 SkM44 proj{1.f, 0.f, 0.f, 0.f,
56 0.f, 0.f, -1.f / radius, 1.f};
62 SkV4 axisAngles[6] = {
63 {0.f, 1.f, 0.f, -90.f},
65 {0.f, 1.f, 0.f, 90.f},
66 {0.f, 1.f, 0.f, 180.f},
67 {1.f, 0.f, 0.f, -90.f},
68 {1.f, 0.f, 0.f, 90.f},
79 for (
int i = 0;
i < 6; ++
i) {
83 zoom * rotateHorizontal * model * postZoom *
107 static const int kMaxVW = 800;
108 static const int kMinVW = 300;
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorTRANSPARENT
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorGREEN
#define SkDegreesToRadians(degrees)
#define SkScalarMod(x, y)
bool onAnimate(double nanos) override
SkString getName() const override
void onDraw(SkCanvas *canvas) override
SkISize getISize() override
void onOnceBeforeDraw() override
void drawRect(const SkRect &rect, const SkPaint &paint)
@ kFast_SrcRectConstraint
sample outside bounds; faster
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void concat(const SkMatrix &matrix)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
@ kInterpolateColorsInPremul_Flag
static SkM44 Rotate(SkV3 axis, SkScalar radians)
static SkM44 Translate(SkScalar x, SkScalar y, SkScalar z=0)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setShader(sk_sp< SkShader > shader)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static float Scaled(float time, float speed, float period=0)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)