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

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

Issue 1048383002: [SkDebugger] Flatten drawPicture ops (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 | src/utils/debugger/SkDebugCanvas.cpp » ('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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
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", 782 SkASSERT(!strcmp("BeginCommentGroup",
783 SkDrawCommand::GetCommandString(SkDrawCommand::kBeginCommen tGroup_OpType))); 783 SkDrawCommand::GetCommandString(SkDrawCommand::kBeginCommen tGroup_OpType)));
784 SkASSERT(!strcmp("EndCommentGroup", 784 SkASSERT(!strcmp("EndCommentGroup",
785 SkDrawCommand::GetCommandString(SkDrawCommand::kEndCommentG roup_OpType))); 785 SkDrawCommand::GetCommandString(SkDrawCommand::kEndCommentG roup_OpType)));
786 786 SkASSERT(!strcmp("BeginDrawPicture",
787 SkDrawCommand::GetCommandString(SkDrawCommand::kBeginDrawPi cture_OpType)));
788 SkASSERT(!strcmp("EndDrawPicture",
789 SkDrawCommand::GetCommandString(SkDrawCommand::kEndDrawPict ure_OpType)));
787 790
788 fListWidget.clear(); 791 fListWidget.clear();
789 int counter = 0; 792 int counter = 0;
790 int indent = 0; 793 int indent = 0;
791 for (int i = 0; i < fDebugger.getSize(); i++) { 794 for (int i = 0; i < fDebugger.getSize(); i++) {
792 QListWidgetItem *item = new QListWidgetItem(); 795 QListWidgetItem *item = new QListWidgetItem();
793 SkDrawCommand* command = fDebugger.getDrawCommandAt(i); 796 SkDrawCommand* command = fDebugger.getDrawCommandAt(i);
794 SkString commandString = command->toString(); 797 SkString commandString = command->toString();
795 item->setData(Qt::DisplayRole, commandString.c_str()); 798 item->setData(Qt::DisplayRole, commandString.c_str());
796 item->setData(Qt::UserRole + 1, counter++); 799 item->setData(Qt::UserRole + 1, counter++);
797 800
798 if (0 == strcmp("Restore", commandString.c_str()) || 801 if (0 == strcmp("Restore", commandString.c_str()) ||
799 0 == strcmp("EndCommentGroup", commandString.c_str())) { 802 0 == strcmp("EndCommentGroup", commandString.c_str()) ||
803 0 == strcmp("EndDrawPicture", commandString.c_str())) {
800 indent -= 10; 804 indent -= 10;
801 } 805 }
802 806
803 item->setData(Qt::UserRole + 3, indent); 807 item->setData(Qt::UserRole + 3, indent);
804 808
805 if (0 == strcmp("Save", commandString.c_str()) || 809 if (0 == strcmp("Save", commandString.c_str()) ||
806 0 == strcmp("SaveLayer", commandString.c_str()) || 810 0 == strcmp("SaveLayer", commandString.c_str()) ||
807 0 == strcmp("BeginCommentGroup", commandString.c_str())) { 811 0 == strcmp("BeginCommentGroup", commandString.c_str()) ||
812 0 == strcmp("BeginDrawPicture", commandString.c_str())) {
808 indent += 10; 813 indent += 10;
809 } 814 }
810 815
811 item->setData(Qt::UserRole + 4, -1); 816 item->setData(Qt::UserRole + 4, -1);
812 817
813 fListWidget.addItem(item); 818 fListWidget.addItem(item);
814 } 819 }
815 } 820 }
816 821
817 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, 822 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 fCanvasWidget.drawTo(fPausedRow); 856 fCanvasWidget.drawTo(fPausedRow);
852 } else { 857 } else {
853 fCanvasWidget.drawTo(fListWidget.currentRow()); 858 fCanvasWidget.drawTo(fListWidget.currentRow());
854 } 859 }
855 } 860 }
856 861
857 void SkDebuggerGUI::updateHit(int newHit) { 862 void SkDebuggerGUI::updateHit(int newHit) {
858 fCommandHitBox.setText(QString::number(newHit)); 863 fCommandHitBox.setText(QString::number(newHit));
859 } 864 }
860 865
OLDNEW
« no previous file with comments | « no previous file | src/utils/debugger/SkDebugCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698