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

Side by Side Diff: gm/coloremoji.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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 | « experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.h ('k') | gm/dcshader.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"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ColorEmojiGM() { 49 ColorEmojiGM() {
50 fTypeface = NULL; 50 fTypeface = NULL;
51 } 51 }
52 52
53 ~ColorEmojiGM() { 53 ~ColorEmojiGM() {
54 SkSafeUnref(fTypeface); 54 SkSafeUnref(fTypeface);
55 } 55 }
56 protected: 56 protected:
57 void onOnceBeforeDraw() SK_OVERRIDE { 57 void onOnceBeforeDraw() SK_OVERRIDE {
58 SkString filename = GetResourcePath("/Funkster.ttf"); 58 SkString filename = GetResourcePath("/Funkster.ttf");
59 SkAutoTUnref<SkFILEStream> stream(new SkFILEStream(filename.c_str())); 59 SkAutoTDelete<SkFILEStream> stream(new SkFILEStream(filename.c_str()));
60 if (!stream->isValid()) { 60 if (!stream->isValid()) {
61 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor rectly.\n"); 61 SkDebugf("Could not find Funkster.ttf, please set --resourcePath cor rectly.\n");
62 return; 62 return;
63 } 63 }
64 64
65 fTypeface = SkTypeface::CreateFromStream(stream); 65 fTypeface = SkTypeface::CreateFromStream(stream.detach());
66 } 66 }
67 67
68 SkString onShortName() SK_OVERRIDE { 68 SkString onShortName() SK_OVERRIDE {
69 return SkString("coloremoji"); 69 return SkString("coloremoji");
70 } 70 }
71 71
72 SkISize onISize() SK_OVERRIDE { 72 SkISize onISize() SK_OVERRIDE {
73 return SkISize::Make(650, 480); 73 return SkISize::Make(650, 480);
74 } 74 }
75 75
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 typedef GM INHERITED; 166 typedef GM INHERITED;
167 }; 167 };
168 168
169 ////////////////////////////////////////////////////////////////////////////// 169 //////////////////////////////////////////////////////////////////////////////
170 170
171 static GM* MyFactory(void*) { return new ColorEmojiGM; } 171 static GM* MyFactory(void*) { return new ColorEmojiGM; }
172 static GMRegistry reg(MyFactory); 172 static GMRegistry reg(MyFactory);
173 173
174 } 174 }
OLDNEW
« no previous file with comments | « experimental/PdfViewer/pdfparser/native/SkPdfNativeDoc.h ('k') | gm/dcshader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698