Herb Derby | c1b482c | 2018-08-09 15:02:27 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | |
| 8 | #ifndef GrTextTarget_DEFINED |
| 9 | #define GrTextTarget_DEFINED |
| 10 | |
| 11 | #include "GrColorSpaceInfo.h" |
| 12 | #include "SkPaint.h" |
| 13 | |
| 14 | class GrAtlasTextOp; |
| 15 | class GrClip; |
| 16 | class GrPaint; |
| 17 | class SkGlyphRunListDrawer; |
| 18 | class SkMatrix; |
| 19 | struct SkIRect; |
| 20 | |
| 21 | class GrTextTarget { |
| 22 | public: |
| 23 | virtual ~GrTextTarget() = default; |
| 24 | |
| 25 | int width() const { return fWidth; } |
| 26 | |
| 27 | int height() const { return fHeight; } |
| 28 | |
| 29 | const GrColorSpaceInfo& colorSpaceInfo() const { return fColorSpaceInfo; } |
| 30 | |
| 31 | virtual void addDrawOp(const GrClip&, std::unique_ptr<GrAtlasTextOp> op) = 0; |
| 32 | |
| 33 | virtual void drawPath(const GrClip&, const SkPath&, const SkPaint&, |
Robert Phillips | 137ca52 | 2018-08-15 10:14:33 -0400 | [diff] [blame^] | 34 | const SkMatrix& viewMatrix, bool pathIsMutable) = 0; |
Herb Derby | c1b482c | 2018-08-09 15:02:27 -0400 | [diff] [blame] | 35 | |
| 36 | virtual void makeGrPaint(GrMaskFormat, const SkPaint&, const SkMatrix& viewMatrix, |
| 37 | GrPaint*) = 0; |
| 38 | |
| 39 | virtual GrContext* getContext() = 0; |
| 40 | |
| 41 | virtual SkGlyphRunListDrawer* glyphDrawer() = 0; |
| 42 | |
| 43 | protected: |
| 44 | GrTextTarget(int width, int height, const GrColorSpaceInfo& colorSpaceInfo) |
| 45 | : fWidth(width), fHeight(height), fColorSpaceInfo(colorSpaceInfo) {} |
| 46 | |
| 47 | private: |
| 48 | int fWidth; |
| 49 | int fHeight; |
| 50 | const GrColorSpaceInfo& fColorSpaceInfo; |
| 51 | }; |
| 52 | #endif // GrTextTarget_DEFINED |