Flutter Engine
The Flutter Engine
CanvasStateHelpers.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 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
8#ifndef CanvasStateHelpers_DEFINED
9#define CanvasStateHelpers_DEFINED
10
12
13#include <cstdint>
14
15// See CanvasStateTest. These functions are either linked in to 'dm' directly (when this flag is
16// not defined), or built in a shared library that is dlopened by the test. In that case, they
17// should not be visible in 'dm', but the shared library will not have this flag set and compiles
18// them as expected.
19#if !defined(SK_TEST_CANVAS_STATE_CROSS_LIBRARY)
20
21class SkCanvas;
22class SkCanvasState;
23class SkRegion;
24
25#if defined(SK_BUILD_FOR_WIN)
26#define EXPORT _declspec(dllexport)
27#else
28#define EXPORT
29#endif
30
31/*
32 * Helper function to perform drawing to an SkCanvas. Used by both
33 * test_complex_layers and complex_layers_draw_from_canvas_state.
34 */
35void complex_layers_draw(SkCanvas* canvas, float left, float top,
36 float right, float bottom, int32_t spacer);
37
38/*
39 * Create an SkCanvas from state and draw to it. Return true on success.
40 *
41 * Used by test_complex_layers test in CanvasStateTest. Marked as extern
42 * so it can be called from a separate library.
43 */
45 float left, float top, float right, float bottom, int32_t spacer);
46
47/*
48 * Helper function to perform drawing to an SkCanvas. Used both by test_complex_clips
49 * and complex_clips_draw_from_canvas_state.
50 */
51void complex_clips_draw(SkCanvas* canvas, int32_t left, int32_t top,
52 int32_t right, int32_t bottom, int32_t clipOp, const SkRegion& localRegion);
53
54/*
55 * Create an SkCanvas from state and draw to it. Return true on success.
56 *
57 * Used by test_complex_clips test in CanvasStateTest. Marked as extern
58 * so it can be called from a separate library.
59 */
61 int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t clipOp,
62 int32_t regionRects, int32_t* rectCoords);
63
64#endif // SK_TEST_CANVAS_STATE_CROSS_LIBRARY
65#endif // CanvasStateHelpers_DEFINED
#define EXPORT
void complex_layers_draw(SkCanvas *canvas, float left, float top, float right, float bottom, int32_t spacer)
bool EXPORT complex_clips_draw_from_canvas_state(SkCanvasState *state, int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t clipOp, int32_t regionRects, int32_t *rectCoords)
bool EXPORT complex_layers_draw_from_canvas_state(SkCanvasState *state, float left, float top, float right, float bottom, int32_t spacer)
void complex_clips_draw(SkCanvas *canvas, int32_t left, int32_t top, int32_t right, int32_t bottom, int32_t clipOp, const SkRegion &localRegion)
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
AtkStateType state