skia2/debugger/QT/SkGLWidget.h
Hal Canary 2db8361257 bench, samples, etc: s/SkAutoTUnref/sk_sp/
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4437

Change-Id: Ice071684ac8a99e4bb405b4b9be8e8f42c7bac42
Reviewed-on: https://skia-review.googlesource.com/4437
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2016-11-07 15:17:32 +00:00

61 lines
1.1 KiB
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 SKGLWIDGET_H_
#define SKGLWIDGET_H_
#if SK_SUPPORT_GPU
#include <QtOpenGL/QGLWidget>
#include "SkDebugCanvas.h"
#include "SkDebugger.h"
#include "SkGpuDevice.h"
#include "GrContext.h"
#include "gl/GrGLInterface.h"
#include "gl/GrGLUtil.h"
#include "GrRenderTarget.h"
class SkGLWidget : public QGLWidget {
Q_OBJECT
public:
SkGLWidget(SkDebugger* debugger);
~SkGLWidget();
void updateImage() {
this->updateGL();
}
void setSampleCount(int sampleCount);
Q_SIGNALS:
void drawComplete();
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
private:
void createRenderTarget();
sk_sp<const GrGLInterface> fCurIntf;
sk_sp<GrContext> fCurContext;
sk_sp<SkSurface> fGpuSurface;
SkCanvas* fCanvas;
SkDebugger* fDebugger;
GrBackendRenderTargetDesc getDesc(int w, int h);
};
#endif /* SK_SUPPORT_GPU */
#endif /* SKGLWIDGET_H_ */