blob: a03eebca6ce8db6234e96165d414c12288c72461 [file] [log] [blame]
halcanarydecb21e2015-12-10 07:52:45 -08001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7#ifndef fiddle_main_DEFINED
8#define fiddle_main_DEFINED
9
halcanaryf0da1382016-04-18 11:50:07 -070010#ifdef FIDDLE_BUILD_TEST
11 #include "GrContext.h"
12 #include "SkCanvas.h"
13 #include "SkDocument.h"
14 #include "SkPictureRecorder.h"
15 #include "SkStream.h"
16 #include "SkSurface.h"
17 #include "gl/GrGLAssembleInterface.h"
18 #include "gl/GrGLInterface.h"
19#else
20 #include "skia.h"
21#endif
halcanarydecb21e2015-12-10 07:52:45 -080022
23extern SkBitmap source;
halcanary7b8b2372016-04-18 08:17:56 -070024extern sk_sp<SkImage> image;
halcanarydecb21e2015-12-10 07:52:45 -080025
26struct DrawOptions {
Matt Saretta2f71262016-11-29 17:14:58 -050027 DrawOptions(int w, int h, bool r, bool g, bool p, bool k, bool srgb, bool f16, const char* s)
halcanarydecb21e2015-12-10 07:52:45 -080028 : size(SkISize::Make(w, h))
29 , raster(r)
30 , gpu(g)
31 , pdf(p)
32 , skp(k)
Matt Saretta2f71262016-11-29 17:14:58 -050033 , srgb(srgb)
34 , f16(f16)
35 , source(s)
36 {
37 // F16 mode is only valid for color correct backends.
38 SkASSERT(srgb || !f16);
39 }
halcanarydecb21e2015-12-10 07:52:45 -080040 SkISize size;
41 bool raster;
42 bool gpu;
43 bool pdf;
44 bool skp;
Matt Saretta2f71262016-11-29 17:14:58 -050045 bool srgb;
46 bool f16;
halcanarydecb21e2015-12-10 07:52:45 -080047 const char* source;
48};
49
50extern DrawOptions GetDrawOptions();
51extern void draw(SkCanvas*);
52
53#endif // fiddle_main_DEFINED