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 "GrAARectRenderer.h" | 9 #include "GrAARectRenderer.h" |
10 #include "GrAtlasTextContext.h" | 10 #include "GrAtlasTextContext.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 if (!this->prepareToDraw(dst)) { | 51 if (!this->prepareToDraw(dst)) { |
52 return; | 52 return; |
53 } | 53 } |
54 | 54 |
55 fDrawTarget->copySurface(dst, src, srcRect, dstPoint); | 55 fDrawTarget->copySurface(dst, src, srcRect, dstPoint); |
56 } | 56 } |
57 | 57 |
58 GrTextContext* GrDrawContext::createTextContext(GrRenderTarget* renderTarget, | 58 GrTextContext* GrDrawContext::createTextContext(GrRenderTarget* renderTarget, |
59 const SkSurfaceProps& surfacePro
ps) { | 59 const SkSurfaceProps& surfacePro
ps) { |
60 if (fContext->caps()->shaderCaps()->pathRenderingSupport() && | 60 if (fContext->caps()->shaderCaps()->pathRenderingSupport() && |
61 renderTarget->isStencilBufferMultisampled()) { | 61 renderTarget->isStencilBufferMultisampled() && |
| 62 fSurfaceProps.isUseDistanceFieldFonts()) { // FIXME: Rename the dff flag
to be more general. |
62 GrStencilAttachment* sb = renderTarget->renderTargetPriv().attachStencil
Attachment(); | 63 GrStencilAttachment* sb = renderTarget->renderTargetPriv().attachStencil
Attachment(); |
63 if (sb) { | 64 if (sb) { |
64 return GrStencilAndCoverTextContext::Create(fContext, this, surfaceP
rops); | 65 return GrStencilAndCoverTextContext::Create(fContext, this, surfaceP
rops); |
65 } | 66 } |
66 } | 67 } |
67 | 68 |
68 return GrAtlasTextContext::Create(fContext, this, surfaceProps); | 69 return GrAtlasTextContext::Create(fContext, this, surfaceProps); |
69 } | 70 } |
70 | 71 |
71 void GrDrawContext::drawText(GrRenderTarget* rt, const GrClip& clip, const GrPai
nt& grPaint, | 72 void GrDrawContext::drawText(GrRenderTarget* rt, const GrClip& clip, const GrPai
nt& grPaint, |
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 return DrawVerticesBatch::Create(geometry, type, viewMatrix, | 1328 return DrawVerticesBatch::Create(geometry, type, viewMatrix, |
1328 positions.begin(), vertexCount, | 1329 positions.begin(), vertexCount, |
1329 indices.begin(), hasIndices ? vertexCount :
0, | 1330 indices.begin(), hasIndices ? vertexCount :
0, |
1330 colors.begin(), | 1331 colors.begin(), |
1331 texCoords.begin(), | 1332 texCoords.begin(), |
1332 bounds); | 1333 bounds); |
1333 } | 1334 } |
1334 | 1335 |
1335 #endif | 1336 #endif |
1336 | 1337 |
OLD | NEW |