| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 return fDrawTarget; | 81 return fDrawTarget; |
| 82 } | 82 } |
| 83 | 83 |
| 84 void GrDrawContext::copySurface(GrSurface* src, const SkIRect& srcRect, const Sk
IPoint& dstPoint) { | 84 void GrDrawContext::copySurface(GrSurface* src, const SkIRect& srcRect, const Sk
IPoint& dstPoint) { |
| 85 RETURN_IF_ABANDONED | 85 RETURN_IF_ABANDONED |
| 86 SkDEBUGCODE(this->validate();) | 86 SkDEBUGCODE(this->validate();) |
| 87 | 87 |
| 88 this->getDrawTarget()->copySurface(fRenderTarget, src, srcRect, dstPoint); | 88 this->getDrawTarget()->copySurface(fRenderTarget, src, srcRect, dstPoint); |
| 89 } | 89 } |
| 90 | 90 |
| 91 | |
| 92 void GrDrawContext::drawText(const GrClip& clip, const GrPaint& grPaint, | 91 void GrDrawContext::drawText(const GrClip& clip, const GrPaint& grPaint, |
| 93 const SkPaint& skPaint, | 92 const SkPaint& skPaint, |
| 94 const SkMatrix& viewMatrix, | 93 const SkMatrix& viewMatrix, |
| 95 const char text[], size_t byteLength, | 94 const char text[], size_t byteLength, |
| 96 SkScalar x, SkScalar y, const SkIRect& clipBounds)
{ | 95 SkScalar x, SkScalar y, const SkIRect& clipBounds)
{ |
| 97 RETURN_IF_ABANDONED | 96 RETURN_IF_ABANDONED |
| 98 SkDEBUGCODE(this->validate();) | 97 SkDEBUGCODE(this->validate();) |
| 99 | 98 |
| 100 if (!fTextContext) { | 99 if (!fTextContext) { |
| 101 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); | 100 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); |
| 102 } | 101 } |
| 103 | 102 |
| 104 fTextContext->drawText(this, fRenderTarget, clip, grPaint, skPaint, viewMatr
ix, | 103 fTextContext->drawText(this, fRenderTarget, clip, grPaint, skPaint, viewMatr
ix, |
| 105 text, byteLength, x, y, clipBounds); | 104 text, byteLength, x, y, clipBounds); |
| 105 } |
| 106 | 106 |
| 107 } | |
| 108 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint, | 107 void GrDrawContext::drawPosText(const GrClip& clip, const GrPaint& grPaint, |
| 109 const SkPaint& skPaint, | 108 const SkPaint& skPaint, |
| 110 const SkMatrix& viewMatrix, | 109 const SkMatrix& viewMatrix, |
| 111 const char text[], size_t byteLength, | 110 const char text[], size_t byteLength, |
| 112 const SkScalar pos[], int scalarsPerPosition, | 111 const SkScalar pos[], int scalarsPerPosition, |
| 113 const SkPoint& offset, const SkIRect& clipBounds
) { | 112 const SkPoint& offset, const SkIRect& clipBounds
) { |
| 114 RETURN_IF_ABANDONED | 113 RETURN_IF_ABANDONED |
| 115 SkDEBUGCODE(this->validate();) | 114 SkDEBUGCODE(this->validate();) |
| 116 | 115 |
| 117 if (!fTextContext) { | 116 if (!fTextContext) { |
| 118 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); | 117 fTextContext = fDrawingManager->textContext(fSurfaceProps, fRenderTarget
); |
| 119 } | 118 } |
| 120 | 119 |
| 121 fTextContext->drawPosText(this, fRenderTarget, clip, grPaint, skPaint, viewM
atrix, text, byteLength, | 120 fTextContext->drawPosText(this, fRenderTarget, clip, grPaint, skPaint, viewM
atrix, text, byteLength, |
| 122 pos, scalarsPerPosition, offset, clipBounds); | 121 pos, scalarsPerPosition, offset, clipBounds); |
| 123 | 122 |
| 124 } | 123 } |
| 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 } |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 args.fAntiAlias = useCoverageAA; | 788 args.fAntiAlias = useCoverageAA; |
| 789 pr->drawPath(args); | 789 pr->drawPath(args); |
| 790 } | 790 } |
| 791 | 791 |
| 792 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { | 792 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { |
| 793 RETURN_IF_ABANDONED | 793 RETURN_IF_ABANDONED |
| 794 SkDEBUGCODE(this->validate();) | 794 SkDEBUGCODE(this->validate();) |
| 795 | 795 |
| 796 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); | 796 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); |
| 797 } | 797 } |
| OLD | NEW |