2016-04-08 14:24:09 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
/*
|
|
|
|
* Copyright 2014 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkCanvas.h"
|
|
|
|
#include "tools/viewer/GMSlide.h"
|
2016-04-08 14:24:09 +00:00
|
|
|
|
2019-08-12 20:39:24 +00:00
|
|
|
GMSlide::GMSlide(std::unique_ptr<skiagm::GM> gm) : fGM(std::move(gm)) {
|
|
|
|
fName.printf("GM_%s", fGM->getName());
|
2016-04-08 14:24:09 +00:00
|
|
|
}
|
|
|
|
|
2019-07-08 18:55:15 +00:00
|
|
|
GMSlide::~GMSlide() = default;
|
2016-04-08 14:24:09 +00:00
|
|
|
|
|
|
|
void GMSlide::draw(SkCanvas* canvas) {
|
|
|
|
// Do we care about timing the draw of the background (once)?
|
|
|
|
// Does the GM ever rely on drawBackground to lazily compute something?
|
|
|
|
fGM->drawBackground(canvas);
|
|
|
|
fGM->drawContent(canvas);
|
|
|
|
}
|
2016-04-08 19:51:45 +00:00
|
|
|
|
2019-07-11 20:32:53 +00:00
|
|
|
bool GMSlide::animate(double nanos) { return fGM->animate(nanos); }
|
2017-02-14 20:16:46 +00:00
|
|
|
|
2019-07-08 18:55:15 +00:00
|
|
|
bool GMSlide::onChar(SkUnichar c) { return fGM->onChar(c); }
|
2018-05-15 14:09:52 +00:00
|
|
|
|
|
|
|
bool GMSlide::onGetControls(SkMetaData* controls) {
|
|
|
|
return fGM->getControls(controls);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GMSlide::onSetControls(const SkMetaData& controls) {
|
|
|
|
fGM->setControls(controls);
|
|
|
|
}
|
|
|
|
|