Upload upstream chromium 73.0.3683.0
[platform/framework/web/chromium-efl.git] / printing / metafile_skia_wrapper.h
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PRINTING_METAFILE_SKIA_WRAPPER_H_
6 #define PRINTING_METAFILE_SKIA_WRAPPER_H_
7
8 #include "cc/paint/paint_canvas.h"
9 #include "printing/printing_export.h"
10 #include "third_party/skia/include/core/SkRefCnt.h"
11
12 namespace printing {
13
14 class MetafileSkia;
15
16 // A wrapper class with static methods to set and retrieve a MetafileSkia
17 // on an SkCanvas.  The ownership of the metafile is not affected and it
18 // is the caller's responsibility to ensure that the metafile remains valid
19 // as long as the canvas.
20 class PRINTING_EXPORT MetafileSkiaWrapper : public SkRefCnt {
21  public:
22   static void SetMetafileOnCanvas(cc::PaintCanvas* canvas,
23                                   MetafileSkia* metafile);
24
25   static MetafileSkia* GetMetafileFromCanvas(cc::PaintCanvas* canvas);
26
27  private:
28   explicit MetafileSkiaWrapper(MetafileSkia* metafile);
29
30   MetafileSkia* metafile_;
31 };
32
33 }  // namespace printing
34
35 #endif  // PRINTING_METAFILE_SKIA_WRAPPER_H_