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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#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);
|
|
|
|
}
|
2016-04-08 19:51:45 +00:00
|
|
|
|
|
|
|
bool GMSlide::animate(const SkAnimTimer& timer) {
|
|
|
|
return fGM->animate(timer);
|
|
|
|
}
|
2017-02-14 20:16:46 +00:00
|
|
|
|
|
|
|
bool GMSlide::onChar(SkUnichar c) {
|
|
|
|
return fGM->handleKey(c);
|
|
|
|
}
|