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

Unified Diff: src/gpu/GrTestBatch.h

Issue 1276333004: GrDrawVertices to batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix 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/GrDrawContext.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTestBatch.h
diff --git a/src/gpu/GrTestBatch.h b/src/gpu/GrTestBatch.h
deleted file mode 100644
index c5758bb8d2928f6b2b88bf9fbc7322b0388625fc..0000000000000000000000000000000000000000
--- a/src/gpu/GrTestBatch.h
+++ /dev/null
@@ -1,86 +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 GrTestBatch_DEFINED
-#define GrTestBatch_DEFINED
-
-#include "GrVertexBuffer.h"
-
-#include "batches/GrBatch.h"
-
-/*
- * A simple batch only for testing purposes which actually doesn't batch at all, but can fit into
- * the batch pipeline and generate arbitrary geometry
- */
-class GrTestBatch : public GrBatch {
-public:
- struct Geometry {
- GrColor fColor;
- };
-
- virtual const char* name() const override = 0;
-
- void getInvariantOutputColor(GrInitInvariantOutput* out) const override {
- // When this is called on a batch, there is only one geometry bundle
- out->setKnownFourComponents(this->geoData(0)->fColor);
- }
-
- void getInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
- out->setUnknownSingleComponent();
- }
-
- void initBatchTracker(const GrPipelineInfo& init) override {
- // Handle any color overrides
- if (!init.readsColor()) {
- this->geoData(0)->fColor = GrColor_ILLEGAL;
- }
- init.getOverrideColorIfSet(&this->geoData(0)->fColor);
-
- // setup batch properties
- fBatch.fColorIgnored = !init.readsColor();
- fBatch.fColor = this->geoData(0)->fColor;
- fBatch.fUsesLocalCoords = init.readsLocalCoords();
- fBatch.fCoverageIgnored = !init.readsCoverage();
- }
-
- void generateGeometry(GrBatchTarget* batchTarget) override {
- batchTarget->initDraw(fGeometryProcessor, this->pipeline());
-
- this->onGenerateGeometry(batchTarget);
- }
-
-protected:
- GrTestBatch(const GrGeometryProcessor* gp, const SkRect& bounds) {
- fGeometryProcessor.reset(SkRef(gp));
-
- this->setBounds(bounds);
- }
-
- const GrGeometryProcessor* geometryProcessor() const { return fGeometryProcessor; }
-
-private:
- virtual Geometry* geoData(int index) = 0;
- virtual const Geometry* geoData(int index) const = 0;
-
- bool onCombineIfPossible(GrBatch* t) override {
- return false;
- }
-
- virtual void onGenerateGeometry(GrBatchTarget* batchTarget) = 0;
-
- struct BatchTracker {
- GrColor fColor;
- bool fUsesLocalCoords;
- bool fColorIgnored;
- bool fCoverageIgnored;
- };
-
- SkAutoTUnref<const GrGeometryProcessor> fGeometryProcessor;
- BatchTracker fBatch;
-};
-
-#endif
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698