Fix build when webrtc is disabled; i.e. when enable_webrtc is set to 0 in build/commo...
[chromium-blink-merge.git] / printing / metafile_skia_wrapper.h
blob901044964ffccab025d5476eccc6de101c0c7c5a
1 // Copyright (c) 2011 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.
5 #ifndef PRINTING_METAFILE_SKIA_WRAPPER_H_
6 #define PRINTING_METAFILE_SKIA_WRAPPER_H_
8 #include "printing/printing_export.h"
9 #include "third_party/skia/include/core/SkRefCnt.h"
11 class SkCanvas;
13 namespace printing {
15 class Metafile;
17 // A wrapper class with static methods to set and retrieve a Metafile
18 // on an SkCanvas. The ownership of the metafile is not affected and it
19 // is the caller's responsibility to ensure that the metafile remains valid
20 // as long as the canvas.
21 class PRINTING_EXPORT MetafileSkiaWrapper : public SkRefCnt {
22 public:
23 static void SetMetafileOnCanvas(const SkCanvas& canvas, Metafile* metafile);
25 static Metafile* GetMetafileFromCanvas(const SkCanvas& canvas);
27 private:
28 explicit MetafileSkiaWrapper(Metafile* metafile);
30 Metafile* metafile_;
33 } // namespace printing
35 #endif // PRINTING_METAFILE_SKIA_WRAPPER_H_