Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: src/gpu/GrAtlasTextBlob.cpp

Issue 1508853005: A small text cleanup (Closed) Base URL: https://skia.googlesource.com/skia.git@lcdcolorverts
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlasTextBlob.h ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextBlob.cpp
diff --git a/src/gpu/GrAtlasTextBlob.cpp b/src/gpu/GrAtlasTextBlob.cpp
index 21f297580534efc22d46043bdb0cfe7b38611532..3ccca49ba3cda78804fe9de7cfe29f35e46591ef 100644
--- a/src/gpu/GrAtlasTextBlob.cpp
+++ b/src/gpu/GrAtlasTextBlob.cpp
@@ -7,17 +7,34 @@
#include "GrAtlasTextBlob.h"
-void GrAtlasTextBlob::appendGlyph(Run* run,
- Run::SubRunInfo* subRun,
- const SkRect& positions, GrColor color,
- size_t vertexStride, bool useVertexColor,
+void GrAtlasTextBlob::appendGlyph(int runIndex,
+ const SkRect& positions,
+ GrColor color,
+ GrBatchTextStrike* strike,
GrGlyph* glyph) {
- run->fVertexBounds.joinNonEmptyArg(positions);
- run->fColor = color;
+ Run& run = fRuns[runIndex];
+ GrMaskFormat format = glyph->fMaskFormat;
+
+ Run::SubRunInfo* subRun = &run.fSubRunInfo.back();
+ if (run.fInitialized && subRun->maskFormat() != format) {
+ subRun = &run.push_back();
+ subRun->setStrike(strike);
+ } else if (!run.fInitialized) {
+ subRun->setStrike(strike);
+ }
+
+ run.fInitialized = true;
+
+ size_t vertexStride = GetVertexStride(format);
+
+ subRun->setMaskFormat(format);
+
+ run.fVertexBounds.joinNonEmptyArg(positions);
+ run.fColor = color;
intptr_t vertex = reinterpret_cast<intptr_t>(this->fVertices + subRun->vertexEndIndex());
- if (useVertexColor) {
+ if (kARGB_GrMaskFormat != glyph->fMaskFormat) {
// V0
SkPoint* position = reinterpret_cast<SkPoint*>(vertex);
position->set(positions.fLeft, positions.fTop);
« no previous file with comments | « src/gpu/GrAtlasTextBlob.h ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698