blob: 4ff91bb45560189b56ae176d7d183d39f48db641 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001/*
2 * Copyright 2006 The Android Open Source Project
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
reed@android.com8a1c16f2008-12-17 15:59:43 +00008
9#ifndef SkScanPriv_DEFINED
10#define SkScanPriv_DEFINED
11
12#include "SkScan.h"
13#include "SkBlitter.h"
14
15class SkScanClipper {
16public:
reed@google.com5ee64912012-06-11 17:30:33 +000017 SkScanClipper(SkBlitter* blitter, const SkRegion* clip, const SkIRect& bounds,
18 bool skipRejectTest = false);
reed@android.com8a1c16f2008-12-17 15:59:43 +000019
20 SkBlitter* getBlitter() const { return fBlitter; }
21 const SkIRect* getClipRect() const { return fClipRect; }
22
23private:
24 SkRectClipBlitter fRectBlitter;
25 SkRgnClipBlitter fRgnBlitter;
Mike Reed28930b42016-11-09 15:23:26 -050026#ifdef SK_DEBUG
27 SkRectClipCheckBlitter fRectClipCheckBlitter;
28#endif
reed@android.com8a1c16f2008-12-17 15:59:43 +000029 SkBlitter* fBlitter;
30 const SkIRect* fClipRect;
31};
32
33// clipRect == null means path is entirely inside the clip
34void sk_fill_path(const SkPath& path, const SkIRect* clipRect,
reed@android.comdca6a562010-02-22 16:05:48 +000035 SkBlitter* blitter, int start_y, int stop_y, int shiftEdgesUp,
reed@android.com8a1c16f2008-12-17 15:59:43 +000036 const SkRegion& clipRgn);
37
reed@google.com55b6b582011-03-02 15:58:18 +000038// blit the rects above and below avoid, clipped to clip
39void sk_blit_above(SkBlitter*, const SkIRect& avoid, const SkRegion& clip);
40void sk_blit_below(SkBlitter*, const SkIRect& avoid, const SkRegion& clip);
reed@android.com8a1c16f2008-12-17 15:59:43 +000041
42#endif