273c0f5e87
rename subclasses Fix up the EGL native GLTestContext GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1849463002 TBR=jvanverth@google.com Committed: https://skia.googlesource.com/skia/+/4c7f0a16312c374eba4e8d5d46435ce9eb0b9971 Review URL: https://codereview.chromium.org/1849463002
66 lines
1.4 KiB
C++
66 lines
1.4 KiB
C++
/*
|
|
* Copyright 2015 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*
|
|
*/
|
|
|
|
#ifndef VisualBench_DEFINED
|
|
#define VisualBench_DEFINED
|
|
|
|
#include "SkWindow.h"
|
|
|
|
#include "SkPicture.h"
|
|
#include "SkString.h"
|
|
#include "SkSurface.h"
|
|
#include "VisualFlags.h"
|
|
#include "VisualModule.h"
|
|
#include "gl/GLTestContext.h"
|
|
|
|
class GrContext;
|
|
struct GrGLInterface;
|
|
class GrRenderTarget;
|
|
class SkCanvas;
|
|
|
|
/*
|
|
* A Visual benchmarking tool for gpu benchmarking
|
|
*/
|
|
class VisualBench : public SkOSWindow {
|
|
public:
|
|
VisualBench(void* hwnd, int argc, char** argv);
|
|
~VisualBench() override;
|
|
|
|
void reset() { this->resetContext(); }
|
|
|
|
void clear(SkCanvas* canvas, SkColor color, int frames);
|
|
|
|
protected:
|
|
SkSurface* createSurface() override;
|
|
|
|
void draw(SkCanvas* canvas) override;
|
|
|
|
void onSizeChange() override;
|
|
|
|
private:
|
|
void setTitle();
|
|
bool setupBackend();
|
|
void resetContext();
|
|
void setupRenderTarget();
|
|
bool onHandleChar(SkUnichar unichar) override;
|
|
void tearDownContext();
|
|
void setupContext();
|
|
|
|
// support framework
|
|
SkAutoTDelete<VisualModule> fModule;
|
|
SkAutoTUnref<SkSurface> fSurface;
|
|
SkAutoTUnref<GrContext> fContext;
|
|
SkAutoTUnref<GrRenderTarget> fRenderTarget;
|
|
AttachmentInfo fAttachmentInfo;
|
|
SkAutoTUnref<const GrGLInterface> fInterface;
|
|
|
|
typedef SkOSWindow INHERITED;
|
|
};
|
|
|
|
#endif
|