• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright 2020 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 SkMarkerStack_DEFINED
9 #define SkMarkerStack_DEFINED
10 
11 #include "include/core/SkM44.h"
12 #include "include/core/SkRefCnt.h"
13 
14 #include <vector>
15 
16 class SkMarkerStack : public SkRefCnt {
17 public:
SkMarkerStack()18     SkMarkerStack() {}
19 
20     void setMarker(uint32_t id, const SkM44& mx, void* boundary);
21     bool findMarker(uint32_t id, SkM44* mx) const;
22     bool findMarkerInverse(uint32_t id, SkM44* mx) const;
23     void restore(void* boundary);
24 
25 private:
26     struct Rec {
27         void*       fBoundary;
28         SkM44       fMatrix;
29         SkM44       fMatrixInverse;
30         uint32_t    fID;
31     };
32     std::vector<Rec> fStack;
33 };
34 
35 #endif
36