cd5104e942
Change-Id: I700b7c0461475062ac66712cc29070f150cf777d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202315 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
44 lines
1.0 KiB
C++
44 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 "GMSlide.h"
|
|
#include "SkCanvas.h"
|
|
|
|
GMSlide::GMSlide(skiagm::GM* gm) : fGM(gm) {
|
|
fName.printf("GM_%s", gm->getName());
|
|
}
|
|
|
|
GMSlide::~GMSlide() { delete fGM; }
|
|
|
|
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->handleKey(c);
|
|
}
|
|
|
|
bool GMSlide::onGetControls(SkMetaData* controls) {
|
|
return fGM->getControls(controls);
|
|
}
|
|
|
|
void GMSlide::onSetControls(const SkMetaData& controls) {
|
|
fGM->setControls(controls);
|
|
}
|
|
|