| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #include "SampleApp.h" | 7 #include "SampleApp.h" |
| 8 | 8 |
| 9 #include "SkData.h" | 9 #include "SkData.h" |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 static const char* gPrefFileName = "sampleapp_prefs.txt"; | 123 static const char* gPrefFileName = "sampleapp_prefs.txt"; |
| 124 | 124 |
| 125 static bool readTitleFromPrefs(SkString* title) { | 125 static bool readTitleFromPrefs(SkString* title) { |
| 126 SkFILEStream stream(gPrefFileName); | 126 SkFILEStream stream(gPrefFileName); |
| 127 if (!stream.isValid()) { | 127 if (!stream.isValid()) { |
| 128 return false; | 128 return false; |
| 129 } | 129 } |
| 130 | 130 |
| 131 int len = stream.getLength(); | 131 size_t len = stream.getLength(); |
| 132 SkString data(len); | 132 SkString data(len); |
| 133 stream.read(data.writable_str(), len); | 133 stream.read(data.writable_str(), len); |
| 134 const char* s = data.c_str(); | 134 const char* s = data.c_str(); |
| 135 | 135 |
| 136 s = skip_past(s, "curr-slide-title"); | 136 s = skip_past(s, "curr-slide-title"); |
| 137 s = skip_past(s, "="); | 137 s = skip_past(s, "="); |
| 138 s = skip_past(s, "\""); | 138 s = skip_past(s, "\""); |
| 139 const char* stop = skip_until(s, "\""); | 139 const char* stop = skip_until(s, "\""); |
| 140 if (stop > s) { | 140 if (stop > s) { |
| 141 title->set(s, stop - s); | 141 title->set(s, stop - s); |
| (...skipping 2468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2610 SkGraphics::Init(); | 2610 SkGraphics::Init(); |
| 2611 SkEvent::Init(); | 2611 SkEvent::Init(); |
| 2612 } | 2612 } |
| 2613 | 2613 |
| 2614 // FIXME: this should be in a header | 2614 // FIXME: this should be in a header |
| 2615 void application_term(); | 2615 void application_term(); |
| 2616 void application_term() { | 2616 void application_term() { |
| 2617 SkEvent::Term(); | 2617 SkEvent::Term(); |
| 2618 SkGraphics::Term(); | 2618 SkGraphics::Term(); |
| 2619 } | 2619 } |
| OLD | NEW |