aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger
diff options
context:
space:
mode:
authorGravatar chudy@google.com <chudy@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-31 12:49:52 +0000
committerGravatar chudy@google.com <chudy@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-31 12:49:52 +0000
commit2d537a18f49cb492358c2b051f4786075dd9406c (patch)
tree93a95fbae70c7c5c7f9c7e41a0947f9df4fc8aa5 /debugger
parentf8d904a7eed435b9de68fd2eef6d7f3c59fcc9cc (diff)
Fixed numerous mem errors
Review URL: https://codereview.appspot.com/6441070 git-svn-id: http://skia.googlecode.com/svn/trunk@4849 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'debugger')
-rw-r--r--debugger/QT/SkCanvasWidget.cpp10
-rw-r--r--debugger/QT/SkCanvasWidget.h4
-rw-r--r--debugger/QT/SkDebuggerGUI.cpp15
-rw-r--r--debugger/QT/SkDebuggerGUI.h12
-rw-r--r--debugger/QT/SkGLWidget.cpp5
-rw-r--r--debugger/QT/SkGLWidget.h3
-rw-r--r--debugger/QT/SkInspectorWidget.cpp5
-rw-r--r--debugger/QT/SkInspectorWidget.h4
-rw-r--r--debugger/QT/SkRasterWidget.cpp15
-rw-r--r--debugger/QT/SkSettingsWidget.cpp7
-rw-r--r--debugger/QT/SkSettingsWidget.h13
11 files changed, 43 insertions, 50 deletions
diff --git a/debugger/QT/SkCanvasWidget.cpp b/debugger/QT/SkCanvasWidget.cpp
index 47db709d55..e4716af439 100644
--- a/debugger/QT/SkCanvasWidget.cpp
+++ b/debugger/QT/SkCanvasWidget.cpp
@@ -9,10 +9,8 @@
#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);
@@ -34,6 +32,12 @@ SkCanvasWidget::SkCanvasWidget(QWidget* parent) : QWidget(parent)
this->setDisabled(true);
}
+SkCanvasWidget::~SkCanvasWidget() {
+ if (fDebugCanvas) {
+ delete fDebugCanvas;
+ }
+}
+
void SkCanvasWidget::drawTo(int index) {
fIndex = index;
if (!fRasterWidget.isHidden()) {
diff --git a/debugger/QT/SkCanvasWidget.h b/debugger/QT/SkCanvasWidget.h
index a73ffc8463..317a007026 100644
--- a/debugger/QT/SkCanvasWidget.h
+++ b/debugger/QT/SkCanvasWidget.h
@@ -20,9 +20,9 @@ class SkCanvasWidget : public QWidget {
Q_OBJECT
public:
- SkCanvasWidget(QWidget* parent);
+ SkCanvasWidget();
- ~SkCanvasWidget() {}
+ ~SkCanvasWidget();
enum WidgetType {
kRaster_8888_WidgetType = 1 << 0,
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index e497ff77fd..25f2ba9af2 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -11,6 +11,9 @@
SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
QMainWindow(parent)
+ , fCentralWidget(this)
+ , fStatusBar(this)
+ , fToolBar(this)
, fActionOpen(this)
, fActionBreakpoint(this)
, fActionCancel(this)
@@ -33,19 +36,12 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
, 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)
@@ -94,11 +90,9 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
fMenuEdit.setDisabled(true);
fMenuNavigate.setDisabled(true);
fMenuView.setDisabled(true);
-
}
-SkDebuggerGUI::~SkDebuggerGUI() {
-}
+SkDebuggerGUI::~SkDebuggerGUI() {}
void SkDebuggerGUI::actionBreakpoints() {
fBreakpointsActivated = !fBreakpointsActivated;
@@ -497,6 +491,7 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) {
fMainAndRightColumnLayout.addLayout(&fCanvasAndSettingsLayout);
fMainAndRightColumnLayout.addWidget(&fInspectorWidget);
+ fCentralWidget.setLayout(&fContainerLayout);
fContainerLayout.setSpacing(6);
fContainerLayout.setContentsMargins(11, 11, 11, 11);
fContainerLayout.addLayout(&fLeftColumnLayout);
diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h
index 3e4d319c71..d8b5c74368 100644
--- a/debugger/QT/SkDebuggerGUI.h
+++ b/debugger/QT/SkDebuggerGUI.h
@@ -195,6 +195,10 @@ private slots:
void toggleFilter(QString string);
private:
+ QWidget fCentralWidget;
+ QStatusBar fStatusBar;
+ QToolBar fToolBar;
+
QAction fActionOpen;
QAction fActionBreakpoint;
QAction fActionCancel;
@@ -217,13 +221,13 @@ private:
QAction fActionZoomIn;
QAction fActionZoomOut;
QSignalMapper fMapper;
- QWidget fCentralWidget;
+
QWidget fSpacer;
QComboBox fFilter;
+ QHBoxLayout fContainerLayout;
QVBoxLayout fLeftColumnLayout;
QVBoxLayout fMainAndRightColumnLayout;
- QHBoxLayout fContainerLayout;
QHBoxLayout fCanvasAndSettingsLayout;
QListWidget fListWidget;
@@ -232,7 +236,6 @@ private:
SkCanvasWidget fCanvasWidget;
SkInspectorWidget fInspectorWidget;
SkSettingsWidget fSettingsWidget;
- QStatusBar fStatusBar;
QString fPath;
bool fDirectoryWidgetActive;
@@ -243,13 +246,12 @@ private:
QMenu fMenuNavigate;
QMenu fMenuView;
QMenu fMenuWindows;
- QToolBar fToolBar;
bool fBreakpointsActivated;
bool fDeletesActivated;
bool fPause;
- int fPausedRow;
bool fLoading;
+ int fPausedRow;
/**
Creates the entire UI.
diff --git a/debugger/QT/SkGLWidget.cpp b/debugger/QT/SkGLWidget.cpp
index 395cf4451b..74ed48eb6e 100644
--- a/debugger/QT/SkGLWidget.cpp
+++ b/debugger/QT/SkGLWidget.cpp
@@ -9,12 +9,15 @@
#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() {
diff --git a/debugger/QT/SkGLWidget.h b/debugger/QT/SkGLWidget.h
index 4a036aa1ab..5295f4cd18 100644
--- a/debugger/QT/SkGLWidget.h
+++ b/debugger/QT/SkGLWidget.h
@@ -23,7 +23,7 @@
class SkGLWidget : public QGLWidget {
public:
- SkGLWidget(QWidget* parent = NULL);
+ SkGLWidget();
~SkGLWidget();
@@ -61,7 +61,6 @@ private:
int fIndex;
SkIPoint fTransform;
float fScaleFactor;
-
GrPlatformRenderTargetDesc getDesc(int w, int h);
};
diff --git a/debugger/QT/SkInspectorWidget.cpp b/debugger/QT/SkInspectorWidget.cpp
index 3f64e6f1a5..e09c25bb8d 100644
--- a/debugger/QT/SkInspectorWidget.cpp
+++ b/debugger/QT/SkInspectorWidget.cpp
@@ -10,8 +10,7 @@
#include "SkInspectorWidget.h"
#include <iostream>
-SkInspectorWidget::SkInspectorWidget(QWidget *parent)
- : QWidget(parent)
+SkInspectorWidget::SkInspectorWidget() : QWidget()
, fHorizontalLayout(this)
, fOverviewTab()
, fOverviewLayout(&fOverviewTab)
@@ -59,8 +58,6 @@ SkInspectorWidget::SkInspectorWidget(QWidget *parent)
fHorizontalLayout.addWidget(&fMatrixAndClipWidget);
}
-SkInspectorWidget::~SkInspectorWidget() {}
-
void SkInspectorWidget::setDetailText(QString text) {
fDetailText.setHtml(text);
}
diff --git a/debugger/QT/SkInspectorWidget.h b/debugger/QT/SkInspectorWidget.h
index 3e761043f8..78a834406b 100644
--- a/debugger/QT/SkInspectorWidget.h
+++ b/debugger/QT/SkInspectorWidget.h
@@ -32,9 +32,7 @@ public:
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);
diff --git a/debugger/QT/SkRasterWidget.cpp b/debugger/QT/SkRasterWidget.cpp
index 8c6a2847a8..db89de70fe 100644
--- a/debugger/QT/SkRasterWidget.cpp
+++ b/debugger/QT/SkRasterWidget.cpp
@@ -16,26 +16,25 @@ SkRasterWidget::SkRasterWidget(QWidget* parent) : QWidget(parent) {
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) {
diff --git a/debugger/QT/SkSettingsWidget.cpp b/debugger/QT/SkSettingsWidget.cpp
index bc37a12ac0..2519efd3f9 100644
--- a/debugger/QT/SkSettingsWidget.cpp
+++ b/debugger/QT/SkSettingsWidget.cpp
@@ -12,7 +12,7 @@
#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)
@@ -22,8 +22,8 @@ SkSettingsWidget::SkSettingsWidget(QWidget *parent) : QWidget(parent)
, 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);
@@ -71,7 +71,6 @@ SkSettingsWidget::SkSettingsWidget(QWidget *parent) : QWidget(parent)
fCanvasLayout.setSpacing(6);
fCanvasLayout.setContentsMargins(11,11,11,11);
- fCanvasLayout.addWidget(&fCanvasToggle);
fCanvasLayout.addLayout(&fRasterLayout);
fCanvasLayout.addLayout(&fGLLayout);
@@ -139,8 +138,6 @@ SkSettingsWidget::SkSettingsWidget(QWidget *parent) : QWidget(parent)
this->setDisabled(true);
}
-SkSettingsWidget::~SkSettingsWidget() {}
-
void SkSettingsWidget::updateCommand(int newCommand) {
fCurrentCommandBox.setText(QString::number(newCommand));
diff --git a/debugger/QT/SkSettingsWidget.h b/debugger/QT/SkSettingsWidget.h
index 1afb93ef8f..fdb99d1043 100644
--- a/debugger/QT/SkSettingsWidget.h
+++ b/debugger/QT/SkSettingsWidget.h
@@ -32,8 +32,7 @@ public:
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);
@@ -71,17 +70,17 @@ private:
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;
@@ -91,10 +90,10 @@ private:
QLabel fGLLabel;
QCheckBox fGLCheckBox;
- QLabel fZoomSetting;
QFrame fZoomFrame;
- QLineEdit fZoomBox;
QHBoxLayout fZoomLayout;
+ QLabel fZoomSetting;
+ QLineEdit fZoomBox;
};
#endif /* SKSETTINGSWIDGET_H_ */