3 minor fixes for debugger

https://codereview.appspot.com/6842062/



git-svn-id: http://skia.googlecode.com/svn/trunk@6480 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-11-19 16:26:40 +00:00
parent 808b70f869
commit e099bc403c
2 changed files with 11 additions and 4 deletions

View File

@ -175,8 +175,14 @@ protected:
SkASSERT(offset == fCurOffset); SkASSERT(offset == fCurOffset);
#if defined(SK_BUILD_FOR_WIN32)
// CPU timer doesn't work well on Windows
fTimes[fCurCommand] += fTimer.fWall; fTimes[fCurCommand] += fTimer.fWall;
fTot += fTimer.fWall; fTot += fTimer.fWall;
#else
fTimes[fCurCommand] += fTimer.fCpu;
fTot += fTimer.fCpu;
#endif
} }
private: private:
@ -566,6 +572,7 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) {
QIcon::Normal, QIcon::Off); QIcon::Normal, QIcon::Off);
fActionProfile.setIcon(profile); fActionProfile.setIcon(profile);
fActionProfile.setText("Profile"); fActionProfile.setText("Profile");
fActionProfile.setDisabled(true);
QIcon inspector; QIcon inspector;
inspector.addFile(QString::fromUtf8(":/images/Ico/inspector.png"), inspector.addFile(QString::fromUtf8(":/images/Ico/inspector.png"),
@ -843,8 +850,8 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) {
// If SkPicturePlayback is compiled w/o SK_PICTURE_PROFILING_STUBS // If SkPicturePlayback is compiled w/o SK_PICTURE_PROFILING_STUBS
// the offset count will always be zero // the offset count will always be zero
SkASSERT(0 == fOffsets.count() || commands->count() == fOffsets.count()); SkASSERT(0 == fOffsets.count() || commands->count() == fOffsets.count());
if (0 == fOffsets.count()) { if (commands->count() == fOffsets.count()) {
fActionProfile.setDisabled(true); fActionProfile.setDisabled(false);
} }
/* fDebugCanvas is reinitialized every load picture. Need it to retain value /* fDebugCanvas is reinitialized every load picture. Need it to retain value

View File

@ -67,7 +67,7 @@ void SkListWidget::paint (QPainter *painter,
QString drawCommandNumber = index.data(Qt::UserRole + 1).toString(); QString drawCommandNumber = index.data(Qt::UserRole + 1).toString();
float time = index.data(Qt::UserRole + 4).toFloat(); float time = index.data(Qt::UserRole + 4).toFloat();
QString drawTime; QString drawTime;
drawTime.setNum(time, 'g', 3); drawTime.setNum(time, 'f', 2);
/* option.rect is a struct that Qt uses as a target to draw into. Following /* option.rect is a struct that Qt uses as a target to draw into. Following
* the format (x1,y1,x2,y2) x1 and y1 represent where the painter can start * the format (x1,y1,x2,y2) x1 and y1 represent where the painter can start
@ -79,7 +79,7 @@ void SkListWidget::paint (QPainter *painter,
* x1,y1 act as a margin for the top and left. The target area will not * x1,y1 act as a margin for the top and left. The target area will not
* affect size of text but will scale icons. */ * affect size of text but will scale icons. */
static const int kImageSpace = 35; static const int kImageSpace = 35;
static const int kCommandNumberSpace = 30; static const int kCommandNumberSpace = 33;
static const int kTimeSpace = 30; static const int kTimeSpace = 30;
// Breakpoint Icon // Breakpoint Icon