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

Unified Diff: src/gpu/batches/GrRectBatch.h

Issue 1294553003: Move GrRectBatch to GrBWFillRectBatch and make internal (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
Index: src/gpu/batches/GrRectBatch.h
diff --git a/src/gpu/batches/GrRectBatch.h b/src/gpu/batches/GrRectBatch.h
deleted file mode 100644
index 3f13ef5bb5b9505efb83498581ac9083405a6c30..0000000000000000000000000000000000000000
--- a/src/gpu/batches/GrRectBatch.h
+++ /dev/null
@@ -1,84 +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 GrRectBatch_DEFINED
-#define GrRectBatch_DEFINED
-
-#include "GrBatch.h"
-#include "GrColor.h"
-
-class GrBatchTarget;
-class SkMatrix;
-struct SkRect;
-
-class GrRectBatch : public GrBatch {
-public:
- struct Geometry {
- SkMatrix fViewMatrix;
- SkRect fRect;
- SkRect fLocalRect;
- SkMatrix fLocalMatrix;
- GrColor fColor;
- bool fHasLocalRect;
- bool fHasLocalMatrix;
- };
-
- static GrBatch* Create(const Geometry& geometry) {
- return SkNEW_ARGS(GrRectBatch, (geometry));
- }
-
- const char* name() const override { return "RectBatch"; }
-
- 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 GrPipelineOptimizations&) override;
-
- void generateGeometry(GrBatchTarget* batchTarget) override;
-
- SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
-
-private:
- GrRectBatch(const Geometry& geometry) {
- this->initClassID<GrRectBatch>();
- fGeoData.push_back(geometry);
-
- fBounds = geometry.fRect;
- geometry.fViewMatrix.mapRect(&fBounds);
- }
-
- 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; }
- const SkMatrix& localMatrix() const { return fGeoData[0].fLocalMatrix; }
- bool hasLocalRect() const { return fGeoData[0].fHasLocalRect; }
- bool hasLocalMatrix() const { return fGeoData[0].fHasLocalMatrix; }
- bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
-
- bool onCombineIfPossible(GrBatch* t, const GrCaps&) override;
-
- const GrGeometryProcessor* createRectGP();
-
- struct BatchTracker {
- GrColor fColor;
- bool fUsesLocalCoords;
- bool fColorIgnored;
- bool fCoverageIgnored;
- };
-
- BatchTracker fBatch;
- SkSTArray<1, Geometry, true> fGeoData;
-};
-
-#endif

Powered by Google App Engine
This is Rietveld 408576698