* 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 fiddle_main_DEFINED
#define fiddle_main_DEFINED
#include "include/core/SkCanvas.h"
#include "include/core/SkDocument.h"
#include "include/core/SkFontMgr.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkStream.h"
#include "include/core/SkSurface.h"
#include "include/gpu/ganesh/GrDirectContext.h"
#include "include/gpu/ganesh/gl/GrGLAssembleInterface.h"
#include "include/gpu/ganesh/gl/GrGLInterface.h"
#include <memory>
#include <sstream>
namespace sk_gpu_test {
class GLTestContext;
class ManagedBackendTexture;
}
extern GrBackendTexture backEndTexture;
extern GrBackendRenderTarget backEndRenderTarget;
extern GrBackendTexture backEndTextureRenderTarget;
extern SkBitmap source;
extern sk_sp<SkImage> image;
extern double duration;
extern double frame;
extern sk_sp<SkFontMgr> fontMgr;
struct DrawOptions {
DrawOptions(int w,
int h,
bool r,
bool g,
bool p,
bool k,
bool srgb,
bool f16,
bool textOnly,
const char* s,
skgpu::Mipmapped mipMapping,
int offScreenWidth,
int offScreenHeight,
int deprecated,
skgpu::Mipmapped offScreenMipMapping)
: size(SkISize::Make(w, h))
, raster(r)
, gpu(g)
, pdf(p)
, skp(k)
, srgb(srgb)
, f16(f16)
, textOnly(textOnly)
, source(s)
, fMipMapping(mipMapping)
, fOffScreenWidth(offScreenWidth)
, fOffScreenHeight(offScreenHeight)
, fOffScreenMipMapping(offScreenMipMapping) {
SkASSERT(srgb || !f16);
}
SkISize size;
bool raster;
bool gpu;
bool pdf;
bool skp;
bool srgb;
bool f16;
bool textOnly;
const char* source;
skgpu::Mipmapped fMipMapping;
int fOffScreenWidth;
int fOffScreenHeight;
skgpu::Mipmapped fOffScreenMipMapping;
};
extern DrawOptions GetDrawOptions();
extern void SkDebugf(const char * format, ...);
extern void draw(SkCanvas*);
extern sk_sp<GrDirectContext> create_direct_context(std::ostringstream& driverinfo,
std::unique_ptr<sk_gpu_test::GLTestContext>*);
#endif