blob: cfd4853330bbc4ccf2c7a4776f6ed82ca0aa225f [file] [log] [blame]
jvanverth2bb3b6d2016-04-08 07:24:09 -07001/*
2* Copyright 2016 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7/*
8* Copyright 2014 Google Inc.
9*
10* Use of this source code is governed by a BSD-style license that can be
11* found in the LICENSE file.
12*/
13
14#include "GMSlide.h"
15#include "SkCanvas.h"
16
17GMSlide::GMSlide(skiagm::GM* gm) : fGM(gm) {
18 fName.printf("GM_%s", gm->getName());
19}
20
21GMSlide::~GMSlide() { delete fGM; }
22
23void GMSlide::draw(SkCanvas* canvas) {
24 // Do we care about timing the draw of the background (once)?
25 // Does the GM ever rely on drawBackground to lazily compute something?
26 fGM->drawBackground(canvas);
27 fGM->drawContent(canvas);
28}
jvanverthc265a922016-04-08 12:51:45 -070029
30bool GMSlide::animate(const SkAnimTimer& timer) {
31 return fGM->animate(timer);
32}
Jim Van Verth6f449692017-02-14 15:16:46 -050033
34bool GMSlide::onChar(SkUnichar c) {
35 return fGM->handleKey(c);
36}
Mike Reed81f60ec2018-05-15 10:09:52 -040037
38bool GMSlide::onGetControls(SkMetaData* controls) {
39 return fGM->getControls(controls);
40}
41
42void GMSlide::onSetControls(const SkMetaData& controls) {
43 fGM->setControls(controls);
44}
45