blob: 4bca57fd6af6b57a65bcad1afbeb1e572984b487 [file] [log] [blame]
[email protected]f64d7a352012-05-09 17:22:211// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]7d7489902011-04-11 21:54:062// 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
enne7b64edf32017-02-16 20:10:028#include "cc/paint/paint_canvas.h"
[email protected]69f5b1e62011-09-01 06:34:049#include "printing/printing_export.h"
[email protected]7d7489902011-04-11 21:54:0610#include "third_party/skia/include/core/SkRefCnt.h"
11
[email protected]7d7489902011-04-11 21:54:0612namespace printing {
13
vitalybukaa68e23e2014-09-12 00:59:1214class PdfMetafileSkia;
[email protected]7d7489902011-04-11 21:54:0615
vitalybukaa68e23e2014-09-12 00:59:1216// A wrapper class with static methods to set and retrieve a PdfMetafileSkia
[email protected]7d7489902011-04-11 21:54:0617// 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.
[email protected]69f5b1e62011-09-01 06:34:0420class PRINTING_EXPORT MetafileSkiaWrapper : public SkRefCnt {
[email protected]7d7489902011-04-11 21:54:0621 public:
enne7b64edf32017-02-16 20:10:0222 static void SetMetafileOnCanvas(cc::PaintCanvas* canvas,
vitalybukaa68e23e2014-09-12 00:59:1223 PdfMetafileSkia* metafile);
[email protected]7d7489902011-04-11 21:54:0624
enne7b64edf32017-02-16 20:10:0225 static PdfMetafileSkia* GetMetafileFromCanvas(cc::PaintCanvas* canvas);
[email protected]926ae242011-08-02 02:07:0826
[email protected]7d7489902011-04-11 21:54:0627 private:
vitalybukaa68e23e2014-09-12 00:59:1228 explicit MetafileSkiaWrapper(PdfMetafileSkia* metafile);
[email protected]7d7489902011-04-11 21:54:0629
vitalybukaa68e23e2014-09-12 00:59:1230 PdfMetafileSkia* metafile_;
[email protected]7d7489902011-04-11 21:54:0631};
32
33} // namespace printing
34
35#endif // PRINTING_METAFILE_SKIA_WRAPPER_H_