OLD | NEW |
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" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 if (NULL == playback) { | 279 if (NULL == playback) { |
280 return NULL; | 280 return NULL; |
281 } | 281 } |
282 | 282 |
283 return SkNEW_ARGS(SkTimedPicture, (playback, info.fWidth, info.fHeig
ht)); | 283 return SkNEW_ARGS(SkTimedPicture, (playback, info.fWidth, info.fHeig
ht)); |
284 } | 284 } |
285 | 285 |
286 return NULL; | 286 return NULL; |
287 } | 287 } |
288 | 288 |
289 void resetTimes() { ((SkTimedPicturePlayback*) fPlayback)->resetTimes(); } | 289 void resetTimes() { ((SkTimedPicturePlayback*) fPlayback.get())->resetTimes(
); } |
290 | 290 |
291 int count() const { return ((SkTimedPicturePlayback*) fPlayback)->count(); } | 291 int count() const { return ((SkTimedPicturePlayback*) fPlayback.get())->coun
t(); } |
292 | 292 |
293 // return the fraction of the total time this command consumed | 293 // return the fraction of the total time this command consumed |
294 double time(int index) const { return ((SkTimedPicturePlayback*) fPlayback)-
>time(index); } | 294 double time(int index) const { return ((SkTimedPicturePlayback*) fPlayback.g
et())->time(index); } |
295 | 295 |
296 const SkTDArray<double>* typeTimes() const { return ((SkTimedPicturePlayback
*) fPlayback)->typeTimes(); } | 296 const SkTDArray<double>* typeTimes() const { return ((SkTimedPicturePlayback
*) fPlayback.get())->typeTimes(); } |
297 | 297 |
298 double totTime() const { return ((SkTimedPicturePlayback*) fPlayback)->totTi
me(); } | 298 double totTime() const { return ((SkTimedPicturePlayback*) fPlayback.get())-
>totTime(); } |
299 | 299 |
300 private: | 300 private: |
301 // disallow default ctor b.c. we don't have a good way to setup the fPlaybac
k ptr | 301 // disallow default ctor b.c. we don't have a good way to setup the fPlaybac
k ptr |
302 SkTimedPicture(); | 302 SkTimedPicture(); |
303 // Private ctor only used by CreateTimedPicture, which has created the playb
ack. | 303 // Private ctor only used by CreateTimedPicture, which has created the playb
ack. |
304 SkTimedPicture(SkTimedPicturePlayback* playback, int width, int height) | 304 SkTimedPicture(SkTimedPicturePlayback* playback, int width, int height) |
305 : INHERITED(playback, width, height) {} | 305 : INHERITED(playback, width, height) {} |
306 // disallow the copy ctor - enabling would require copying code from SkPictu
re | 306 // disallow the copy ctor - enabling would require copying code from SkPictu
re |
307 SkTimedPicture(const SkTimedPicture& src); | 307 SkTimedPicture(const SkTimedPicture& src); |
308 | 308 |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |