aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer/GMSlide.cpp
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2016-05-05 12:32:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-05-05 12:32:03 -0700
commita8d0d6c8bad00e713bc33e5f0d47ca4fec104433 (patch)
tree8f78250c57c9c9d96f8e2fac7864630c97fe3cb9 /tools/viewer/GMSlide.cpp
parent2d1ee7936e3536e45c963db004e3b512bb415fd8 (diff)
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
Diffstat (limited to 'tools/viewer/GMSlide.cpp')
-rw-r--r--tools/viewer/GMSlide.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/viewer/GMSlide.cpp b/tools/viewer/GMSlide.cpp
new file mode 100644
index 0000000000..6096044a38
--- /dev/null
+++ b/tools/viewer/GMSlide.cpp
@@ -0,0 +1,32 @@
+/*
+* 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);
+}