1e735c0256
BUG=skia: Change-Id: I6453afb1fe18e210d3c505b56777b8b19501ca2f Reviewed-on: https://skia-review.googlesource.com/13810 Commit-Queue: Joe Gregorio <jcgregorio@google.com> Reviewed-by: Hal Canary <halcanary@google.com>
59 lines
1.4 KiB
C
59 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 fiddle_main_DEFINED
|
|
#define fiddle_main_DEFINED
|
|
|
|
#ifdef FIDDLE_BUILD_TEST
|
|
#include "GrContext.h"
|
|
#include "SkCanvas.h"
|
|
#include "SkDocument.h"
|
|
#include "SkPictureRecorder.h"
|
|
#include "SkStream.h"
|
|
#include "SkSurface.h"
|
|
#include "gl/GrGLAssembleInterface.h"
|
|
#include "gl/GrGLInterface.h"
|
|
#else
|
|
#include "skia.h"
|
|
#endif
|
|
|
|
extern SkBitmap source;
|
|
extern sk_sp<SkImage> image;
|
|
extern double duration; // The total duration of the animation in seconds.
|
|
extern double frame; // A value in [0, 1] of where we are in the animation.
|
|
|
|
struct DrawOptions {
|
|
DrawOptions(int w, int h, bool r, bool g, bool p, bool k, bool srgb, bool f16, bool textOnly, const char* s)
|
|
: size(SkISize::Make(w, h))
|
|
, raster(r)
|
|
, gpu(g)
|
|
, pdf(p)
|
|
, skp(k)
|
|
, srgb(srgb)
|
|
, f16(f16)
|
|
, textOnly(textOnly)
|
|
, source(s)
|
|
{
|
|
// F16 mode is only valid for color correct backends.
|
|
SkASSERT(srgb || !f16);
|
|
}
|
|
SkISize size;
|
|
bool raster;
|
|
bool gpu;
|
|
bool pdf;
|
|
bool skp;
|
|
bool srgb;
|
|
bool f16;
|
|
bool textOnly;
|
|
const char* source;
|
|
};
|
|
|
|
extern DrawOptions GetDrawOptions();
|
|
extern void SkDebugf(const char * format, ...);
|
|
extern void draw(SkCanvas*);
|
|
|
|
#endif // fiddle_main_DEFINED
|