aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPathRenderingDrawContext.h
blob: 5c1a968b1772d61e8cdd114f97d2f4b3882adda0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrPathRenderingDrawContext_DEFINED
#define GrPathRenderingDrawContext_DEFINED

#include "GrDrawContext.h"

class GrStencilAndCoverTextContext;

class GrPathRenderingDrawContext : public GrDrawContext {
public:
    void drawText(const GrClip&,  const GrPaint&, const SkPaint&,
                  const SkMatrix& viewMatrix, const char text[], size_t byteLength,
                  SkScalar x, SkScalar y, const SkIRect& clipBounds) override;
    void drawPosText(const GrClip&, const GrPaint&, const SkPaint&,
                     const SkMatrix& viewMatrix, const char text[], size_t byteLength,
                     const SkScalar pos[], int scalarsPerPosition,
                     const SkPoint& offset, const SkIRect& clipBounds) override;
    void drawTextBlob(const GrClip&, const SkPaint&,
                      const SkMatrix& viewMatrix, const SkTextBlob*,
                      SkScalar x, SkScalar y,
                      SkDrawFilter*, const SkIRect& clipBounds) override;
protected:
    GrPathRenderingDrawContext(GrContext* ctx, GrDrawingManager* mgr, sk_sp<GrRenderTarget> rt,
                               sk_sp<SkColorSpace> colorSpace, const SkSurfaceProps* surfaceProps,
                               GrAuditTrail* at, GrSingleOwner* so)
        : INHERITED(ctx, mgr, std::move(rt), std::move(colorSpace), surfaceProps, at, so) {}

private:
    SkAutoTDelete<GrStencilAndCoverTextContext> fStencilAndCoverTextContext;

    friend class GrDrawingManager; // for ctor

    typedef GrDrawContext INHERITED;
};

#endif