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

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch Created 5 years, 4 months 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/GrAtlasTextContext.h ('k') | src/gpu/GrBatchTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index e3149ad14a9bd12ab7fdd7663f1139617e662dda..3ba32cfe9bf7cda7d481581e1ddd5b191b292a7a 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -1432,7 +1432,7 @@ inline void GrAtlasTextContext::appendGlyphCommon(GrAtlasTextBlob* blob, Run* ru
subRun->fVertexEndIndex += vertexStride * kVerticesPerGlyph;
}
-class TextBatch : public GrBatch {
+class TextBatch : public GrVertexBatch {
public:
typedef GrAtlasTextContext::DistanceAdjustTable DistanceAdjustTable;
typedef GrAtlasTextBlob Blob;
@@ -1893,13 +1893,12 @@ private:
int numGlyphs() const { return fBatch.fNumGlyphs; }
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ TextBatch* that = t->cast<TextBatch>();
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- TextBatch* that = t->cast<TextBatch>();
-
if (fMaskType != that->fMaskType) {
return false;
}
@@ -2087,7 +2086,7 @@ void GrAtlasTextContext::flushRunAsPaths(GrRenderTarget* rt, const SkTextBlob::R
}
}
-inline GrBatch*
+inline GrDrawBatch*
GrAtlasTextContext::createBatch(GrAtlasTextBlob* cacheBlob, const PerSubRunInfo& info,
int glyphCount, int run, int subRun,
GrColor color, SkScalar transX, SkScalar transY,
@@ -2140,9 +2139,9 @@ inline void GrAtlasTextContext::flushRun(GrPipelineBuilder* pipelineBuilder,
continue;
}
- SkAutoTUnref<GrBatch> batch(this->createBatch(cacheBlob, info, glyphCount, run,
- subRun, color, transX, transY,
- skPaint));
+ SkAutoTUnref<GrDrawBatch> batch(this->createBatch(cacheBlob, info, glyphCount, run,
+ subRun, color, transX, transY,
+ skPaint));
fDrawContext->drawBatch(pipelineBuilder, batch);
}
}
@@ -2227,7 +2226,7 @@ void GrAtlasTextContext::flush(GrAtlasTextBlob* cacheBlob,
#ifdef GR_TEST_UTILS
-BATCH_TEST_DEFINE(TextBlobBatch) {
+DRAW_BATCH_TEST_DEFINE(TextBlobBatch) {
static uint32_t gContextID = SK_InvalidGenID;
static GrAtlasTextContext* gTextContext = NULL;
static SkSurfaceProps gSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | src/gpu/GrBatchTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698