1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef SkRasterizer_DEFINED
18#define SkRasterizer_DEFINED
19
20#include "SkFlattenable.h"
21#include "SkMask.h"
22
23class SkMaskFilter;
24class SkMatrix;
25class SkPath;
26struct SkIRect;
27
28class SkRasterizer : public SkFlattenable {
29public:
30    SkRasterizer() {}
31
32    /** Turn the path into a mask, respecting the specified local->device matrix.
33    */
34    bool rasterize(const SkPath& path, const SkMatrix& matrix,
35                   const SkIRect* clipBounds, SkMaskFilter* filter,
36                   SkMask* mask, SkMask::CreateMode mode);
37
38    virtual void flatten(SkFlattenableWriteBuffer& ) {}
39protected:
40    SkRasterizer(SkFlattenableReadBuffer&);
41
42    virtual bool onRasterize(const SkPath& path, const SkMatrix& matrix,
43                             const SkIRect* clipBounds,
44                             SkMask* mask, SkMask::CreateMode mode);
45
46private:
47    typedef SkFlattenable INHERITED;
48};
49
50#endif
51