a9d3cfbda2
This reverts commit 3b7587814d
.
Reason for revert: Failing on Housekeeper-PerCommit-CreateDockerImage_Skia_Release:
obj/tools/viewer/viewer.MSKPSlide.o
../../tools/viewer/MSKPSlide.cpp:64:23: error: no member named 'clamp' in namespace 'std'
fFrame = std::clamp(fFrame, 0, fPlayer->numFrames() - 1);
Original change's description:
> FPS and frame control for MSKP slide.
>
> Bug: skia:11900
> Change-Id: Ib4d8da6a86da7966e613de2d7cfd61ff545b296a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/400676
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com
Change-Id: I4a97deb1ac441f223977d2dbad2f93f5d4376a23
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11900
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402777
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
40 lines
995 B
C++
40 lines
995 B
C++
/*
|
|
* Copyright 2021 Google LLC
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef MSKPSlide_DEFINED
|
|
#define MSKPSlide_DEFINED
|
|
|
|
#include "tools/MSKPPlayer.h"
|
|
#include "tools/viewer/Slide.h"
|
|
|
|
class SkStreamSeekable;
|
|
|
|
class MSKPSlide : public Slide {
|
|
public:
|
|
MSKPSlide(const SkString& name, const SkString& path);
|
|
MSKPSlide(const SkString& name, std::unique_ptr<SkStreamSeekable>);
|
|
|
|
SkISize getDimensions() const override;
|
|
|
|
void draw(SkCanvas* canvas) override;
|
|
bool animate(double nanos) override;
|
|
void load(SkScalar winWidth, SkScalar winHeight) override;
|
|
void unload() override;
|
|
void gpuTeardown() override;
|
|
|
|
private:
|
|
std::unique_ptr<SkStreamSeekable> fStream;
|
|
std::unique_ptr<MSKPPlayer> fPlayer;
|
|
int fFrame = 0;
|
|
int fFPS = 15; // TODO: make this adjustable. This happens to work well for calendar.mskp
|
|
double fLastFrameTime = 0;
|
|
|
|
using INHERITED = Slide;
|
|
};
|
|
|
|
#endif
|