OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkDebugCanvas.h" | 8 #include "SkDebugCanvas.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkForceLinking.h" | 10 #include "SkForceLinking.h" |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 opt = 0; // try all the opts all over again | 710 opt = 0; // try all the opts all over again |
711 changed = true; | 711 changed = true; |
712 } | 712 } |
713 } | 713 } |
714 } | 714 } |
715 } | 715 } |
716 | 716 |
717 int numAfter = debugCanvas.getSize(); | 717 int numAfter = debugCanvas.getSize(); |
718 | 718 |
719 if (!outFile.isEmpty()) { | 719 if (!outFile.isEmpty()) { |
720 SkPicture outPicture; | 720 SkPictureRecorder recorder; |
721 | 721 SkCanvas* canvas = recorder.beginRecording(inPicture->width(), inPicture
->height()); |
722 SkCanvas* canvas = outPicture.beginRecording(inPicture->width(), inPictu
re->height()); | |
723 debugCanvas.draw(canvas); | 722 debugCanvas.draw(canvas); |
724 outPicture.endRecording(); | 723 SkAutoTUnref<SkPicture> outPicture(recorder.endRecording()); |
725 | 724 |
726 SkFILEWStream outStream(outFile.c_str()); | 725 SkFILEWStream outStream(outFile.c_str()); |
727 | 726 |
728 outPicture.serialize(&outStream); | 727 outPicture->serialize(&outStream); |
729 } | 728 } |
730 | 729 |
731 bool someOptFired = false; | 730 bool someOptFired = false; |
732 for (size_t opt = 0; opt < SK_ARRAY_COUNT(gOptTable); ++opt) { | 731 for (size_t opt = 0; opt < SK_ARRAY_COUNT(gOptTable); ++opt) { |
733 if (0 != localCount[opt]) { | 732 if (0 != localCount[opt]) { |
734 SkDebugf("%d: %d ", opt, localCount[opt]); | 733 SkDebugf("%d: %d ", opt, localCount[opt]); |
735 someOptFired = true; | 734 someOptFired = true; |
736 } | 735 } |
737 } | 736 } |
738 | 737 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 838 |
840 SkGraphics::Term(); | 839 SkGraphics::Term(); |
841 return 0; | 840 return 0; |
842 } | 841 } |
843 | 842 |
844 #if !defined SK_BUILD_FOR_IOS | 843 #if !defined SK_BUILD_FOR_IOS |
845 int main(int argc, char * const argv[]) { | 844 int main(int argc, char * const argv[]) { |
846 return tool_main(argc, (char**) argv); | 845 return tool_main(argc, (char**) argv); |
847 } | 846 } |
848 #endif | 847 #endif |
OLD | NEW |