From 52e4f413ffe2d281f9e90ff2147db08083ffcba7 Mon Sep 17 00:00:00 2001 From: tfarina Date: Sat, 7 Jun 2014 20:50:44 -0700 Subject: 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 --- gm/gm.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gm/gm.cpp') 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::gHead; -- cgit v1.2.3