Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: debugger/QT/SkDebuggerGUI.cpp

Issue 1153593003: Remove the SkCanvas comment API (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rebased Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | experimental/PdfViewer/SkNulCanvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 } 772 }
773 773
774 void SkDebuggerGUI::setupListWidget() { 774 void SkDebuggerGUI::setupListWidget() {
775 775
776 SkASSERT(!strcmp("Save", 776 SkASSERT(!strcmp("Save",
777 SkDrawCommand::GetCommandString(SkDrawCommand::kSave_OpType ))); 777 SkDrawCommand::GetCommandString(SkDrawCommand::kSave_OpType )));
778 SkASSERT(!strcmp("SaveLayer", 778 SkASSERT(!strcmp("SaveLayer",
779 SkDrawCommand::GetCommandString(SkDrawCommand::kSaveLayer_O pType))); 779 SkDrawCommand::GetCommandString(SkDrawCommand::kSaveLayer_O pType)));
780 SkASSERT(!strcmp("Restore", 780 SkASSERT(!strcmp("Restore",
781 SkDrawCommand::GetCommandString(SkDrawCommand::kRestore_OpT ype))); 781 SkDrawCommand::GetCommandString(SkDrawCommand::kRestore_OpT ype)));
782 SkASSERT(!strcmp("BeginCommentGroup",
783 SkDrawCommand::GetCommandString(SkDrawCommand::kBeginCommen tGroup_OpType)));
784 SkASSERT(!strcmp("EndCommentGroup",
785 SkDrawCommand::GetCommandString(SkDrawCommand::kEndCommentG roup_OpType)));
786 SkASSERT(!strcmp("BeginDrawPicture", 782 SkASSERT(!strcmp("BeginDrawPicture",
787 SkDrawCommand::GetCommandString(SkDrawCommand::kBeginDrawPi cture_OpType))); 783 SkDrawCommand::GetCommandString(SkDrawCommand::kBeginDrawPi cture_OpType)));
788 SkASSERT(!strcmp("EndDrawPicture", 784 SkASSERT(!strcmp("EndDrawPicture",
789 SkDrawCommand::GetCommandString(SkDrawCommand::kEndDrawPict ure_OpType))); 785 SkDrawCommand::GetCommandString(SkDrawCommand::kEndDrawPict ure_OpType)));
790 786
791 fListWidget.clear(); 787 fListWidget.clear();
792 int counter = 0; 788 int counter = 0;
793 int indent = 0; 789 int indent = 0;
794 for (int i = 0; i < fDebugger.getSize(); i++) { 790 for (int i = 0; i < fDebugger.getSize(); i++) {
795 QListWidgetItem *item = new QListWidgetItem(); 791 QListWidgetItem *item = new QListWidgetItem();
796 SkDrawCommand* command = fDebugger.getDrawCommandAt(i); 792 SkDrawCommand* command = fDebugger.getDrawCommandAt(i);
797 SkString commandString = command->toString(); 793 SkString commandString = command->toString();
798 item->setData(Qt::DisplayRole, commandString.c_str()); 794 item->setData(Qt::DisplayRole, commandString.c_str());
799 item->setData(Qt::UserRole + 1, counter++); 795 item->setData(Qt::UserRole + 1, counter++);
800 796
801 if (0 == strcmp("Restore", commandString.c_str()) || 797 if (0 == strcmp("Restore", commandString.c_str()) ||
802 0 == strcmp("EndCommentGroup", commandString.c_str()) ||
803 0 == strcmp("EndDrawPicture", commandString.c_str())) { 798 0 == strcmp("EndDrawPicture", commandString.c_str())) {
804 indent -= 10; 799 indent -= 10;
805 } 800 }
806 801
807 item->setData(Qt::UserRole + 3, indent); 802 item->setData(Qt::UserRole + 3, indent);
808 803
809 if (0 == strcmp("Save", commandString.c_str()) || 804 if (0 == strcmp("Save", commandString.c_str()) ||
810 0 == strcmp("SaveLayer", commandString.c_str()) || 805 0 == strcmp("SaveLayer", commandString.c_str()) ||
811 0 == strcmp("BeginCommentGroup", commandString.c_str()) ||
812 0 == strcmp("BeginDrawPicture", commandString.c_str())) { 806 0 == strcmp("BeginDrawPicture", commandString.c_str())) {
813 indent += 10; 807 indent += 10;
814 } 808 }
815 809
816 item->setData(Qt::UserRole + 4, -1); 810 item->setData(Qt::UserRole + 4, -1);
817 811
818 fListWidget.addItem(item); 812 fListWidget.addItem(item);
819 } 813 }
820 } 814 }
821 815
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 fCanvasWidget.drawTo(fPausedRow); 850 fCanvasWidget.drawTo(fPausedRow);
857 } else { 851 } else {
858 fCanvasWidget.drawTo(fListWidget.currentRow()); 852 fCanvasWidget.drawTo(fListWidget.currentRow());
859 } 853 }
860 } 854 }
861 855
862 void SkDebuggerGUI::updateHit(int newHit) { 856 void SkDebuggerGUI::updateHit(int newHit) {
863 fCommandHitBox.setText(QString::number(newHit)); 857 fCommandHitBox.setText(QString::number(newHit));
864 } 858 }
865 859
OLDNEW
« no previous file with comments | « no previous file | experimental/PdfViewer/SkNulCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698