Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
13#include "src/pdf/SkPDFTypes.h"
14
15class SkPaint;
16
17
18/** \class SkPDFGraphicState
19 SkPaint objects roughly correspond to graphic state dictionaries that can
20 be installed. So that a given dictionary is only output to the pdf file
21 once, we want to canonicalize them.
22*/
28
29 /** Get the graphic state for the passed SkPaint.
30 */
32
33 /** Make a graphic state that only sets the passed soft mask.
34 * @param sMask The form xobject to use as a soft mask.
35 * @param invert Indicates if the alpha of the sMask should be inverted.
36 * @param sMaskMode Whether to use alpha or luminosity for the sMask.
37 *
38 * These are not de-duped.
39 */
41 bool invert,
42 SkPDFSMaskMode sMaskMode,
43 SkPDFDocument* doc);
44} // namespace SkPDFGraphicState
45
51 uint8_t fStrokeCap; // SkPaint::Cap
52 uint8_t fStrokeJoin; // SkPaint::Join
53 uint8_t fBlendMode; // SkBlendMode
54 uint8_t fPADDING = 0;
55 bool operator==(const SkPDFStrokeGraphicState& o) const { return !memcmp(this, &o, sizeof(o)); }
56 bool operator!=(const SkPDFStrokeGraphicState& o) const { return !(*this == o); }
57
59};
61
65 uint8_t fBlendMode;
66 uint8_t fPADDING[3] = {0, 0, 0};
67 bool operator==(const SkPDFFillGraphicState& o) const { return !memcmp(this, &o, sizeof(o)); }
68 bool operator!=(const SkPDFFillGraphicState& o) const { return !(*this == o); }
69
71};
73
74#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