| 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 | 7 |
| 8 #include "SkCanvas.h" | 8 #include "SkCanvas.h" |
| 9 #include "SkCommandLineFlags.h" | 9 #include "SkCommandLineFlags.h" |
| 10 #include "SkData.h" | 10 #include "SkData.h" |
| 11 #include "SkDocument.h" | 11 #include "SkDocument.h" |
| 12 #include "SkForceLinking.h" | |
| 13 #include "SkGraphics.h" | 12 #include "SkGraphics.h" |
| 14 #include "SkSurface.h" | 13 #include "SkSurface.h" |
| 15 #include "SkImage.h" | 14 #include "SkImage.h" |
| 16 #include "SkImageEncoder.h" | 15 #include "SkImageEncoder.h" |
| 17 #include "SkStream.h" | 16 #include "SkStream.h" |
| 18 #include "SkString.h" | 17 #include "SkString.h" |
| 19 | 18 |
| 20 __SK_FORCE_IMAGE_DECODER_LINKING; | |
| 21 | |
| 22 DEFINE_string2(outFile, o, "skhello", "The filename to write the image."); | 19 DEFINE_string2(outFile, o, "skhello", "The filename to write the image."); |
| 23 DEFINE_string2(text, t, "Hello", "The string to write."); | 20 DEFINE_string2(text, t, "Hello", "The string to write."); |
| 24 | 21 |
| 25 static void doDraw(SkCanvas* canvas, const SkPaint& paint, const char text[]) { | 22 static void doDraw(SkCanvas* canvas, const SkPaint& paint, const char text[]) { |
| 26 SkRect bounds; | 23 SkRect bounds; |
| 27 canvas->getClipBounds(&bounds); | 24 canvas->getClipBounds(&bounds); |
| 28 | 25 |
| 29 canvas->drawColor(SK_ColorWHITE); | 26 canvas->drawColor(SK_ColorWHITE); |
| 30 canvas->drawText(text, strlen(text), | 27 canvas->drawText(text, strlen(text), |
| 31 bounds.centerX(), bounds.centerY(), | 28 bounds.centerX(), bounds.centerY(), |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 101 } |
| 105 } | 102 } |
| 106 return 0; | 103 return 0; |
| 107 } | 104 } |
| 108 | 105 |
| 109 #if !defined SK_BUILD_FOR_IOS | 106 #if !defined SK_BUILD_FOR_IOS |
| 110 int main(int argc, char * const argv[]) { | 107 int main(int argc, char * const argv[]) { |
| 111 return tool_main(argc, (char**) argv); | 108 return tool_main(argc, (char**) argv); |
| 112 } | 109 } |
| 113 #endif | 110 #endif |
| OLD | NEW |