OLD | NEW |
1 /* | 1 /* |
2 * SkRasterWidget.h | 2 * SkRasterWidget.h |
3 * | 3 * |
4 * Created on: Jul 28, 2012 | 4 * Created on: Jul 28, 2012 |
5 * Author: chudy | 5 * Author: chudy |
6 */ | 6 */ |
7 | 7 |
8 | 8 |
9 #ifndef SKRASTERWIDGET_H_ | 9 #ifndef SKRASTERWIDGET_H_ |
10 #define SKRASTERWIDGET_H_ | 10 #define SKRASTERWIDGET_H_ |
11 | 11 |
12 #if SK_SUPPORT_GPU | 12 #include "SkSurface.h" |
13 #include "SkGpuDevice.h" | 13 class SkDebugger; |
14 #endif | |
15 | 14 |
16 #include "SkBitmapDevice.h" | |
17 #include "SkDebugger.h" | |
18 | |
19 #include <QApplication> | |
20 #include <QtGui> | |
21 #include <QWidget> | 15 #include <QWidget> |
22 | 16 |
23 class SkRasterWidget : public QWidget { | 17 class SkRasterWidget : public QWidget { |
24 Q_OBJECT | 18 Q_OBJECT |
25 | 19 |
26 public: | 20 public: |
27 SkRasterWidget(SkDebugger* debugger); | 21 SkRasterWidget(SkDebugger* debugger); |
28 | 22 |
29 ~SkRasterWidget(); | 23 void updateImage(); |
30 | |
31 void draw() { | |
32 this->update(); | |
33 } | |
34 | 24 |
35 signals: | 25 signals: |
36 void drawComplete(); | 26 void drawComplete(); |
37 | 27 |
38 protected: | 28 protected: |
39 void paintEvent(QPaintEvent* event); | 29 void paintEvent(QPaintEvent* event); |
40 | 30 |
41 void resizeEvent(QResizeEvent* event); | 31 void resizeEvent(QResizeEvent* event); |
42 | 32 |
43 private: | 33 private: |
44 SkBitmap fBitmap; | |
45 SkDebugger* fDebugger; | 34 SkDebugger* fDebugger; |
46 SkCanvas* fCanvas; | 35 SkAutoTUnref<SkSurface> fSurface; |
47 SkBaseDevice* fDevice; | 36 bool fNeedImageUpdate; |
48 }; | 37 }; |
49 | 38 |
50 #endif /* SKRASTERWIDGET_H_ */ | 39 #endif /* SKRASTERWIDGET_H_ */ |
OLD | NEW |