#ifndef SkPDFGraphicStackState_DEFINED
#define SkPDFGraphicStackState_DEFINED
#include "include/core/SkColor.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkScalar.h"
#include "src/core/SkClipStack.h"
class SkDynamicMemoryWStream;
struct SkPDFGraphicStackState {
struct Entry {
SkMatrix fMatrix = SkMatrix::I();
uint32_t fClipStackGenID = SkClipStack::kWideOpenGenID;
SkColor4f fColor = {0, 0, 0, 1};
SkScalar fTextScaleX = 1;
int fShaderIndex = -1;
int fGraphicStateIndex = -1;
};
static constexpr int kMaxStackDepth = 2;
Entry fEntries[kMaxStackDepth + 1];
int fStackDepth = 0;
SkDynamicMemoryWStream* fContentStream;
SkPDFGraphicStackState(SkDynamicMemoryWStream* s = nullptr) : fContentStream(s) {}
void updateClip(const SkClipStack* clipStack, const SkIRect& bounds);
void updateMatrix(const SkMatrix& matrix);
void updateDrawingState(const Entry& state);
void push();
void pop();
void drainStack();
Entry* currentEntry() { return &fEntries[fStackDepth]; }
};
#endif