blob: 8db09158576e66644f93213156bdbcf89d1d938c [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
Wei Liab754772018-08-22 22:41:1714class MetafileSkia;
[email protected]7d7489902011-04-11 21:54:0615
Wei Liab754772018-08-22 22:41:1716// A wrapper class with static methods to set and retrieve a MetafileSkia
[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,
Wei Liab754772018-08-22 22:41:1723 MetafileSkia* metafile);
[email protected]7d7489902011-04-11 21:54:0624
Wei Liab754772018-08-22 22:41:1725 static MetafileSkia* GetMetafileFromCanvas(cc::PaintCanvas* canvas);
[email protected]926ae242011-08-02 02:07:0826
[email protected]7d7489902011-04-11 21:54:0627 private:
Wei Liab754772018-08-22 22:41:1728 explicit MetafileSkiaWrapper(MetafileSkia* metafile);
[email protected]7d7489902011-04-11 21:54:0629
Wei Liab754772018-08-22 22:41:1730 MetafileSkia* metafile_;
[email protected]7d7489902011-04-11 21:54:0631};
32
33} // namespace printing
34
35#endif // PRINTING_METAFILE_SKIA_WRAPPER_H_