skia2/tools/viewer/GMSlide.cpp
Hal Canary c74a55057b GM: s/handleKey/onChar/
Change-Id: I917de2705807f61e6a6c3f76d52e290e8194d204
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225936
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-08 22:28:50 +00:00

42 lines
1.0 KiB
C++

/*
* 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.
*/
#include "include/core/SkCanvas.h"
#include "tools/viewer/GMSlide.h"
GMSlide::GMSlide(skiagm::GM* gm) : fGM(gm) {
fName.printf("GM_%s", gm->getName());
}
GMSlide::~GMSlide() = default;
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);
}
bool GMSlide::animate(const AnimTimer& timer) { return fGM->animate(timer); }
bool GMSlide::onChar(SkUnichar c) { return fGM->onChar(c); }
bool GMSlide::onGetControls(SkMetaData* controls) {
return fGM->getControls(controls);
}
void GMSlide::onSetControls(const SkMetaData& controls) {
fGM->setControls(controls);
}