#include "SkCanvasWidget.h"
-SkCanvasWidget::SkCanvasWidget(QWidget* parent) : QWidget(parent)
+SkCanvasWidget::SkCanvasWidget() : QWidget()
, fHorizontalLayout(this)
- , fRasterWidget(this)
- , fGLWidget(this)
{
fHorizontalLayout.setSpacing(6);
fHorizontalLayout.setContentsMargins(0,0,0,0);
this->setDisabled(true);
}
+SkCanvasWidget::~SkCanvasWidget() {
+ if (fDebugCanvas) {
+ delete fDebugCanvas;
+ }
+}
+
void SkCanvasWidget::drawTo(int index) {
fIndex = index;
if (!fRasterWidget.isHidden()) {
Q_OBJECT
public:
- SkCanvasWidget(QWidget* parent);
+ SkCanvasWidget();
- ~SkCanvasWidget() {}
+ ~SkCanvasWidget();
enum WidgetType {
kRaster_8888_WidgetType = 1 << 0,
SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
QMainWindow(parent)
+ , fCentralWidget(this)
+ , fStatusBar(this)
+ , fToolBar(this)
, fActionOpen(this)
, fActionBreakpoint(this)
, fActionCancel(this)
, fActionZoomIn(this)
, fActionZoomOut(this)
, fMapper(this)
- , fCentralWidget(this)
- , fFilter(&fCentralWidget)
- , fContainerLayout(&fCentralWidget)
, fListWidget(&fCentralWidget)
, fDirectoryWidget(&fCentralWidget)
- , fCanvasWidget(&fCentralWidget)
- , fSettingsWidget(&fCentralWidget)
- , fStatusBar(this)
, fMenuBar(this)
, fMenuFile(this)
, fMenuNavigate(this)
, fMenuView(this)
- , fToolBar(this)
, fBreakpointsActivated(false)
, fDeletesActivated(false)
, fPause(false)
fMenuEdit.setDisabled(true);
fMenuNavigate.setDisabled(true);
fMenuView.setDisabled(true);
-
}
-SkDebuggerGUI::~SkDebuggerGUI() {
-}
+SkDebuggerGUI::~SkDebuggerGUI() {}
void SkDebuggerGUI::actionBreakpoints() {
fBreakpointsActivated = !fBreakpointsActivated;
fMainAndRightColumnLayout.addLayout(&fCanvasAndSettingsLayout);
fMainAndRightColumnLayout.addWidget(&fInspectorWidget);
+ fCentralWidget.setLayout(&fContainerLayout);
fContainerLayout.setSpacing(6);
fContainerLayout.setContentsMargins(11, 11, 11, 11);
fContainerLayout.addLayout(&fLeftColumnLayout);
void toggleFilter(QString string);
private:
+ QWidget fCentralWidget;
+ QStatusBar fStatusBar;
+ QToolBar fToolBar;
+
QAction fActionOpen;
QAction fActionBreakpoint;
QAction fActionCancel;
QAction fActionZoomIn;
QAction fActionZoomOut;
QSignalMapper fMapper;
- QWidget fCentralWidget;
+
QWidget fSpacer;
QComboBox fFilter;
+ QHBoxLayout fContainerLayout;
QVBoxLayout fLeftColumnLayout;
QVBoxLayout fMainAndRightColumnLayout;
- QHBoxLayout fContainerLayout;
QHBoxLayout fCanvasAndSettingsLayout;
QListWidget fListWidget;
SkCanvasWidget fCanvasWidget;
SkInspectorWidget fInspectorWidget;
SkSettingsWidget fSettingsWidget;
- QStatusBar fStatusBar;
QString fPath;
bool fDirectoryWidgetActive;
QMenu fMenuNavigate;
QMenu fMenuView;
QMenu fMenuWindows;
- QToolBar fToolBar;
bool fBreakpointsActivated;
bool fDeletesActivated;
bool fPause;
- int fPausedRow;
bool fLoading;
+ int fPausedRow;
/**
Creates the entire UI.
#include "SkGLWidget.h"
-SkGLWidget::SkGLWidget(QWidget* parent) : QGLWidget(parent) {
+SkGLWidget::SkGLWidget() : QGLWidget() {
this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cccccc;}");
fTransform.set(0,0);
fScaleFactor = 1.0;
fIndex = 0;
fDebugCanvas = NULL;
+ fCurIntf = NULL;
+ fCurContext = NULL;
+ fGpuDevice = NULL;
}
SkGLWidget::~SkGLWidget() {
class SkGLWidget : public QGLWidget {
public:
- SkGLWidget(QWidget* parent = NULL);
+ SkGLWidget();
~SkGLWidget();
int fIndex;
SkIPoint fTransform;
float fScaleFactor;
-
GrPlatformRenderTargetDesc getDesc(int w, int h);
};
#include "SkInspectorWidget.h"
#include <iostream>
-SkInspectorWidget::SkInspectorWidget(QWidget *parent)
- : QWidget(parent)
+SkInspectorWidget::SkInspectorWidget() : QWidget()
, fHorizontalLayout(this)
, fOverviewTab()
, fOverviewLayout(&fOverviewTab)
fHorizontalLayout.addWidget(&fMatrixAndClipWidget);
}
-SkInspectorWidget::~SkInspectorWidget() {}
-
void SkInspectorWidget::setDetailText(QString text) {
fDetailText.setHtml(text);
}
Constructs a widget with the specified parent for layout purposes.
@param parent The parent container of this widget
*/
- SkInspectorWidget(QWidget *parent = NULL);
-
- ~SkInspectorWidget();
+ SkInspectorWidget();
void setDisabled(bool isDisabled) {
fMatrixAndClipWidget.setDisabled(isDisabled);
fTransform.set(0,0);
fScaleFactor = 1.0;
fIndex = 0;
+ fDevice = NULL;
fDebugCanvas = NULL;
this->setStyleSheet("QWidget {background-color: white; border: 1px solid #cccccc;}");
}
SkRasterWidget::~SkRasterWidget() {
delete fDevice;
- delete fDebugCanvas;
}
void SkRasterWidget::resizeEvent(QResizeEvent* event) {
fBitmap.setConfig(SkBitmap::kARGB_8888_Config, event->size().width(), event->size().height());
fBitmap.allocPixels();
- delete fDevice;
- fDevice = new SkDevice(fBitmap);
- //TODO(chudy): Debug Canvas shouldn't store current size. The bitmap
- //or texture backend should already have it. Refactor.
- if (fDebugCanvas) {
- fDebugCanvas->setBounds(event->size().width(), event->size().height());
- this->update();
+ if (fDevice) {
+ delete fDevice;
}
+ fDevice = new SkDevice(fBitmap);
+
+
+ this->update();
}
void SkRasterWidget::paintEvent(QPaintEvent* event) {
#include <math.h>
// TODO(chudy): See if the layout can't be attached to the frame post construction.
-SkSettingsWidget::SkSettingsWidget(QWidget *parent) : QWidget(parent)
+SkSettingsWidget::SkSettingsWidget() : QWidget()
, mainFrameLayout(this)
, fVerticalLayout(&mainFrame)
, fVisibleFrameLayout(&fVisibleFrame)
, fCurrentCommandBox(&fCommandFrame)
, fCommandHitBox(&fCommandFrame)
, fCanvasLayout(&fCanvasFrame)
- , fZoomBox(&fZoomFrame)
, fZoomLayout(&fZoomFrame)
+ , fZoomBox(&fZoomFrame)
{
// Sets up the container and it's alignment around the settings widget.
mainFrame.setFrameShape(QFrame::StyledPanel);
fCanvasLayout.setSpacing(6);
fCanvasLayout.setContentsMargins(11,11,11,11);
- fCanvasLayout.addWidget(&fCanvasToggle);
fCanvasLayout.addLayout(&fRasterLayout);
fCanvasLayout.addLayout(&fGLLayout);
this->setDisabled(true);
}
-SkSettingsWidget::~SkSettingsWidget() {}
-
void SkSettingsWidget::updateCommand(int newCommand) {
fCurrentCommandBox.setText(QString::number(newCommand));
Constructs a widget with the specified parent for layout purposes.
@param parent The parent container of this widget
*/
- SkSettingsWidget(QWidget *parent = NULL);
- ~SkSettingsWidget();
+ SkSettingsWidget();
void setZoomText(int scaleFactor);
QFrame fCommandFrame;
QVBoxLayout fCommandLayout;
+ QHBoxLayout fCurrentCommandLayout;
QLabel fCurrentCommandLabel;
QLineEdit fCurrentCommandBox;
- QHBoxLayout fCurrentCommandLayout;
+ QHBoxLayout fCommandHitLayout;
QLabel fCommandHitLabel;
QLineEdit fCommandHitBox;
- QHBoxLayout fCommandHitLayout;
- QLabel fCanvasToggle;
QFrame fCanvasFrame;
QVBoxLayout fCanvasLayout;
+ QLabel fCanvasToggle;
QHBoxLayout fRasterLayout;
QLabel fRasterLabel;
QLabel fGLLabel;
QCheckBox fGLCheckBox;
- QLabel fZoomSetting;
QFrame fZoomFrame;
- QLineEdit fZoomBox;
QHBoxLayout fZoomLayout;
+ QLabel fZoomSetting;
+ QLineEdit fZoomBox;
};
#endif /* SKSETTINGSWIDGET_H_ */