OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
10 #include "ppapi/cpp/graphics_2d.h" | 10 #include "ppapi/cpp/graphics_2d.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 SkMemoryStream pictureStream(decodedData.getData(), decodedSize)
; | 69 SkMemoryStream pictureStream(decodedData.getData(), decodedSize)
; |
70 SkPicture* picture = SkPicture::CreateFromStream(&pictureStream)
; | 70 SkPicture* picture = SkPicture::CreateFromStream(&pictureStream)
; |
71 if (NULL == picture) { | 71 if (NULL == picture) { |
72 SkDebugf("Failed to create SKP.\n"); | 72 SkDebugf("Failed to create SKP.\n"); |
73 return; | 73 return; |
74 } | 74 } |
75 fDebugger.loadPicture(picture); | 75 fDebugger.loadPicture(picture); |
76 picture->unref(); | 76 picture->unref(); |
77 | 77 |
78 // Set up the command list. | 78 // Set up the command list. |
79 SkTArray<SkString>* commands = fDebugger.getDrawCommandsAsString
s(); | 79 SkTArray<SkString> commands; |
| 80 fDebugger.getDrawCommandsAsStrings(&commands); |
80 PostMessage("ClearCommands"); | 81 PostMessage("ClearCommands"); |
81 for (int i = 0; i < commands->count(); ++i) { | 82 for (int i = 0; i < commands.count(); ++i) { |
82 SkString addCommand("AddCommand:"); | 83 SkString addCommand("AddCommand:"); |
83 addCommand.append((*commands)[i]); | 84 addCommand.append(commands[i]); |
84 PostMessage(addCommand.c_str()); | 85 PostMessage(addCommand.c_str()); |
85 } | 86 } |
86 PostMessage("UpdateCommands"); | 87 PostMessage("UpdateCommands"); |
87 | 88 |
88 // Set the overview text. | 89 // Set the overview text. |
89 SkString overviewText; | 90 SkString overviewText; |
90 fDebugger.getOverviewText(NULL, 0.0, &overviewText, 1); | 91 fDebugger.getOverviewText(NULL, 0.0, &overviewText, 1); |
91 overviewText.prepend("SetOverview:"); | 92 overviewText.prepend("SetOverview:"); |
92 PostMessage(overviewText.c_str()); | 93 PostMessage(overviewText.c_str()); |
93 | 94 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 virtual pp::Instance* CreateInstance(PP_Instance instance) { | 212 virtual pp::Instance* CreateInstance(PP_Instance instance) { |
212 return new SkiaInstance(instance); | 213 return new SkiaInstance(instance); |
213 } | 214 } |
214 }; | 215 }; |
215 | 216 |
216 namespace pp { | 217 namespace pp { |
217 Module* CreateModule() { | 218 Module* CreateModule() { |
218 return new SkiaModule(); | 219 return new SkiaModule(); |
219 } | 220 } |
220 } // namespace pp | 221 } // namespace pp |
OLD | NEW |