skia2/tools/viewer/GMSlide.cpp
jvanverth a8d0d6c8ba More refactoring for Viewer
* Move support files into sk_app and main files up to top directory
* Rename VulkanTestContext and create WindowContext parent class
* Place VulkanWindowContext et al. in sk_app namespace.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1944413005

Review-Url: https://codereview.chromium.org/1944413005
2016-05-05 12:32:03 -07:00

33 lines
781 B
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 SkAnimTimer& timer) {
return fGM->animate(timer);
}