blob: d249898edafdbeb6abbd39035531e2af2b942b26 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
reed@android.com8a1c16f2008-12-17 15:59:43 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2006 The Android Open Source Project
reed@android.com8a1c16f2008-12-17 15:59:43 +00004 *
epoger@google.comec3ed6a2011-07-28 14:26:00 +00005 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
reed@android.com8a1c16f2008-12-17 15:59:43 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
reed@android.com8a1c16f2008-12-17 15:59:43 +000010#ifndef SkRasterizer_DEFINED
11#define SkRasterizer_DEFINED
12
13#include "SkFlattenable.h"
14#include "SkMask.h"
15
16class SkMaskFilter;
17class SkMatrix;
18class SkPath;
19struct SkIRect;
20
21class SkRasterizer : public SkFlattenable {
22public:
23 SkRasterizer() {}
24
25 /** Turn the path into a mask, respecting the specified local->device matrix.
26 */
27 bool rasterize(const SkPath& path, const SkMatrix& matrix,
28 const SkIRect* clipBounds, SkMaskFilter* filter,
29 SkMask* mask, SkMask::CreateMode mode);
30
tomhudson@google.com13413042011-10-03 16:01:10 +000031 virtual void flatten(SkFlattenableWriteBuffer& ) SK_OVERRIDE {}
reed@android.com8a1c16f2008-12-17 15:59:43 +000032protected:
33 SkRasterizer(SkFlattenableReadBuffer&);
34
35 virtual bool onRasterize(const SkPath& path, const SkMatrix& matrix,
36 const SkIRect* clipBounds,
37 SkMask* mask, SkMask::CreateMode mode);
38
39private:
40 typedef SkFlattenable INHERITED;
41};
42
43#endif