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(); | |
80 PostMessage("ClearCommands"); | 79 PostMessage("ClearCommands"); |
81 for (int i = 0; i < commands->count(); ++i) { | 80 for (int i = 0; i < fDebugger.getSize(); ++i) { |
82 SkString addCommand("AddCommand:"); | 81 SkString addCommand("AddCommand:"); |
83 addCommand.append((*commands)[i]); | 82 addCommand.append(fDebugger.getDrawCommandAt(i)->toString())
; |
84 PostMessage(addCommand.c_str()); | 83 PostMessage(addCommand.c_str()); |
85 } | 84 } |
86 PostMessage("UpdateCommands"); | 85 PostMessage("UpdateCommands"); |
87 | 86 |
88 // Set the overview text. | 87 // Set the overview text. |
89 SkString overviewText; | 88 SkString overviewText; |
90 fDebugger.getOverviewText(NULL, 0.0, &overviewText, 1); | 89 fDebugger.getOverviewText(NULL, 0.0, &overviewText, 1); |
91 overviewText.prepend("SetOverview:"); | 90 overviewText.prepend("SetOverview:"); |
92 PostMessage(overviewText.c_str()); | 91 PostMessage(overviewText.c_str()); |
93 | 92 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 virtual pp::Instance* CreateInstance(PP_Instance instance) { | 210 virtual pp::Instance* CreateInstance(PP_Instance instance) { |
212 return new SkiaInstance(instance); | 211 return new SkiaInstance(instance); |
213 } | 212 } |
214 }; | 213 }; |
215 | 214 |
216 namespace pp { | 215 namespace pp { |
217 Module* CreateModule() { | 216 Module* CreateModule() { |
218 return new SkiaModule(); | 217 return new SkiaModule(); |
219 } | 218 } |
220 } // namespace pp | 219 } // namespace pp |
OLD | NEW |