| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 connect(&fActionInspector, SIGNAL(triggered()), this, SLOT(actionInspector()
)); | 85 connect(&fActionInspector, SIGNAL(triggered()), this, SLOT(actionInspector()
)); |
| 86 connect(&fActionSettings, SIGNAL(triggered()), this, SLOT(actionSettings()))
; | 86 connect(&fActionSettings, SIGNAL(triggered()), this, SLOT(actionSettings()))
; |
| 87 connect(&fFilter, SIGNAL(activated(QString)), this, SLOT(toggleFilter(QStrin
g))); | 87 connect(&fFilter, SIGNAL(activated(QString)), this, SLOT(toggleFilter(QStrin
g))); |
| 88 connect(&fActionProfile, SIGNAL(triggered()), this, SLOT(actionProfile())); | 88 connect(&fActionProfile, SIGNAL(triggered()), this, SLOT(actionProfile())); |
| 89 connect(&fActionCancel, SIGNAL(triggered()), this, SLOT(actionCancel())); | 89 connect(&fActionCancel, SIGNAL(triggered()), this, SLOT(actionCancel())); |
| 90 connect(&fActionClearBreakpoints, SIGNAL(triggered()), this, SLOT(actionClea
rBreakpoints())); | 90 connect(&fActionClearBreakpoints, SIGNAL(triggered()), this, SLOT(actionClea
rBreakpoints())); |
| 91 connect(&fActionClearDeletes, SIGNAL(triggered()), this, SLOT(actionClearDel
etes())); | 91 connect(&fActionClearDeletes, SIGNAL(triggered()), this, SLOT(actionClearDel
etes())); |
| 92 connect(&fActionClose, SIGNAL(triggered()), this, SLOT(actionClose())); | 92 connect(&fActionClose, SIGNAL(triggered()), this, SLOT(actionClose())); |
| 93 connect(fSettingsWidget.getVisibilityButton(), SIGNAL(toggled(bool)), this,
SLOT(actionCommandFilter())); | 93 connect(fSettingsWidget.getVisibilityButton(), SIGNAL(toggled(bool)), this,
SLOT(actionCommandFilter())); |
| 94 #if SK_SUPPORT_GPU | 94 #if SK_SUPPORT_GPU |
| 95 connect(fSettingsWidget.getGLCheckBox(), SIGNAL(toggled(bool)), this, SLOT(a
ctionGLWidget(bool))); | 95 connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLWi
dget())); |
| 96 #endif | 96 #endif |
| 97 connect(fSettingsWidget.getRasterCheckBox(), SIGNAL(toggled(bool)), this, SL
OT(actionRasterWidget(bool))); | 97 connect(fSettingsWidget.getRasterCheckBox(), SIGNAL(toggled(bool)), this, SL
OT(actionRasterWidget(bool))); |
| 98 connect(fSettingsWidget.getOverdrawVizCheckBox(), SIGNAL(toggled(bool)), thi
s, SLOT(actionOverdrawVizWidget(bool))); | 98 connect(fSettingsWidget.getOverdrawVizCheckBox(), SIGNAL(toggled(bool)), thi
s, SLOT(actionOverdrawVizWidget(bool))); |
| 99 connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool))
); | 99 connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool))
); |
| 100 connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBrea
kpoint())); | 100 connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBrea
kpoint())); |
| 101 connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes()))
; | 101 connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes()))
; |
| 102 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(in
t))); | 102 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(in
t))); |
| 103 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), &fSettingsWidget, SLOT(upda
teHit(int))); | 103 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), &fSettingsWidget, SLOT(upda
teHit(int))); |
| 104 connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(action
Scale(float))); | 104 connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(action
Scale(float))); |
| 105 connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fSettingsWidget, SLOT(
updateCommand(int))); | 105 connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fSettingsWidget, SLOT(
updateCommand(int))); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 | 353 |
| 354 renderer = SkNEW(sk_tools::TiledPictureRenderer); | 354 renderer = SkNEW(sk_tools::TiledPictureRenderer); |
| 355 renderer->setTileWidth(256); | 355 renderer->setTileWidth(256); |
| 356 renderer->setTileHeight(256); | 356 renderer->setTileHeight(256); |
| 357 #else | 357 #else |
| 358 sk_tools::SimplePictureRenderer* renderer = NULL; | 358 sk_tools::SimplePictureRenderer* renderer = NULL; |
| 359 | 359 |
| 360 renderer = SkNEW(sk_tools::SimplePictureRenderer); | 360 renderer = SkNEW(sk_tools::SimplePictureRenderer); |
| 361 | 361 |
| 362 #if SK_SUPPORT_GPU | 362 #if SK_SUPPORT_GPU |
| 363 if (Qt::Checked == fSettingsWidget.getGLCheckBox()->checkState()) { | 363 if (fSettingsWidget.isGLActive()) { |
| 364 renderer->setDeviceType(sk_tools::PictureRenderer::kGPU_DeviceType); | 364 renderer->setDeviceType(sk_tools::PictureRenderer::kGPU_DeviceType); |
| 365 renderer->setSampleCount(fSettingsWidget.getGLSampleCount()); |
| 365 } | 366 } |
| 366 #endif | 367 #endif |
| 367 | 368 |
| 368 #endif | 369 #endif |
| 369 | 370 |
| 370 static const int kNumRepeats = 10; | 371 static const int kNumRepeats = 10; |
| 371 | 372 |
| 372 run(picture.get(), renderer, kNumRepeats); | 373 run(picture.get(), renderer, kNumRepeats); |
| 373 | 374 |
| 374 SkASSERT(picture->count() == fListWidget.count()); | 375 SkASSERT(picture->count() == fListWidget.count()); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 if (fPause) { | 453 if (fPause) { |
| 453 fCanvasWidget.drawTo(fPausedRow); | 454 fCanvasWidget.drawTo(fPausedRow); |
| 454 fImageWidget.draw(); | 455 fImageWidget.draw(); |
| 455 } else { | 456 } else { |
| 456 fCanvasWidget.drawTo(currentRow); | 457 fCanvasWidget.drawTo(currentRow); |
| 457 fImageWidget.draw(); | 458 fImageWidget.draw(); |
| 458 } | 459 } |
| 459 } | 460 } |
| 460 | 461 |
| 461 #if SK_SUPPORT_GPU | 462 #if SK_SUPPORT_GPU |
| 462 void SkDebuggerGUI::actionGLWidget(bool isToggled) { | 463 void SkDebuggerGUI::actionGLWidget() { |
| 464 bool isToggled = fSettingsWidget.isGLActive(); |
| 465 if (isToggled) { |
| 466 fCanvasWidget.setGLSampleCount(fSettingsWidget.getGLSampleCount()); |
| 467 } |
| 463 fCanvasWidget.setWidgetVisibility(SkCanvasWidget::kGPU_WidgetType, !isToggle
d); | 468 fCanvasWidget.setWidgetVisibility(SkCanvasWidget::kGPU_WidgetType, !isToggle
d); |
| 464 } | 469 } |
| 465 #endif | 470 #endif |
| 466 | 471 |
| 467 void SkDebuggerGUI::actionInspector() { | 472 void SkDebuggerGUI::actionInspector() { |
| 468 if (fInspectorWidget.isHidden()) { | 473 if (fInspectorWidget.isHidden()) { |
| 469 fInspectorWidget.setHidden(false); | 474 fInspectorWidget.setHidden(false); |
| 470 fImageWidget.setHidden(false); | 475 fImageWidget.setHidden(false); |
| 471 } else { | 476 } else { |
| 472 fInspectorWidget.setHidden(true); | 477 fInspectorWidget.setHidden(true); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 } | 1007 } |
| 1003 | 1008 |
| 1004 // NOTE(chudy): Makes first item unselectable. | 1009 // NOTE(chudy): Makes first item unselectable. |
| 1005 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( | 1010 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( |
| 1006 fFilter.model()); | 1011 fFilter.model()); |
| 1007 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), | 1012 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), |
| 1008 fFilter.rootModelIndex()); | 1013 fFilter.rootModelIndex()); |
| 1009 QStandardItem* firstItem = model->itemFromIndex(firstIndex); | 1014 QStandardItem* firstItem = model->itemFromIndex(firstIndex); |
| 1010 firstItem->setSelectable(false); | 1015 firstItem->setSelectable(false); |
| 1011 } | 1016 } |
| OLD | NEW |