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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 SkASSERT(renderer != NULL); | 317 SkASSERT(renderer != NULL); |
318 if (NULL == renderer) { | 318 if (NULL == renderer) { |
319 return; | 319 return; |
320 } | 320 } |
321 | 321 |
322 renderer->init(pict); | 322 renderer->init(pict); |
323 | 323 |
324 renderer->setup(); | 324 renderer->setup(); |
325 renderer->render(NULL); | 325 renderer->render(NULL); |
326 renderer->resetState(true); | 326 renderer->resetState(true); // flush, swapBuffers and Finish |
327 | 327 |
328 // We throw this away the first batch of times to remove first time effects
(such as paging in this program) | 328 // We throw this away the first batch of times to remove first time effects
(such as paging in this program) |
329 pict->resetTimes(); | 329 pict->resetTimes(); |
330 | 330 |
331 for (int i = 0; i < repeats; ++i) { | 331 for (int i = 0; i < repeats; ++i) { |
332 renderer->setup(); | 332 renderer->setup(); |
333 renderer->render(NULL); | 333 renderer->render(NULL); |
334 renderer->resetState(true); | 334 renderer->resetState(false); // flush & swapBuffers, but don't Finish |
335 } | 335 } |
| 336 renderer->resetState(true); // flush, swapBuffers and Finish |
336 | 337 |
337 renderer->end(); | 338 renderer->end(); |
338 } | 339 } |
339 | 340 |
340 void SkDebuggerGUI::actionProfile() { | 341 void SkDebuggerGUI::actionProfile() { |
341 // In order to profile we pass the command offsets (that were read-in | 342 // In order to profile we pass the command offsets (that were read-in |
342 // in loadPicture by the SkOffsetPicture) to an SkTimedPlaybackPicture. | 343 // in loadPicture by the SkOffsetPicture) to an SkTimedPlaybackPicture. |
343 // The SkTimedPlaybackPicture in turn passes the offsets to an | 344 // The SkTimedPlaybackPicture in turn passes the offsets to an |
344 // SkTimedPicturePlayback object which uses them to track the performance | 345 // SkTimedPicturePlayback object which uses them to track the performance |
345 // of individual commands. | 346 // of individual commands. |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 } | 1043 } |
1043 | 1044 |
1044 // NOTE(chudy): Makes first item unselectable. | 1045 // NOTE(chudy): Makes first item unselectable. |
1045 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( | 1046 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( |
1046 fFilter.model()); | 1047 fFilter.model()); |
1047 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), | 1048 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), |
1048 fFilter.rootModelIndex()); | 1049 fFilter.rootModelIndex()); |
1049 QStandardItem* firstItem = model->itemFromIndex(firstIndex); | 1050 QStandardItem* firstItem = model->itemFromIndex(firstIndex); |
1050 firstItem->setSelectable(false); | 1051 firstItem->setSelectable(false); |
1051 } | 1052 } |
OLD | NEW |