SkRasterizer.h revision 8a1c16ff38322f0210116fa7293eb8817c7e477e
18a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/*
28a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Copyright (C) 2006 The Android Open Source Project
38a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *
48a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Licensed under the Apache License, Version 2.0 (the "License");
58a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * you may not use this file except in compliance with the License.
68a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * You may obtain a copy of the License at
78a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *
88a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *      http://www.apache.org/licenses/LICENSE-2.0
98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com *
108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * Unless required by applicable law or agreed to in writing, software
118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * distributed under the License is distributed on an "AS IS" BASIS,
128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * See the License for the specific language governing permissions and
148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * limitations under the License.
158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */
168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifndef SkRasterizer_DEFINED
188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#define SkRasterizer_DEFINED
198a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkFlattenable.h"
218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#include "SkMask.h"
228a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkMaskFilter;
248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkMatrix;
258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkPath;
268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comstruct SkIRect;
278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comclass SkRasterizer : public SkFlattenable {
298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.compublic:
308a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkRasterizer() {}
318a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    /** Turn the path into a mask, respecting the specified local->device matrix.
338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    */
348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    bool rasterize(const SkPath& path, const SkMatrix& matrix,
358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com                   const SkIRect* clipBounds, SkMaskFilter* filter,
368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com                   SkMask* mask, SkMask::CreateMode mode);
378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual void flatten(SkFlattenableWriteBuffer& ) {}
398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprotected:
408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    SkRasterizer(SkFlattenableReadBuffer&);
418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    virtual bool onRasterize(const SkPath& path, const SkMatrix& matrix,
438a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com                             const SkIRect* clipBounds,
448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com                             SkMask* mask, SkMask::CreateMode mode);
458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comprivate:
478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com    typedef SkFlattenable INHERITED;
488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com};
498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com
508a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif
51