47 font.setEmbolden(
true);
52 for (
int i = 0;
i < kNumAngles; ++
i) {
60 10.f, 10.f), fillPaint);
66 SkScalar labelX = 0.5f * kPosterSize - 0.5f * labelBounds.
width();
67 SkScalar labelY = 0.5f * kPosterSize + 0.5f * labelBounds.
height();
74 fPosterImages[
i] =
surface->makeImageSnapshot();
82 proj.
setRC(3, 2, -1.f / 800.f);
84 for (
int pass = 0; pass < 2; ++pass) {
89 bool drawFront = pass > 0;
91 for (
int y = 0;
y < 3; ++
y) {
92 float ringY = (
y - 1) * (kPosterSize + 10.f);
93 for (
int i = 0;
i < kNumAngles; ++
i) {
98 360.f *
SkScalarMod(fTime / yDuration, yDuration), 360.f);
100 static constexpr SkScalar kBackMinAngle = 70.f;
101 static constexpr SkScalar kBackMaxAngle = 290.f;
103 if (yRotation >= kBackMinAngle && yRotation <= kBackMaxAngle) {
108 if (yRotation < kBackMinAngle || yRotation > kBackMaxAngle) {
126 0.5f * kPosterSize, 0.5f * kPosterSize);
140 static const int kAngleStep = 30;
141 static const int kNumAngles = 12;
143 static const int kStageWidth = 600;
144 static const int kStageHeight = 400;
145 static const int kRingRadius = 200;
146 static const int kPosterSize = 100;
#define SkColorSetRGB(r, g, b)
@ kUTF8
uses bytes to represent UTF-8 or ASCII
#define SkDegreesToRadians(degrees)
#define SkScalarMod(x, y)
SkISize getISize() override
bool onAnimate(double nanos) override
void onDraw(SkCanvas *canvas) override
void onOnceBeforeDraw() override
SkString getName() const override
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void concat(const SkMatrix &matrix)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
@ kAntiAlias
may have transparent pixels on glyph edges
static SkM44 Rotate(SkV3 axis, SkScalar radians)
static SkM44 Translate(SkScalar x, SkScalar y, SkScalar z=0)
void setRC(int r, int c, SkScalar value)
void setColor(SkColor color)
void setAntiAlias(bool aa)
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
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)
font
Font Metadata and Metrics.
SkSamplingOptions(SkFilterMode::kLinear))
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
constexpr float height() const
constexpr float width() const
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)