Flutter Engine
The Flutter Engine
SkPDFGraphicState.h
Go to the documentation of this file.
1/*
2 * Copyright 2010 The Android Open Source Project
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
9#ifndef SkPDFGraphicState_DEFINED
10#define SkPDFGraphicState_DEFINED
11
14#include "src/core/SkChecksum.h"
15#include "src/pdf/SkPDFTypes.h"
16
17#include <cstdint>
18#include <cstring>
19
20class SkPDFDocument;
21class SkPaint;
22
23/** \class SkPDFGraphicState
24 SkPaint objects roughly correspond to graphic state dictionaries that can
25 be installed. So that a given dictionary is only output to the pdf file
26 once, we want to canonicalize them.
27*/
32 };
33
34 /** Get the graphic state for the passed SkPaint.
35 */
37
38 /** Make a graphic state that only sets the passed soft mask.
39 * @param sMask The form xobject to use as a soft mask.
40 * @param invert Indicates if the alpha of the sMask should be inverted.
41 * @param sMaskMode Whether to use alpha or luminosity for the sMask.
42 *
43 * These are not de-duped.
44 */
46 bool invert,
47 SkPDFSMaskMode sMaskMode,
48 SkPDFDocument* doc);
49} // namespace SkPDFGraphicState
50
56 uint8_t fStrokeCap; // SkPaint::Cap
57 uint8_t fStrokeJoin; // SkPaint::Join
58 uint8_t fBlendMode; // SkBlendMode
59 uint8_t fPADDING = 0;
60 bool operator==(const SkPDFStrokeGraphicState& o) const { return !memcmp(this, &o, sizeof(o)); }
61 bool operator!=(const SkPDFStrokeGraphicState& o) const { return !(*this == o); }
62
64};
66
70 uint8_t fBlendMode;
71 uint8_t fPADDING[3] = {0, 0, 0};
72 bool operator==(const SkPDFFillGraphicState& o) const { return !memcmp(this, &o, sizeof(o)); }
73 bool operator!=(const SkPDFFillGraphicState& o) const { return !(*this == o); }
74
76};
78
79#endif
#define SK_BEGIN_REQUIRE_DENSE
Definition: SkMacros.h:37
#define SK_END_REQUIRE_DENSE
Definition: SkMacros.h:38
float SkScalar
Definition: extension.cpp:12
gboolean invert
SkPDFIndirectReference GetGraphicStateForPaint(SkPDFDocument *, const SkPaint &)
SkPDFIndirectReference GetSMaskGraphicState(SkPDFIndirectReference sMask, bool invert, SkPDFSMaskMode sMaskMode, SkPDFDocument *doc)
bool operator!=(const SkPDFFillGraphicState &o) const
bool operator==(const SkPDFFillGraphicState &o) const
bool operator!=(const SkPDFStrokeGraphicState &o) const
bool operator==(const SkPDFStrokeGraphicState &o) const