blob: d88590ecdf67c21545808ab3084dba416219f862 [file] [log] [blame]
chudy@google.com38b08ce2012-07-28 23:26:10 +00001
robertphillips9ea8acd2016-03-01 09:34:38 -08002/*
3 * Copyright 2016 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
chudy@google.com38b08ce2012-07-28 23:26:10 +00008
9#ifndef SKRASTERWIDGET_H_
10#define SKRASTERWIDGET_H_
11
kkinnunencfdc0e32015-01-13 22:49:02 -080012#include "SkSurface.h"
13class SkDebugger;
robertphillips@google.come8fe4bc2013-02-13 13:26:13 +000014
chudy@google.com38b08ce2012-07-28 23:26:10 +000015#include <QWidget>
16
17class SkRasterWidget : public QWidget {
chudy@google.coma9e937c2012-08-03 17:32:05 +000018 Q_OBJECT
chudy@google.com38b08ce2012-07-28 23:26:10 +000019
20public:
chudy@google.com607357f2012-08-07 16:12:23 +000021 SkRasterWidget(SkDebugger* debugger);
chudy@google.com38b08ce2012-07-28 23:26:10 +000022
kkinnunencfdc0e32015-01-13 22:49:02 -080023 void updateImage();
chudy@google.com38b08ce2012-07-28 23:26:10 +000024
robertphillips9ea8acd2016-03-01 09:34:38 -080025Q_SIGNALS:
chudy@google.coma9e937c2012-08-03 17:32:05 +000026 void drawComplete();
27
chudy@google.com38b08ce2012-07-28 23:26:10 +000028protected:
29 void paintEvent(QPaintEvent* event);
30
31 void resizeEvent(QResizeEvent* event);
32
33private:
chudy@google.com607357f2012-08-07 16:12:23 +000034 SkDebugger* fDebugger;
robertphillipsd98120e2016-03-24 08:29:40 -070035 sk_sp<SkSurface> fSurface;
kkinnunencfdc0e32015-01-13 22:49:02 -080036 bool fNeedImageUpdate;
chudy@google.com38b08ce2012-07-28 23:26:10 +000037};
38
39#endif /* SKRASTERWIDGET_H_ */