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

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

Issue 344213003: Move BenchTimer to tools as Timer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fixes Created 6 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
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 "SkForceLinking.h" 9 #include "SkForceLinking.h"
10 #include "SkGraphics.h" 10 #include "SkGraphics.h"
11 #include "SkImageDecoder.h" 11 #include "SkImageDecoder.h"
12 #include <QListWidgetItem> 12 #include <QListWidgetItem>
13 #include "PictureRenderer.h" 13 #include "PictureRenderer.h"
14 #include "SkPictureRecord.h" 14 #include "SkPictureRecord.h"
15 #include "SkPicturePlayback.h" 15 #include "SkPicturePlayback.h"
16 16
17 __SK_FORCE_IMAGE_DECODER_LINKING; 17 __SK_FORCE_IMAGE_DECODER_LINKING;
18 18
19 #if defined(SK_BUILD_FOR_WIN32) 19 #if defined(SK_BUILD_FOR_WIN32)
20 #include "BenchSysTimer_windows.h" 20 #include "SysTimer_windows.h"
21 #elif defined(SK_BUILD_FOR_MAC) 21 #elif defined(SK_BUILD_FOR_MAC)
22 #include "BenchSysTimer_mach.h" 22 #include "SysTimer_mach.h"
23 #elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID) 23 #elif defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_ANDROID)
24 #include "BenchSysTimer_posix.h" 24 #include "SysTimer_posix.h"
25 #else 25 #else
26 #include "BenchSysTimer_c.h" 26 #include "SysTimer_c.h"
27 #endif 27 #endif
28 28
29 29
30 SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : 30 SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
31 QMainWindow(parent) 31 QMainWindow(parent)
32 , fCentralSplitter(this) 32 , fCentralSplitter(this)
33 , fStatusBar(this) 33 , fStatusBar(this)
34 , fToolBar(this) 34 , fToolBar(this)
35 , fActionOpen(this) 35 , fActionOpen(this)
36 , fActionBreakpoint(this) 36 , fActionBreakpoint(this)
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 int count() const { return fTimes.count(); } 196 int count() const { return fTimes.count(); }
197 197
198 double time(int index) const { return fTimes[index] / fTot; } 198 double time(int index) const { return fTimes[index] / fTot; }
199 199
200 const SkTDArray<double>* typeTimes() const { return &fTypeTimes; } 200 const SkTDArray<double>* typeTimes() const { return &fTypeTimes; }
201 201
202 double totTime() const { return fTot; } 202 double totTime() const { return fTot; }
203 203
204 protected: 204 protected:
205 BenchSysTimer fTimer; 205 SysTimer fTimer;
206 SkTDArray<bool> fSkipCommands; // has the command been deleted in the GUI? 206 SkTDArray<bool> fSkipCommands; // has the command been deleted in the GUI?
207 SkTDArray<double> fTimes; // sum of time consumed for each command 207 SkTDArray<double> fTimes; // sum of time consumed for each command
208 SkTDArray<double> fTypeTimes; // sum of time consumed for each type of comma nd (e.g., drawPath) 208 SkTDArray<double> fTypeTimes; // sum of time consumed for each type of comma nd (e.g., drawPath)
209 double fTot; // total of all times in 'fTimes' 209 double fTot; // total of all times in 'fTimes'
210 int fCurType; 210 int fCurType;
211 int fCurCommand; // the current command being executed/timed 211 int fCurCommand; // the current command being executed/timed
212 212
213 #ifdef SK_DEVELOPER 213 #ifdef SK_DEVELOPER
214 virtual bool preDraw(int opIndex, int type) SK_OVERRIDE { 214 virtual bool preDraw(int opIndex, int type) SK_OVERRIDE {
215 fCurCommand = opIndex; 215 fCurCommand = opIndex;
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 } 1069 }
1070 1070
1071 // NOTE(chudy): Makes first item unselectable. 1071 // NOTE(chudy): Makes first item unselectable.
1072 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( 1072 QStandardItemModel* model = qobject_cast<QStandardItemModel*>(
1073 fFilter.model()); 1073 fFilter.model());
1074 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), 1074 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(),
1075 fFilter.rootModelIndex()); 1075 fFilter.rootModelIndex());
1076 QStandardItem* firstItem = model->itemFromIndex(firstIndex); 1076 QStandardItem* firstItem = model->itemFromIndex(firstIndex);
1077 firstItem->setSelectable(false); 1077 firstItem->setSelectable(false);
1078 } 1078 }
OLDNEW
« no previous file with comments | « bench/benchmain.cpp ('k') | gyp/SampleApp.gyp » ('j') | tools/timer/GpuTimer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698