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

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

Issue 13957009: First pass at Comment API (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | debugger/SkDebugCanvas.h » ('j') | include/core/SkCanvas.h » ('J')
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 "SkGraphics.h" 9 #include "SkGraphics.h"
10 #include "SkImageDecoder.h" 10 #include "SkImageDecoder.h"
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 1046
1047 void SkDebuggerGUI::setupListWidget(SkTArray<SkString>* command) { 1047 void SkDebuggerGUI::setupListWidget(SkTArray<SkString>* command) {
1048 fListWidget.clear(); 1048 fListWidget.clear();
1049 int counter = 0; 1049 int counter = 0;
1050 int indent = 0; 1050 int indent = 0;
1051 for (int i = 0; i < command->count(); i++) { 1051 for (int i = 0; i < command->count(); i++) {
1052 QListWidgetItem *item = new QListWidgetItem(); 1052 QListWidgetItem *item = new QListWidgetItem();
1053 item->setData(Qt::DisplayRole, (*command)[i].c_str()); 1053 item->setData(Qt::DisplayRole, (*command)[i].c_str());
1054 item->setData(Qt::UserRole + 1, counter++); 1054 item->setData(Qt::UserRole + 1, counter++);
1055 1055
1056 if (0 == strcmp("Restore", (*command)[i].c_str())) { 1056 if (0 == strcmp("Restore", (*command)[i].c_str()) ||
1057 0 == strcmp("EndGroup", (*command)[i].c_str())) {
1057 indent -= 10; 1058 indent -= 10;
1058 } 1059 }
1059 1060
1060 item->setData(Qt::UserRole + 3, indent); 1061 item->setData(Qt::UserRole + 3, indent);
1061 1062
1062 if (0 == strcmp("Save", (*command)[i].c_str()) || 1063 if (0 == strcmp("Save", (*command)[i].c_str()) ||
1063 0 == strcmp("Save Layer", (*command)[i].c_str())) { 1064 0 == strcmp("Save Layer", (*command)[i].c_str()) ||
1065 0 == strcmp("BeginGroup", (*command)[i].c_str())) {
1064 indent += 10; 1066 indent += 10;
1065 } 1067 }
1066 1068
1067 item->setData(Qt::UserRole + 4, -1.0); 1069 item->setData(Qt::UserRole + 4, -1.0);
1068 1070
1069 fListWidget.addItem(item); 1071 fListWidget.addItem(item);
1070 } 1072 }
1071 } 1073 }
1072 1074
1073 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, 1075 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes,
(...skipping 19 matching lines...) Expand all
1093 } 1095 }
1094 1096
1095 // NOTE(chudy): Makes first item unselectable. 1097 // NOTE(chudy): Makes first item unselectable.
1096 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( 1098 QStandardItemModel* model = qobject_cast<QStandardItemModel*>(
1097 fFilter.model()); 1099 fFilter.model());
1098 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), 1100 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(),
1099 fFilter.rootModelIndex()); 1101 fFilter.rootModelIndex());
1100 QStandardItem* firstItem = model->itemFromIndex(firstIndex); 1102 QStandardItem* firstItem = model->itemFromIndex(firstIndex);
1101 firstItem->setSelectable(false); 1103 firstItem->setSelectable(false);
1102 } 1104 }
OLDNEW
« no previous file with comments | « no previous file | debugger/SkDebugCanvas.h » ('j') | include/core/SkCanvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698