Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: gm/colortype.cpp

Issue 1144023002: Move font loading in gm tests and benches out of constructors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/colortype.cpp
diff --git a/gm/colortype.cpp b/gm/colortype.cpp
index 48e39d086eaca735813f7d99df7eb917b4734a4f..e49f9ecb4457f31ea2a32b63b0ebd1d56ccf0c61 100644
--- a/gm/colortype.cpp
+++ b/gm/colortype.cpp
@@ -12,7 +12,16 @@
class ColorTypeGM : public skiagm::GM {
public:
- ColorTypeGM() {
+ ColorTypeGM()
+ : fColorType(NULL) {
+ }
+
+ virtual ~ColorTypeGM() {
+ SkSafeUnref(fColorType);
+ }
+
+protected:
+ void onOnceBeforeDraw() override {
const SkColor colors[] = {
SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE,
SK_ColorMAGENTA, SK_ColorCYAN, SK_ColorYELLOW
@@ -35,11 +44,6 @@ public:
orig->unref();
}
- virtual ~ColorTypeGM() {
- fColorType->unref();
- }
-
-protected:
SkString onShortName() override {
return SkString("colortype");
}

Powered by Google App Engine
This is Rietveld 408576698