2012-11-21 17:11:02 +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 SKIMAGEWIDGET_H_
|
|
|
|
#define SKIMAGEWIDGET_H_
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2013-06-06 23:59:28 +00:00
|
|
|
#include "SkSurface.h"
|
2012-11-21 17:11:02 +00:00
|
|
|
class SkDebugger;
|
|
|
|
|
|
|
|
class SkImageWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
SkImageWidget(SkDebugger* debugger);
|
2013-06-07 07:01:06 +00:00
|
|
|
|
2013-06-06 23:59:28 +00:00
|
|
|
virtual ~SkImageWidget() {
|
|
|
|
fSurface->unref();
|
|
|
|
}
|
2012-11-21 17:11:02 +00:00
|
|
|
|
|
|
|
void draw() {
|
|
|
|
this->update();
|
|
|
|
}
|
|
|
|
|
|
|
|
static const int kImageWidgetWidth = 256;
|
|
|
|
static const int kImageWidgetHeight = 256;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void drawComplete();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent* event);
|
|
|
|
|
|
|
|
private:
|
2013-06-06 23:59:28 +00:00
|
|
|
SkDebugger* fDebugger;
|
|
|
|
char fPixels[kImageWidgetHeight * 4 * kImageWidgetWidth];
|
|
|
|
SkSurface* fSurface;
|
2012-11-21 17:11:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* SKIMAGEWIDGET_H_ */
|