joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 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 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 8 | #ifndef GrPathRenderingRenderTargetContext_DEFINED |
| 9 | #define GrPathRenderingRenderTargetContext_DEFINED |
joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 10 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 11 | #include "GrRenderTargetContext.h" |
joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 12 | |
| 13 | class GrStencilAndCoverTextContext; |
| 14 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 15 | class GrPathRenderingRenderTargetContext : public GrRenderTargetContext { |
joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 16 | public: |
Brian Salomon | 6f1d36c | 2017-01-13 12:02:17 -0500 | [diff] [blame] | 17 | void drawText(const GrClip&, const SkPaint&, const SkMatrix& viewMatrix, const char text[], |
| 18 | size_t byteLength, SkScalar x, SkScalar y, const SkIRect& clipBounds) override; |
| 19 | void drawPosText(const GrClip&, const SkPaint&, const SkMatrix& viewMatrix, const char text[], |
| 20 | size_t byteLength, const SkScalar pos[], int scalarsPerPosition, |
| 21 | const SkPoint& offset, const SkIRect& clipBounds) override; |
joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 22 | void drawTextBlob(const GrClip&, const SkPaint&, |
| 23 | const SkMatrix& viewMatrix, const SkTextBlob*, |
| 24 | SkScalar x, SkScalar y, |
| 25 | SkDrawFilter*, const SkIRect& clipBounds) override; |
| 26 | protected: |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 27 | GrPathRenderingRenderTargetContext(GrContext* ctx, GrDrawingManager* mgr, |
Robert Phillips | c7635fa | 2016-10-28 13:25:24 -0400 | [diff] [blame] | 28 | sk_sp<GrRenderTargetProxy> rtp, |
| 29 | sk_sp<SkColorSpace> colorSpace, |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 30 | const SkSurfaceProps* surfaceProps, GrAuditTrail* at, |
| 31 | GrSingleOwner* so) |
Robert Phillips | c7635fa | 2016-10-28 13:25:24 -0400 | [diff] [blame] | 32 | : INHERITED(ctx, mgr, std::move(rtp), std::move(colorSpace), surfaceProps, at, so) {} |
joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 33 | |
| 34 | private: |
Ben Wagner | 145dbcd | 2016-11-03 14:40:50 -0400 | [diff] [blame] | 35 | std::unique_ptr<GrStencilAndCoverTextContext> fStencilAndCoverTextContext; |
joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 36 | |
| 37 | friend class GrDrawingManager; // for ctor |
| 38 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 39 | typedef GrRenderTargetContext INHERITED; |
joshualitt | 96880d9 | 2016-02-16 10:36:53 -0800 | [diff] [blame] | 40 | }; |
| 41 | |
| 42 | #endif |