OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 #include "GrAtlasTextContext.h" | 7 #include "GrAtlasTextContext.h" |
8 | 8 |
9 #include "GrBatch.h" | 9 #include "GrBatch.h" |
10 #include "GrBatchFontCache.h" | 10 #include "GrBatchFontCache.h" |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 out->setUnknownSingleComponent(); | 1491 out->setUnknownSingleComponent(); |
1492 } else { | 1492 } else { |
1493 out->setUnknownFourComponents(); | 1493 out->setUnknownFourComponents(); |
1494 out->setUsingLCDCoverage(); | 1494 out->setUsingLCDCoverage(); |
1495 } | 1495 } |
1496 } | 1496 } |
1497 } | 1497 } |
1498 | 1498 |
1499 void initBatchTracker(const GrPipelineInfo& init) override { | 1499 void initBatchTracker(const GrPipelineInfo& init) override { |
1500 // Handle any color overrides | 1500 // Handle any color overrides |
1501 if (!init.readsColor()) { | 1501 if (init.fColorIgnored) { |
1502 fBatch.fColor = GrColor_ILLEGAL; | 1502 fBatch.fColor = GrColor_ILLEGAL; |
| 1503 } else if (GrColor_ILLEGAL != init.fOverrideColor) { |
| 1504 fBatch.fColor = init.fOverrideColor; |
1503 } | 1505 } |
1504 init.getOverrideColorIfSet(&fBatch.fColor); | |
1505 | 1506 |
1506 // setup batch properties | 1507 // setup batch properties |
1507 fBatch.fColorIgnored = !init.readsColor(); | 1508 fBatch.fColorIgnored = init.fColorIgnored; |
1508 fBatch.fUsesLocalCoords = init.readsLocalCoords(); | 1509 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; |
1509 fBatch.fCoverageIgnored = !init.readsCoverage(); | 1510 fBatch.fCoverageIgnored = init.fCoverageIgnored; |
1510 } | 1511 } |
1511 | 1512 |
1512 struct FlushInfo { | 1513 struct FlushInfo { |
1513 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 1514 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
1514 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 1515 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
1515 int fGlyphsToFlush; | 1516 int fGlyphsToFlush; |
1516 int fVertexOffset; | 1517 int fVertexOffset; |
1517 }; | 1518 }; |
1518 | 1519 |
1519 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { | 1520 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2266 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, | 2267 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, |
2267 static_cast<size_t>(textLen), 0, 0,
noClip)); | 2268 static_cast<size_t>(textLen), 0, 0,
noClip)); |
2268 | 2269 |
2269 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 2270 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
2270 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 2271 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
2271 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; | 2272 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; |
2272 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 2273 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
2273 } | 2274 } |
2274 | 2275 |
2275 #endif | 2276 #endif |
OLD | NEW |