1 /*
2  * Copyright 2016 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 #ifndef SkPDFCanvas_DEFINED
8 #define SkPDFCanvas_DEFINED
9 
10 #include "SkCanvas.h"
11 
12 class SkPDFDevice;
13 
14 class SkPDFCanvas : public SkCanvas {
15 public:
16     SkPDFCanvas(const sk_sp<SkPDFDevice>&);
17     ~SkPDFCanvas() override;
18 
19 protected:
20     void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
21     void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
22     void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
23 
24     void onDrawBitmapNine(const SkBitmap&, const SkIRect&, const SkRect&,
25                           const SkPaint*) override;
26 
27     void onDrawImageNine(const SkImage*, const SkIRect&, const SkRect&,
28                          const SkPaint*) override;
29 
30     void onDrawImageRect(const SkImage*,
31                          const SkRect*,
32                          const SkRect&,
33                          const SkPaint*,
34                          SkCanvas::SrcRectConstraint) override;
35 
36     void onDrawBitmapRect(const SkBitmap&,
37                           const SkRect*,
38                           const SkRect&,
39                           const SkPaint*,
40                           SkCanvas::SrcRectConstraint) override;
41 
42     void onDrawImageLattice(const SkImage*,
43                             const Lattice&,
44                             const SkRect&,
45                             const SkPaint*) override;
46 
47     void onDrawBitmapLattice(const SkBitmap&,
48                              const Lattice&,
49                              const SkRect&,
50                              const SkPaint*) override;
51 
52 private:
53     typedef SkCanvas INHERITED;
54 };
55 
56 #endif  // SkPDFCanvas_DEFINED
57