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

Side by Side Diff: gm/coloremoji.cpp

Issue 371023005: Add always-threaded SkRecord quilt tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bigger tile -> more GMs can quilt Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « gm/blurroundrect.cpp ('k') | gm/composeshader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "Resources.h" 10 #include "Resources.h"
11 #include "SkCanvas.h" 11 #include "SkCanvas.h"
12 #include "SkStream.h" 12 #include "SkStream.h"
13 #include "SkTypeface.h" 13 #include "SkTypeface.h"
14 14
15 namespace skiagm { 15 namespace skiagm {
16 16
17 class ColorEmojiGM : public GM { 17 class ColorEmojiGM : public GM {
18 public: 18 public:
19 ColorEmojiGM() { 19 ColorEmojiGM() {
20 fTypeface = NULL; 20 fTypeface = NULL;
21 } 21 }
22 22
23 ~ColorEmojiGM() { 23 ~ColorEmojiGM() {
24 SkSafeUnref(fTypeface); 24 SkSafeUnref(fTypeface);
25 } 25 }
26 protected: 26 protected:
27 virtual uint32_t onGetFlags() const SK_OVERRIDE {
28 return kSkipTiled_Flag;
29 }
30
31 virtual void onOnceBeforeDraw() SK_OVERRIDE { 27 virtual void onOnceBeforeDraw() SK_OVERRIDE {
32 SkString filename = GetResourcePath("/Funkster.ttf"); 28 SkString filename = GetResourcePath("/Funkster.ttf");
33 SkAutoTUnref<SkFILEStream> stream(new SkFILEStream(filename.c_str())); 29 SkAutoTUnref<SkFILEStream> stream(new SkFILEStream(filename.c_str()));
34 if (!stream->isValid()) { 30 if (!stream->isValid()) {
35 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor rectly.\n"); 31 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor rectly.\n");
36 return; 32 return;
37 } 33 }
38 34
39 fTypeface = SkTypeface::CreateFromStream(stream); 35 fTypeface = SkTypeface::CreateFromStream(stream);
40 } 36 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 105
110 typedef GM INHERITED; 106 typedef GM INHERITED;
111 }; 107 };
112 108
113 ////////////////////////////////////////////////////////////////////////////// 109 //////////////////////////////////////////////////////////////////////////////
114 110
115 static GM* MyFactory(void*) { return new ColorEmojiGM; } 111 static GM* MyFactory(void*) { return new ColorEmojiGM; }
116 static GMRegistry reg(MyFactory); 112 static GMRegistry reg(MyFactory);
117 113
118 } 114 }
OLDNEW
« no previous file with comments | « gm/blurroundrect.cpp ('k') | gm/composeshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698