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

Unified Diff: src/gpu/GrStrokeRectBatch.h

Issue 1277233002: Make folder for batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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/GrRectBatch.cpp ('k') | src/gpu/GrStrokeRectBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStrokeRectBatch.h
diff --git a/src/gpu/GrStrokeRectBatch.h b/src/gpu/GrStrokeRectBatch.h
deleted file mode 100644
index cfd9949442d96429e05cde83d0d33c321516048c..0000000000000000000000000000000000000000
--- a/src/gpu/GrStrokeRectBatch.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef GrStrokeRectBatch_DEFINED
-#define GrStrokeRectBatch_DEFINED
-
-#include "GrBatch.h"
-#include "GrColor.h"
-#include "GrDefaultGeoProcFactory.h"
-
-class GrStrokeRectBatch : public GrBatch {
-public:
- struct Geometry {
- GrColor fColor;
- SkMatrix fViewMatrix;
- SkRect fRect;
- SkScalar fStrokeWidth;
- };
-
- static GrBatch* Create(const Geometry& geometry, bool snapToPixelCenters) {
- return SkNEW_ARGS(GrStrokeRectBatch, (geometry, snapToPixelCenters));
- }
-
- const char* name() const override { return "GrStrokeRectBatch"; }
-
- void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
- // When this is called on a batch, there is only one geometry bundle
- out->setKnownFourComponents(fGeoData[0].fColor);
- }
-
- void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
- out->setKnownSingleComponent(0xff);
- }
-
- void initBatchTracker(const GrPipelineInfo& init) override;
-
- void generateGeometry(GrBatchTarget* batchTarget) override;
-
-private:
- GrStrokeRectBatch(const Geometry& geometry, bool snapToPixelCenters);
-
- GrColor color() const { return fBatch.fColor; }
- bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
- bool colorIgnored() const { return fBatch.fColorIgnored; }
- const SkMatrix& viewMatrix() const { return fGeoData[0].fViewMatrix; }
- bool hairline() const { return fBatch.fHairline; }
- bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
-
- bool onCombineIfPossible(GrBatch* t) override {
- //if (!this->pipeline()->isEqual(*t->pipeline())) {
- // return false;
- //}
- // GrStrokeRectBatch* that = t->cast<StrokeRectBatch>();
-
- // NonAA stroke rects cannot batch right now
- // TODO make these batchable
- return false;
- }
-
- struct BatchTracker {
- GrColor fColor;
- bool fUsesLocalCoords;
- bool fColorIgnored;
- bool fCoverageIgnored;
- bool fHairline;
- };
-
- const static int kVertsPerHairlineRect = 5;
- const static int kVertsPerStrokeRect = 10;
-
- BatchTracker fBatch;
- SkSTArray<1, Geometry, true> fGeoData;
-};
-
-#endif
« no previous file with comments | « src/gpu/GrRectBatch.cpp ('k') | src/gpu/GrStrokeRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698