Move pipeline handling out of GrMeshDrawOp.
The monolithic GrPipeline is moved to a subclass GrLegacyDrawMeshOp.
The pipeline used to record a GrMesh draw in a GrMeshDrawOp must now be passed rather than implicitly using the op's pipeline.
Change-Id: I50d77e4dcc8d91a523fa7566ce43a9a291174706
Reviewed-on: https://skia-review.googlesource.com/11002
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/text/GrAtlasTextBlob.cpp b/src/gpu/text/GrAtlasTextBlob.cpp
index 5427855..e8eeb0c 100644
--- a/src/gpu/text/GrAtlasTextBlob.cpp
+++ b/src/gpu/text/GrAtlasTextBlob.cpp
@@ -257,7 +257,7 @@
return false;
}
-inline std::unique_ptr<GrMeshDrawOp> GrAtlasTextBlob::makeOp(
+inline std::unique_ptr<GrLegacyMeshDrawOp> GrAtlasTextBlob::makeOp(
const Run::SubRunInfo& info, int glyphCount, int run, int subRun,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y, const GrTextUtils::Paint& paint,
const SkSurfaceProps& props, const GrDistanceFieldAdjustTable* distanceAdjustTable,
@@ -305,12 +305,12 @@
continue;
}
- std::unique_ptr<GrMeshDrawOp> op(this->makeOp(info, glyphCount, run, subRun, viewMatrix, x,
- y, paint, props, distanceAdjustTable,
- rtc->isGammaCorrect(), cache));
+ std::unique_ptr<GrLegacyMeshDrawOp> op(
+ this->makeOp(info, glyphCount, run, subRun, viewMatrix, x, y, paint, props,
+ distanceAdjustTable, rtc->isGammaCorrect(), cache));
GrPipelineBuilder pipelineBuilder(std::move(grPaint), GrAAType::kNone);
- rtc->addMeshDrawOp(pipelineBuilder, clip, std::move(op));
+ rtc->addLegacyMeshDrawOp(pipelineBuilder, clip, std::move(op));
}
}
@@ -425,7 +425,7 @@
this->flushBigGlyphs(context, rtc, clip, paint, viewMatrix, x, y, clipBounds);
}
-std::unique_ptr<GrMeshDrawOp> GrAtlasTextBlob::test_makeOp(
+std::unique_ptr<GrLegacyMeshDrawOp> GrAtlasTextBlob::test_makeOp(
int glyphCount, int run, int subRun, const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
const GrTextUtils::Paint& paint, const SkSurfaceProps& props,
const GrDistanceFieldAdjustTable* distanceAdjustTable, GrAtlasGlyphCache* cache) {
diff --git a/src/gpu/text/GrAtlasTextBlob.h b/src/gpu/text/GrAtlasTextBlob.h
index 47dd1db..855413b 100644
--- a/src/gpu/text/GrAtlasTextBlob.h
+++ b/src/gpu/text/GrAtlasTextBlob.h
@@ -24,7 +24,7 @@
class GrBlobRegenHelper;
struct GrDistanceFieldAdjustTable;
class GrMemoryPool;
-class GrMeshDrawOp;
+class GrLegacyMeshDrawOp;
class SkDrawFilter;
class SkTextBlob;
class SkTextBlobRunIterator;
@@ -270,12 +270,10 @@
////////////////////////////////////////////////////////////////////////////////////////////////
// Internal test methods
- std::unique_ptr<GrMeshDrawOp> test_makeOp(int glyphCount, int run, int subRun,
- const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
- const GrTextUtils::Paint& paint,
- const SkSurfaceProps& props,
- const GrDistanceFieldAdjustTable* distanceAdjustTable,
- GrAtlasGlyphCache* cache);
+ std::unique_ptr<GrLegacyMeshDrawOp> test_makeOp(
+ int glyphCount, int run, int subRun, const SkMatrix& viewMatrix, SkScalar x, SkScalar y,
+ const GrTextUtils::Paint& paint, const SkSurfaceProps& props,
+ const GrDistanceFieldAdjustTable* distanceAdjustTable, GrAtlasGlyphCache* cache);
private:
GrAtlasTextBlob()
@@ -489,7 +487,7 @@
Run* run, Run::SubRunInfo* info, SkAutoGlyphCache*, int glyphCount,
size_t vertexStride, GrColor color, SkScalar transX, SkScalar transY) const;
- inline std::unique_ptr<GrMeshDrawOp> makeOp(
+ inline std::unique_ptr<GrLegacyMeshDrawOp> makeOp(
const Run::SubRunInfo& info, int glyphCount, int run, int subRun,
const SkMatrix& viewMatrix, SkScalar x, SkScalar y, const GrTextUtils::Paint& paint,
const SkSurfaceProps& props, const GrDistanceFieldAdjustTable* distanceAdjustTable,