| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
| 10 #include "GrBatchTest.h" | 10 #include "GrBatchTest.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const SkMatrix& viewMatrix, | 93 const SkMatrix& viewMatrix, |
| 94 const char text[], size_t byteLength, | 94 const char text[], size_t byteLength, |
| 95 SkScalar x, SkScalar y, const SkIRect& clipBounds)
{ | 95 SkScalar x, SkScalar y, const SkIRect& clipBounds)
{ |
| 96 RETURN_IF_ABANDONED | 96 RETURN_IF_ABANDONED |
| 97 SkDEBUGCODE(this->validate();) | 97 SkDEBUGCODE(this->validate();) |
| 98 | 98 |
| 99 if (!fTextContext) { | 99 if (!fTextContext) { |
| 100 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); | 100 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); |
| 101 } | 101 } |
| 102 | 102 |
| 103 fTextContext->drawText(this, fRenderTarget, clip, grPaint, skPaint, viewMatr
ix, | 103 fTextContext->drawText(this, clip, grPaint, skPaint, viewMatrix, |
| 104 text, byteLength, x, y, clipBounds); | 104 text, byteLength, x, y, clipBounds); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint, | 107 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint, |
| 108 const SkPaint& skPaint, | 108 const SkPaint& skPaint, |
| 109 const SkMatrix& viewMatrix, | 109 const SkMatrix& viewMatrix, |
| 110 const char text[], size_t byteLength, | 110 const char text[], size_t byteLength, |
| 111 const SkScalar pos[], int scalarsPerPosition, | 111 const SkScalar pos[], int scalarsPerPosition, |
| 112 const SkPoint& offset, const SkIRect& clipBounds
) { | 112 const SkPoint& offset, const SkIRect& clipBounds
) { |
| 113 RETURN_IF_ABANDONED | 113 RETURN_IF_ABANDONED |
| 114 SkDEBUGCODE(this->validate();) | 114 SkDEBUGCODE(this->validate();) |
| 115 | 115 |
| 116 if (!fTextContext) { | 116 if (!fTextContext) { |
| 117 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); | 117 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); |
| 118 } | 118 } |
| 119 | 119 |
| 120 fTextContext->drawPosText(this, fRenderTarget, clip, grPaint, skPaint, viewM
atrix, text, byteLength, | 120 fTextContext->drawPosText(this, clip, grPaint, skPaint, viewMatrix, text, by
teLength, |
| 121 pos, scalarsPerPosition, offset, clipBounds); | 121 pos, scalarsPerPosition, offset, clipBounds); |
| 122 | 122 |
| 123 } | 123 } |
| 124 | 124 |
| 125 void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint, | 125 void GrDrawContext::drawTextBlob(const GrClip& clip, const SkPaint& skPaint, |
| 126 const SkMatrix& viewMatrix, const SkTextBlob* b
lob, | 126 const SkMatrix& viewMatrix, const SkTextBlob* b
lob, |
| 127 SkScalar x, SkScalar y, | 127 SkScalar x, SkScalar y, |
| 128 SkDrawFilter* filter, const SkIRect& clipBounds
) { | 128 SkDrawFilter* filter, const SkIRect& clipBounds
) { |
| 129 RETURN_IF_ABANDONED | 129 RETURN_IF_ABANDONED |
| 130 SkDEBUGCODE(this->validate();) | 130 SkDEBUGCODE(this->validate();) |
| 131 | 131 |
| 132 if (!fTextContext) { | 132 if (!fTextContext) { |
| 133 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); | 133 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); |
| 134 } | 134 } |
| 135 | 135 |
| 136 fTextContext->drawTextBlob(this, fRenderTarget, | 136 fTextContext->drawTextBlob(this, clip, skPaint, viewMatrix, blob, x, y, filt
er, clipBounds); |
| 137 clip, skPaint, viewMatrix, blob, x, y, filter, cl
ipBounds); | |
| 138 } | 137 } |
| 139 | 138 |
| 140 void GrDrawContext::drawPathsFromRange(const GrPipelineBuilder* pipelineBuilder, | 139 void GrDrawContext::drawPathsFromRange(const GrPipelineBuilder* pipelineBuilder, |
| 141 const SkMatrix& viewMatrix, | 140 const SkMatrix& viewMatrix, |
| 142 const SkMatrix& localMatrix, | 141 const SkMatrix& localMatrix, |
| 143 GrColor color, | 142 GrColor color, |
| 144 GrPathRange* range, | 143 GrPathRange* range, |
| 145 GrPathRangeDraw* draw, | 144 GrPathRangeDraw* draw, |
| 146 int /*GrPathRendering::FillType*/ fill, | 145 int /*GrPathRendering::FillType*/ fill, |
| 147 const SkRect& bounds) { | 146 const SkRect& bounds) { |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 args.fAntiAlias = useCoverageAA; | 796 args.fAntiAlias = useCoverageAA; |
| 798 pr->drawPath(args); | 797 pr->drawPath(args); |
| 799 } | 798 } |
| 800 | 799 |
| 801 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { | 800 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { |
| 802 RETURN_IF_ABANDONED | 801 RETURN_IF_ABANDONED |
| 803 SkDEBUGCODE(this->validate();) | 802 SkDEBUGCODE(this->validate();) |
| 804 | 803 |
| 805 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); | 804 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); |
| 806 } | 805 } |
| OLD | NEW |