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