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.fColorIgnored) { | 1501 if (!init.readsColor()) { |
1502 fBatch.fColor = GrColor_ILLEGAL; | 1502 fBatch.fColor = GrColor_ILLEGAL; |
1503 } else if (GrColor_ILLEGAL != init.fOverrideColor) { | |
1504 fBatch.fColor = init.fOverrideColor; | |
1505 } | 1503 } |
| 1504 init.getOverrideColorIfSet(&fBatch.fColor); |
1506 | 1505 |
1507 // setup batch properties | 1506 // setup batch properties |
1508 fBatch.fColorIgnored = init.fColorIgnored; | 1507 fBatch.fColorIgnored = !init.readsColor(); |
1509 fBatch.fUsesLocalCoords = init.fUsesLocalCoords; | 1508 fBatch.fUsesLocalCoords = init.readsLocalCoords(); |
1510 fBatch.fCoverageIgnored = init.fCoverageIgnored; | 1509 fBatch.fCoverageIgnored = !init.readsCoverage(); |
1511 } | 1510 } |
1512 | 1511 |
1513 struct FlushInfo { | 1512 struct FlushInfo { |
1514 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; | 1513 SkAutoTUnref<const GrVertexBuffer> fVertexBuffer; |
1515 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; | 1514 SkAutoTUnref<const GrIndexBuffer> fIndexBuffer; |
1516 int fGlyphsToFlush; | 1515 int fGlyphsToFlush; |
1517 int fVertexOffset; | 1516 int fVertexOffset; |
1518 }; | 1517 }; |
1519 | 1518 |
1520 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { | 1519 void generateGeometry(GrBatchTarget* batchTarget, const GrPipeline* pipeline
) override { |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, | 2266 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, |
2268 static_cast<size_t>(textLen), 0, 0,
noClip)); | 2267 static_cast<size_t>(textLen), 0, 0,
noClip)); |
2269 | 2268 |
2270 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 2269 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
2271 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 2270 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
2272 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; | 2271 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; |
2273 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 2272 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
2274 } | 2273 } |
2275 | 2274 |
2276 #endif | 2275 #endif |
OLD | NEW |