skia2/debugger/QT/SkImageWidget.h
skia.committer@gmail.com a009083bd1 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@9471 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-06-07 07:01:06 +00:00

47 lines
824 B
C++

/*
* 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>
#include "SkSurface.h"
class SkDebugger;
class SkImageWidget : public QWidget {
Q_OBJECT
public:
SkImageWidget(SkDebugger* debugger);
virtual ~SkImageWidget() {
fSurface->unref();
}
void draw() {
this->update();
}
static const int kImageWidgetWidth = 256;
static const int kImageWidgetHeight = 256;
signals:
void drawComplete();
protected:
void paintEvent(QPaintEvent* event);
private:
SkDebugger* fDebugger;
char fPixels[kImageWidgetHeight * 4 * kImageWidgetWidth];
SkSurface* fSurface;
};
#endif /* SKIMAGEWIDGET_H_ */