chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 1 | /* |
2 | * SkRasterWidget.h | ||||
3 | * | ||||
4 | * Created on: Jul 28, 2012 | ||||
5 | * Author: chudy | ||||
6 | */ | ||||
7 | |||||
8 | |||||
9 | #ifndef SKRASTERWIDGET_H_ | ||||
10 | #define SKRASTERWIDGET_H_ | ||||
11 | |||||
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 12 | #if SK_SUPPORT_GPU |
chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 13 | #include "SkGpuDevice.h" |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 14 | #endif |
15 | |||||
robertphillips@google.com | 6082076 | 2013-08-29 13:22:28 +0000 | [diff] [blame] | 16 | #include "SkBitmapDevice.h" |
chudy@google.com | 607357f | 2012-08-07 16:12:23 +0000 | [diff] [blame] | 17 | #include "SkDebugger.h" |
chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 18 | |
19 | #include <QApplication> | ||||
20 | #include <QtGui> | ||||
21 | #include <QWidget> | ||||
22 | |||||
23 | class SkRasterWidget : public QWidget { | ||||
chudy@google.com | a9e937c | 2012-08-03 17:32:05 +0000 | [diff] [blame] | 24 | Q_OBJECT |
chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 25 | |
26 | public: | ||||
chudy@google.com | 607357f | 2012-08-07 16:12:23 +0000 | [diff] [blame] | 27 | SkRasterWidget(SkDebugger* debugger); |
chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 28 | |
29 | ~SkRasterWidget(); | ||||
30 | |||||
chudy@google.com | 607357f | 2012-08-07 16:12:23 +0000 | [diff] [blame] | 31 | void draw() { |
chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 32 | this->update(); |
33 | } | ||||
34 | |||||
chudy@google.com | a9e937c | 2012-08-03 17:32:05 +0000 | [diff] [blame] | 35 | signals: |
36 | void drawComplete(); | ||||
37 | |||||
chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 38 | protected: |
39 | void paintEvent(QPaintEvent* event); | ||||
40 | |||||
41 | void resizeEvent(QResizeEvent* event); | ||||
42 | |||||
43 | private: | ||||
44 | SkBitmap fBitmap; | ||||
chudy@google.com | 607357f | 2012-08-07 16:12:23 +0000 | [diff] [blame] | 45 | SkDebugger* fDebugger; |
chudy@google.com | 830b879 | 2012-08-01 15:57:52 +0000 | [diff] [blame] | 46 | SkCanvas* fCanvas; |
robertphillips@google.com | 1f2f338 | 2013-08-29 11:54:56 +0000 | [diff] [blame] | 47 | SkBaseDevice* fDevice; |
chudy@google.com | 38b08ce | 2012-07-28 23:26:10 +0000 | [diff] [blame] | 48 | }; |
49 | |||||
50 | #endif /* SKRASTERWIDGET_H_ */ |