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 "SkDebuggerGUI.h" | 8 #include "SkDebuggerGUI.h" |
9 #include "PictureRenderer.h" | 9 #include "PictureRenderer.h" |
10 #include "SkPictureData.h" | 10 #include "SkPictureData.h" |
11 #include "SkPicturePlayback.h" | 11 #include "SkPicturePlayback.h" |
12 #include "SkPictureRecord.h" | 12 #include "SkPictureRecord.h" |
13 #include <QListWidgetItem> | 13 #include <QListWidgetItem> |
14 #include <QtGui> | 14 #include <QtGui> |
| 15 #include "sk_tool_utils.h" |
15 | 16 |
16 #if defined(SK_BUILD_FOR_WIN32) | 17 #if defined(SK_BUILD_FOR_WIN32) |
17 #include "SysTimer_windows.h" | 18 #include "SysTimer_windows.h" |
18 #elif defined(SK_BUILD_FOR_MAC) | 19 #elif defined(SK_BUILD_FOR_MAC) |
19 #include "SysTimer_mach.h" | 20 #include "SysTimer_mach.h" |
20 #elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID) | 21 #elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID) |
21 #include "SysTimer_posix.h" | 22 #include "SysTimer_posix.h" |
22 #else | 23 #else |
23 #include "SysTimer_c.h" | 24 #include "SysTimer_c.h" |
24 #endif | 25 #endif |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_Ta
bType); | 353 fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_Ta
bType); |
353 | 354 |
354 fInspectorWidget.setMatrix(fDebugger.getCurrentMatrix()); | 355 fInspectorWidget.setMatrix(fDebugger.getCurrentMatrix()); |
355 fInspectorWidget.setClip(fDebugger.getCurrentClip()); | 356 fInspectorWidget.setClip(fDebugger.getCurrentClip()); |
356 } | 357 } |
357 | 358 |
358 void SkDebuggerGUI::saveToFile(const SkString& filename) { | 359 void SkDebuggerGUI::saveToFile(const SkString& filename) { |
359 SkFILEWStream file(filename.c_str()); | 360 SkFILEWStream file(filename.c_str()); |
360 SkAutoTUnref<SkPicture> copy(fDebugger.copyPicture()); | 361 SkAutoTUnref<SkPicture> copy(fDebugger.copyPicture()); |
361 | 362 |
362 copy->serialize(&file); | 363 sk_tool_utils::PngPixelSerializer serializer; |
| 364 copy->serialize(&file, &serializer); |
363 } | 365 } |
364 | 366 |
365 void SkDebuggerGUI::loadFile(QListWidgetItem *item) { | 367 void SkDebuggerGUI::loadFile(QListWidgetItem *item) { |
366 if (fDirectoryWidgetActive) { | 368 if (fDirectoryWidgetActive) { |
367 fFileName = fPath.toAscii().data(); | 369 fFileName = fPath.toAscii().data(); |
368 // don't add a '/' to files in the local directory | 370 // don't add a '/' to files in the local directory |
369 if (fFileName.size() > 0) { | 371 if (fFileName.size() > 0) { |
370 fFileName.append("/"); | 372 fFileName.append("/"); |
371 } | 373 } |
372 fFileName.append(item->text().toAscii().data()); | 374 fFileName.append(item->text().toAscii().data()); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 fCanvasWidget.drawTo(fPausedRow); | 854 fCanvasWidget.drawTo(fPausedRow); |
853 } else { | 855 } else { |
854 fCanvasWidget.drawTo(fListWidget.currentRow()); | 856 fCanvasWidget.drawTo(fListWidget.currentRow()); |
855 } | 857 } |
856 } | 858 } |
857 | 859 |
858 void SkDebuggerGUI::updateHit(int newHit) { | 860 void SkDebuggerGUI::updateHit(int newHit) { |
859 fCommandHitBox.setText(QString::number(newHit)); | 861 fCommandHitBox.setText(QString::number(newHit)); |
860 } | 862 } |
861 | 863 |
OLD | NEW |