diff options
author | Florin Malita <fmalita@chromium.org> | 2018-01-09 15:51:21 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-09 22:06:48 +0000 |
commit | df2713c447755a8b0ec7801d797d5ee9650b4bc2 (patch) | |
tree | 8c779ffd5063f3bb1f2e87328c6c2fcb14856d8f | |
parent | d8a39a08fef044140db0325cfe81fd4a23c92e27 (diff) |
[skotty] Minor tools tweaks
* fix "show inval" persistency in SkottySlide
* add frame-stamp to DM film strip
TBR=
Change-Id: I965b28fa25b4d6ddfa1ddf80f5f9187dff3f943c
Reviewed-on: https://skia-review.googlesource.com/92941
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
-rw-r--r-- | dm/DMSrcSink.cpp | 26 | ||||
-rw-r--r-- | tools/viewer/SkottySlide.cpp | 1 |
2 files changed, 18 insertions, 9 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index 1685dcbe96..d0c468159e 100644 --- a/dm/DMSrcSink.cpp +++ b/dm/DMSrcSink.cpp @@ -1341,11 +1341,13 @@ Error SkottySrc::draw(SkCanvas* canvas) const { canvas->drawColor(SK_ColorWHITE); - SkPaint paint; + SkPaint paint, clockPaint; paint.setColor(0xffa0a0a0); paint.setStyle(SkPaint::kStroke_Style); paint.setStrokeWidth(0); + clockPaint.setTextSize(12); + const auto ip = fAnimation->inPoint() * 1000 / fAnimation->frameRate(), op = fAnimation->outPoint() * 1000 / fAnimation->frameRate(), fr = (op - ip) / (kTileCount * kTileCount - 1); @@ -1360,15 +1362,21 @@ Error SkottySrc::draw(SkCanvas* canvas) const { canvas->drawLine(x + .5f, 0, x + .5f, canvas_size.height(), paint); SkRect dest = SkRect::MakeXYWH(x, y, fTileSize.width(), fTileSize.height()); - SkAutoCanvasRestore acr(canvas, true); - canvas->clipRect(dest); - canvas->concat(SkMatrix::MakeRectToRect(SkRect::MakeSize(fAnimation->size()), - dest, - SkMatrix::kFill_ScaleToFit)); - const auto t = fr * (i * kTileCount + j); - fAnimation->animationTick(t); - fAnimation->render(canvas); + { + SkAutoCanvasRestore acr(canvas, true); + canvas->clipRect(dest); + canvas->concat(SkMatrix::MakeRectToRect(SkRect::MakeSize(fAnimation->size()), + dest, + SkMatrix::kFill_ScaleToFit)); + + fAnimation->animationTick(t); + fAnimation->render(canvas); + } + + const auto label = SkStringPrintf("%.3f", t); + canvas->drawText(label.c_str(), label.size(), dest.x(), + dest.bottom(), clockPaint); } } diff --git a/tools/viewer/SkottySlide.cpp b/tools/viewer/SkottySlide.cpp index a26acf6172..99f182a7bb 100644 --- a/tools/viewer/SkottySlide.cpp +++ b/tools/viewer/SkottySlide.cpp @@ -21,6 +21,7 @@ void SkottySlide::load(SkScalar, SkScalar) { fTimeBase = 0; // force a time reset if (fAnimation) { + fAnimation->setShowInval(fShowAnimationInval); SkDebugf("loaded Bodymovin animation v: %s, size: [%f %f], fr: %f\n", fAnimation->version().c_str(), fAnimation->size().width(), |