blob: afad609c321615f3c1b68e6fc9fda72f5c7f377c [file] [log] [blame]
chudy@google.com38b08ce2012-07-28 23:26:10 +00001/*
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.come8fe4bc2013-02-13 13:26:13 +000012#if SK_SUPPORT_GPU
chudy@google.com38b08ce2012-07-28 23:26:10 +000013#include "SkGpuDevice.h"
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +000014#endif
15
robertphillips@google.com60820762013-08-29 13:22:28 +000016#include "SkBitmapDevice.h"
chudy@google.com607357f2012-08-07 16:12:23 +000017#include "SkDebugger.h"
chudy@google.com38b08ce2012-07-28 23:26:10 +000018
19#include <QApplication>
20#include <QtGui>
21#include <QWidget>
22
23class SkRasterWidget : public QWidget {
chudy@google.coma9e937c2012-08-03 17:32:05 +000024 Q_OBJECT
chudy@google.com38b08ce2012-07-28 23:26:10 +000025
26public:
chudy@google.com607357f2012-08-07 16:12:23 +000027 SkRasterWidget(SkDebugger* debugger);
chudy@google.com38b08ce2012-07-28 23:26:10 +000028
29 ~SkRasterWidget();
30
chudy@google.com607357f2012-08-07 16:12:23 +000031 void draw() {
chudy@google.com38b08ce2012-07-28 23:26:10 +000032 this->update();
33 }
34
chudy@google.coma9e937c2012-08-03 17:32:05 +000035signals:
36 void drawComplete();
37
chudy@google.com38b08ce2012-07-28 23:26:10 +000038protected:
39 void paintEvent(QPaintEvent* event);
40
41 void resizeEvent(QResizeEvent* event);
42
43private:
44 SkBitmap fBitmap;
chudy@google.com607357f2012-08-07 16:12:23 +000045 SkDebugger* fDebugger;
chudy@google.com830b8792012-08-01 15:57:52 +000046 SkCanvas* fCanvas;
robertphillips@google.com1f2f3382013-08-29 11:54:56 +000047 SkBaseDevice* fDevice;
chudy@google.com38b08ce2012-07-28 23:26:10 +000048};
49
50#endif /* SKRASTERWIDGET_H_ */