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

Unified Diff: src/gpu/batches/GrNinePatch.cpp

Issue 1467553002: New API for computing optimization invariants. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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/batches/GrDrawVerticesBatch.cpp ('k') | src/gpu/batches/GrNonAAFillRectBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrNinePatch.cpp
diff --git a/src/gpu/batches/GrNinePatch.cpp b/src/gpu/batches/GrNinePatch.cpp
index 999e1fd1562dbbeb54d42d5085e00f5a7211cee7..b438919a8749dd52b931e7fdd48cbadba866c3b3 100644
--- a/src/gpu/batches/GrNinePatch.cpp
+++ b/src/gpu/batches/GrNinePatch.cpp
@@ -74,19 +74,19 @@ public:
return str;
}
- void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
- out->setUnknownFourComponents();
- }
-
- void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
- out->setKnownSingleComponent(0xff);
+ void computePipelineOptimizations(GrInitInvariantOutput* color,
+ GrInitInvariantOutput* coverage,
+ GrBatchToXPOverrides* overrides) const override {
+ color->setUnknownFourComponents();
+ coverage->setKnownSingleComponent(0xff);
+ overrides->fUsePLSDstRead = false;
}
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
private:
void onPrepareDraws(Target* target) override {
- SkAutoTUnref<const GrGeometryProcessor> gp(create_gp(fOpts.readsCoverage()));
+ SkAutoTUnref<const GrGeometryProcessor> gp(create_gp(fOverrides.readsCoverage()));
if (!gp) {
SkDebugf("Couldn't create GrGeometryProcessor\n");
return;
@@ -142,9 +142,9 @@ private:
helper.recordDraw(target);
}
- void initBatchTracker(const GrPipelineOptimizations& opt) override {
- opt.getOverrideColorIfSet(&fGeoData[0].fColor);
- fOpts = opt;
+ void initBatchTracker(const GrXPOverridesForBatch& overrides) override {
+ overrides.getOverrideColorIfSet(&fGeoData[0].fColor);
+ fOverrides = overrides;
}
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
@@ -159,8 +159,8 @@ private:
// In the event of two batches, one who can tweak, one who cannot, we just fall back to
// not tweaking
- if (fOpts.canTweakAlphaForCoverage() && !that->fOpts.canTweakAlphaForCoverage()) {
- fOpts = that->fOpts;
+ if (fOverrides.canTweakAlphaForCoverage() && !that->fOverrides.canTweakAlphaForCoverage()) {
+ fOverrides = that->fOverrides;
}
fGeoData.push_back_n(that->geoData()->count(), that->geoData()->begin());
@@ -168,7 +168,7 @@ private:
return true;
}
- GrPipelineOptimizations fOpts;
+ GrXPOverridesForBatch fOverrides;
int fImageWidth;
int fImageHeight;
SkSTArray<1, Geometry, true> fGeoData;
« no previous file with comments | « src/gpu/batches/GrDrawVerticesBatch.cpp ('k') | src/gpu/batches/GrNonAAFillRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698