aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/gm.cpp
diff options
context:
space:
mode:
authorGravatar tfarina <tfarina@chromium.org>2014-06-07 20:50:44 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-07 20:50:44 -0700
commit52e4f413ffe2d281f9e90ff2147db08083ffcba7 (patch)
treee634f5fa3e03aa48bdb9cdd7a3399b7aca967765 /gm/gm.cpp
parent3d06b48660e389a4e4c060ac8b6b0ba49363c853 (diff)
Clean up resourcePath code.
1) Make the implementation of SetResourcePath/GetResourcePath of GM and SkBenchmark match with the one in Test. 2) Make gResourcePath a static pointer to const char and move it inside the classes. BUG=None TEST=make tests && out/Debug/tests make gm && out/Debug/gm make bench && out/Debug/bench R=mtklein@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/319473003
Diffstat (limited to 'gm/gm.cpp')
-rw-r--r--gm/gm.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/gm/gm.cpp b/gm/gm.cpp
index 803874f5bc..8da45c5fcb 100644
--- a/gm/gm.cpp
+++ b/gm/gm.cpp
@@ -6,9 +6,10 @@
*/
#include "gm.h"
+
using namespace skiagm;
-SkString GM::gResourcePath;
+const char* GM::gResourcePath;
GM::GM() {
fMode = kGM_Mode;
@@ -17,6 +18,7 @@ GM::GM() {
fHaveCalledOnceBeforeDraw = false;
fStarterMatrix.reset();
}
+
GM::~GM() {}
void GM::draw(SkCanvas* canvas) {
@@ -64,5 +66,13 @@ void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) {
canvas->drawRect(r, paint);
}
+void GM::SetResourcePath(const char* resourcePath) {
+ gResourcePath = resourcePath;
+}
+
+SkString GM::GetResourcePath() {
+ return SkString(gResourcePath);
+}
+
// need to explicitly declare this, or we get some weird infinite loop llist
template GMRegistry* SkTRegistry<GM*(*)(void*)>::gHead;