2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SKDEBUGGERUI_H
|
|
|
|
#define SKDEBUGGERUI_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "SkCanvas.h"
|
2012-07-26 19:38:22 +00:00
|
|
|
#include "SkCanvasWidget.h"
|
2012-08-07 16:12:23 +00:00
|
|
|
#include "SkDebugger.h"
|
2012-07-26 19:38:22 +00:00
|
|
|
#include "SkGLWidget.h"
|
2012-06-29 14:21:22 +00:00
|
|
|
#include "SkListWidget.h"
|
|
|
|
#include "SkInspectorWidget.h"
|
2012-07-26 19:38:22 +00:00
|
|
|
#include "SkRasterWidget.h"
|
2014-12-31 07:03:56 +00:00
|
|
|
#include "SkDrawCommandGeometryWidget.h"
|
2012-06-29 14:21:22 +00:00
|
|
|
#include "SkSettingsWidget.h"
|
2015-01-14 06:49:02 +00:00
|
|
|
#include <QtCore/QSignalMapper>
|
2012-06-29 14:21:22 +00:00
|
|
|
#include <QtCore/QVariant>
|
|
|
|
#include <QtGui/QAction>
|
|
|
|
#include <QtGui/QApplication>
|
|
|
|
#include <QtGui/QButtonGroup>
|
|
|
|
#include <QtGui/QHBoxLayout>
|
|
|
|
#include <QtGui/QHeaderView>
|
|
|
|
#include <QtGui/QListView>
|
|
|
|
#include <QtGui/QListWidget>
|
|
|
|
#include <QtGui/QMainWindow>
|
2013-11-21 13:41:37 +00:00
|
|
|
#include <QtGui/QSplitter>
|
2012-06-29 14:21:22 +00:00
|
|
|
#include <QtGui/QStatusBar>
|
|
|
|
#include <QtGui/QToolBar>
|
|
|
|
#include <QtGui/QVBoxLayout>
|
|
|
|
#include <QtGui/QWidget>
|
|
|
|
#include <QtGui/QMenu>
|
|
|
|
#include <QtGui/QMenuBar>
|
|
|
|
#include <vector>
|
|
|
|
|
2012-11-19 20:44:29 +00:00
|
|
|
class SkTimedPicture;
|
|
|
|
namespace sk_tools {
|
|
|
|
class PictureRenderer;
|
|
|
|
}
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/** \class SkDebuggerGUI
|
|
|
|
|
|
|
|
Container for the UI and it's functions.
|
|
|
|
*/
|
|
|
|
class SkDebuggerGUI : public QMainWindow {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructs the view of the application.
|
|
|
|
@param parent The parent container of this widget.
|
|
|
|
*/
|
|
|
|
SkDebuggerGUI(QWidget *parent = 0);
|
|
|
|
|
2013-01-28 17:43:26 +00:00
|
|
|
/**
|
|
|
|
Updates the directory widget with the latest directory path stored in
|
|
|
|
the global class variable fPath.
|
|
|
|
*/
|
|
|
|
void setupDirectoryWidget(const QString& path);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Loads the specified file.
|
|
|
|
*/
|
|
|
|
void openFile(const QString& filename);
|
|
|
|
|
2012-07-09 20:26:53 +00:00
|
|
|
signals:
|
|
|
|
void commandChanged(int command);
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
private slots:
|
|
|
|
/**
|
|
|
|
Toggles breakpoint view in the list widget.
|
|
|
|
*/
|
|
|
|
void actionBreakpoints();
|
|
|
|
|
2012-11-12 20:42:12 +00:00
|
|
|
/**
|
|
|
|
Profile the commands
|
|
|
|
*/
|
|
|
|
void actionProfile();
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Cancels the command filter in the list widget.
|
|
|
|
*/
|
|
|
|
void actionCancel();
|
|
|
|
|
2012-07-17 15:40:51 +00:00
|
|
|
/**
|
|
|
|
Clears the breakpoint state off of all commands marked as breakpoints.
|
|
|
|
*/
|
|
|
|
void actionClearBreakpoints();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Clears the deleted state off of all commands marked as deleted.
|
|
|
|
*/
|
|
|
|
void actionClearDeletes();
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Closes the application.
|
|
|
|
*/
|
|
|
|
void actionClose();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Deletes the command in question.
|
|
|
|
*/
|
|
|
|
void actionDelete();
|
|
|
|
|
2013-02-13 13:26:13 +00:00
|
|
|
#if SK_SUPPORT_GPU
|
2012-07-26 19:38:22 +00:00
|
|
|
/**
|
2013-08-02 13:59:50 +00:00
|
|
|
Updates the visibility of the GL canvas widget and sample count of the GL surface.
|
2012-07-26 19:38:22 +00:00
|
|
|
*/
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
void actionGLSettingsChanged();
|
2013-02-13 13:26:13 +00:00
|
|
|
#endif
|
2012-07-26 19:38:22 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Toggles the visibility of the inspector widget.
|
|
|
|
*/
|
|
|
|
void actionInspector();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Plays from the current step to the next breakpoint if it exists, otherwise
|
|
|
|
executes all remaining draw commands.
|
|
|
|
*/
|
|
|
|
void actionPlay();
|
|
|
|
|
2012-07-26 19:38:22 +00:00
|
|
|
/**
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
Sets the visibility of the raster canvas widget according to the settings widget.
|
2013-02-06 20:13:54 +00:00
|
|
|
*/
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
void actionRasterSettingsChanged();
|
2013-02-06 20:13:54 +00:00
|
|
|
|
2014-03-03 16:32:17 +00:00
|
|
|
/**
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
Sets the visualization settings according to the settings widget.
|
2014-03-03 16:32:17 +00:00
|
|
|
*/
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
void actionVisualizationsChanged();
|
2014-05-19 13:53:10 +00:00
|
|
|
|
2013-10-17 17:56:10 +00:00
|
|
|
/**
|
|
|
|
Applies the new texture filter override
|
|
|
|
*/
|
|
|
|
void actionTextureFilter();
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Rewinds from the current step back to the start of the commands.
|
|
|
|
*/
|
|
|
|
void actionRewind();
|
|
|
|
|
2012-07-28 20:16:11 +00:00
|
|
|
/**
|
|
|
|
Saves the current SKP with all modifications.
|
|
|
|
*/
|
|
|
|
void actionSave();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Saves the current SKP under a different name and/or location.
|
|
|
|
*/
|
|
|
|
void actionSaveAs();
|
|
|
|
|
2012-07-09 20:26:53 +00:00
|
|
|
/**
|
|
|
|
Sends the scale factor information to the settings widget.
|
|
|
|
*/
|
|
|
|
void actionScale(float scaleFactor);
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Toggles the settings widget visibility.
|
|
|
|
*/
|
|
|
|
void actionSettings();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Steps forward to the next draw command.
|
|
|
|
*/
|
|
|
|
void actionStepBack();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Steps backwards to the next draw command.
|
|
|
|
*/
|
|
|
|
void actionStepForward();
|
|
|
|
|
2012-08-03 17:32:05 +00:00
|
|
|
/**
|
|
|
|
Called when the canvas is done being drawn to by SkCanvasWidget.
|
|
|
|
*/
|
|
|
|
void drawComplete();
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Loads an skpicture selected from the directory.
|
|
|
|
*/
|
|
|
|
void loadFile(QListWidgetItem *item);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Toggles a dialog with a file browser for navigating to a skpicture. Loads
|
2013-01-28 17:43:26 +00:00
|
|
|
the selected file.
|
2012-06-29 14:21:22 +00:00
|
|
|
*/
|
|
|
|
void openFile();
|
|
|
|
|
2012-07-09 20:26:53 +00:00
|
|
|
/**
|
|
|
|
Toggles whether drawing to a new command requires a double click
|
|
|
|
or simple focus.
|
|
|
|
*/
|
2012-07-16 18:35:23 +00:00
|
|
|
void pauseDrawing(bool isPaused = true);
|
2012-07-09 20:26:53 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
2015-01-07 15:33:46 +00:00
|
|
|
Updates the UI based on the selected command.
|
2012-06-29 14:21:22 +00:00
|
|
|
*/
|
2015-01-07 15:33:46 +00:00
|
|
|
void updateDrawCommandInfo();
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-12 21:58:14 +00:00
|
|
|
/**
|
|
|
|
Sets the command to active in the list widget.
|
|
|
|
*/
|
|
|
|
void selectCommand(int command);
|
|
|
|
|
2012-07-17 15:40:51 +00:00
|
|
|
/**
|
|
|
|
Toggles the exclusive listing of commands set as deleted.
|
|
|
|
*/
|
|
|
|
void showDeletes();
|
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
|
|
|
Toggles a breakpoint on the current step in the list widget.
|
|
|
|
*/
|
|
|
|
void toggleBreakpoint();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Toggles the visibility of the directory widget.
|
|
|
|
*/
|
|
|
|
void toggleDirectory();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Filters the list widgets command visibility based on the currently
|
|
|
|
active selection.
|
|
|
|
*/
|
|
|
|
void toggleFilter(QString string);
|
|
|
|
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
void updateHit(int newHit);
|
2015-01-14 06:49:02 +00:00
|
|
|
|
|
|
|
void updateImage();
|
2012-06-29 14:21:22 +00:00
|
|
|
private:
|
2013-11-21 13:41:37 +00:00
|
|
|
QSplitter fCentralSplitter;
|
2012-07-31 12:49:52 +00:00
|
|
|
QStatusBar fStatusBar;
|
|
|
|
QToolBar fToolBar;
|
|
|
|
|
2012-07-10 13:19:25 +00:00
|
|
|
QAction fActionOpen;
|
|
|
|
QAction fActionBreakpoint;
|
2012-11-12 20:42:12 +00:00
|
|
|
QAction fActionProfile;
|
2012-07-10 13:19:25 +00:00
|
|
|
QAction fActionCancel;
|
2012-07-17 15:40:51 +00:00
|
|
|
QAction fActionClearBreakpoints;
|
2012-07-16 18:35:23 +00:00
|
|
|
QAction fActionClearDeletes;
|
2012-07-10 13:19:25 +00:00
|
|
|
QAction fActionClose;
|
2012-07-16 18:35:23 +00:00
|
|
|
QAction fActionCreateBreakpoint;
|
2012-07-10 13:19:25 +00:00
|
|
|
QAction fActionDelete;
|
|
|
|
QAction fActionDirectory;
|
|
|
|
QAction fActionGoToLine;
|
|
|
|
QAction fActionInspector;
|
2013-07-01 14:24:12 +00:00
|
|
|
QAction fActionSettings;
|
2012-07-10 13:19:25 +00:00
|
|
|
QAction fActionPlay;
|
2012-07-16 18:35:23 +00:00
|
|
|
QAction fActionPause;
|
2012-07-10 13:19:25 +00:00
|
|
|
QAction fActionRewind;
|
2012-07-28 20:16:11 +00:00
|
|
|
QAction fActionSave;
|
|
|
|
QAction fActionSaveAs;
|
2012-07-17 15:40:51 +00:00
|
|
|
QAction fActionShowDeletes;
|
2012-07-10 13:19:25 +00:00
|
|
|
QAction fActionStepBack;
|
|
|
|
QAction fActionStepForward;
|
2012-07-26 20:26:44 +00:00
|
|
|
QAction fActionZoomIn;
|
|
|
|
QAction fActionZoomOut;
|
|
|
|
QSignalMapper fMapper;
|
2012-07-31 12:49:52 +00:00
|
|
|
|
2012-07-28 20:16:11 +00:00
|
|
|
QWidget fSpacer;
|
2012-07-10 13:19:25 +00:00
|
|
|
QComboBox fFilter;
|
|
|
|
|
2013-11-21 13:41:37 +00:00
|
|
|
QSplitter fLeftColumnSplitter;
|
|
|
|
QWidget fMainAndRightColumnWidget;
|
2012-07-10 13:19:25 +00:00
|
|
|
QVBoxLayout fMainAndRightColumnLayout;
|
2012-11-21 17:11:02 +00:00
|
|
|
QHBoxLayout fCanvasSettingsAndImageLayout;
|
|
|
|
QVBoxLayout fSettingsAndImageLayout;
|
2012-07-10 13:19:25 +00:00
|
|
|
|
|
|
|
QListWidget fListWidget;
|
|
|
|
QListWidget fDirectoryWidget;
|
|
|
|
|
2012-08-07 16:12:23 +00:00
|
|
|
SkDebugger fDebugger;
|
2012-07-10 13:19:25 +00:00
|
|
|
SkCanvasWidget fCanvasWidget;
|
2014-12-31 07:03:56 +00:00
|
|
|
|
2012-07-10 13:19:25 +00:00
|
|
|
SkInspectorWidget fInspectorWidget;
|
|
|
|
SkSettingsWidget fSettingsWidget;
|
|
|
|
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
QFrame fViewStateFrame;
|
|
|
|
QVBoxLayout fViewStateFrameLayout;
|
|
|
|
QGroupBox fViewStateGroup;
|
|
|
|
QFormLayout fViewStateLayout;
|
|
|
|
QLineEdit fCurrentCommandBox;
|
|
|
|
QLineEdit fCommandHitBox;
|
|
|
|
QLineEdit fZoomBox;
|
2014-12-31 07:03:56 +00:00
|
|
|
SkDrawCommandGeometryWidget fDrawCommandGeometryWidget;
|
debugger: Make settings widget resizeable
The settings widget was laid out by hand, eg. the widths of most
elements were hardcoded. This prevented it from being laid out by the Qt
widget system. This in turn prevents the widget from shrinking to its
optimal size. This in turn causes cascading effect where the geometry of
many of the UI widgets has to be hard-coded. This in turn prevents
proper resizing of the UI.
Make Qt layout the settings widget by following changes:
a) Group settings in QGroupBox groups instead of hand-written
layouts and labels hardcoded in certain places.
b) Remove "Expanding" size policy from settings widget. The widget
calculates its own size based on the widgets inside. Thus "Preferred"
is the correct policy to use, as expanding the widget will not
bring any new content visible.
c) Remove maximum width 250 from Settings widget
d) Make "canvas settings and image layout", eg. the horizontal layout
holding the settings widget divide the space between the picture and
settings like so: settings uses up only as much as it needs (stretch
factor 0), while picture uses up everything else (stretch factor 1).
In order to do a) reasonably, reorganize the UI and the code a bit:
a1) Rename settings group "visual filter" to "Visualizations".
a2) Make "visual filter: on/off" combo box a checkbox in
"Visualizations".
a3) Move "Mega viz" setting checkbox from "raster" (or "render targets")
section to "Visualizations"
a4) Move "PathOps" setting checkbox from "raster" to "Visualizations"
a5) Make Raster and GL checkboxes use QGroupBox checkbox feature
a6) Move "current command", "command hitbox" and "zoom level" from
"Settings" widget to part of "Inspector" concept. These pieces of
information are now visualized as their own box in the right-hand
bar, below settings.
a7) Do not expose settings user selects through the UI widgets
state that record the user interacts with. Instead, expose it as state
of the "settings widget". Thus settings widget provides "raster settings
changed" signal, which the client hook to and then query the state
through the object API.
This makes the full window a bit shorter.
This commit is part of work that tries to make the
debugger window to be a bit more resizeable, so that it would fit
1900x1200 screen.
Review URL: https://codereview.chromium.org/829933002
2014-12-31 06:49:58 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
QString fPath;
|
2012-11-12 20:42:12 +00:00
|
|
|
SkString fFileName;
|
2012-12-07 20:48:56 +00:00
|
|
|
SkTDArray<bool> fSkipCommands; // has a specific command been deleted?
|
2012-06-29 14:21:22 +00:00
|
|
|
bool fDirectoryWidgetActive;
|
|
|
|
|
2012-07-10 13:19:25 +00:00
|
|
|
QMenuBar fMenuBar;
|
|
|
|
QMenu fMenuFile;
|
2012-07-16 18:35:23 +00:00
|
|
|
QMenu fMenuEdit;
|
2012-07-10 13:19:25 +00:00
|
|
|
QMenu fMenuNavigate;
|
|
|
|
QMenu fMenuView;
|
2012-07-16 18:35:23 +00:00
|
|
|
QMenu fMenuWindows;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-19 13:41:27 +00:00
|
|
|
bool fLoading;
|
2012-07-31 12:49:52 +00:00
|
|
|
int fPausedRow;
|
2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the entire UI.
|
|
|
|
*/
|
|
|
|
void setupUi(QMainWindow *SkDebuggerGUI);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Pipes a QString in with the location of the filename, proceeds to updating
|
|
|
|
the listwidget, combowidget and inspectorwidget.
|
|
|
|
*/
|
2012-11-12 20:42:12 +00:00
|
|
|
void loadPicture(const SkString& fileName);
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2012-07-28 20:16:11 +00:00
|
|
|
/**
|
|
|
|
Creates a picture of the current canvas.
|
|
|
|
*/
|
2012-11-12 20:42:12 +00:00
|
|
|
void saveToFile(const SkString& filename);
|
2012-07-28 20:16:11 +00:00
|
|
|
|
2012-06-29 14:21:22 +00:00
|
|
|
/**
|
2014-12-30 15:22:58 +00:00
|
|
|
Populates the list widget with the debugger draw command info.
|
2012-06-29 14:21:22 +00:00
|
|
|
*/
|
2014-12-30 15:22:58 +00:00
|
|
|
void setupListWidget();
|
2012-06-29 14:21:22 +00:00
|
|
|
|
|
|
|
/**
|
2014-12-30 15:22:58 +00:00
|
|
|
Populates the combo box widget with with the debugger draw command info.
|
2012-06-29 14:21:22 +00:00
|
|
|
*/
|
2014-12-30 15:22:58 +00:00
|
|
|
void setupComboBox();
|
2012-11-19 20:44:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Fills in the overview pane with text
|
|
|
|
*/
|
2013-03-07 19:32:45 +00:00
|
|
|
void setupOverviewText(const SkTDArray<double>* typeTimes, double totTime, int numRuns);
|
2012-06-29 14:21:22 +00:00
|
|
|
|
2014-05-19 13:53:10 +00:00
|
|
|
|
2012-11-19 20:44:29 +00:00
|
|
|
/**
|
|
|
|
Render the supplied picture several times tracking the time consumed
|
|
|
|
by each command.
|
|
|
|
*/
|
2014-07-07 20:46:35 +00:00
|
|
|
void run(const SkPicture* pict,
|
2012-11-20 02:01:23 +00:00
|
|
|
sk_tools::PictureRenderer* renderer,
|
2012-11-19 20:44:29 +00:00
|
|
|
int repeats);
|
2015-01-05 09:14:11 +00:00
|
|
|
|
|
|
|
bool isPaused() const {
|
|
|
|
return fActionPause.isChecked();
|
|
|
|
}
|
2012-06-29 14:21:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SKDEBUGGERUI_H
|