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

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

Issue 1353683003: Move StrokeRectBatches into .cpp files (Closed) Base URL: https://skia.googlesource.com/skia.git@statics
Patch Set: tweaks Created 5 years, 3 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/batches/GrRectBatchFactory.cpp ('k') | src/gpu/batches/GrStrokeRectBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrStrokeRectBatch.h
diff --git a/src/gpu/batches/GrStrokeRectBatch.h b/src/gpu/batches/GrStrokeRectBatch.h
deleted file mode 100644
index b1cb8d4ccbe2642a7e69446bcfc1e474162e14cf..0000000000000000000000000000000000000000
--- a/src/gpu/batches/GrStrokeRectBatch.h
+++ /dev/null
@@ -1,83 +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 "GrColor.h"
-#include "GrDefaultGeoProcFactory.h"
-#include "GrVertexBatch.h"
-
-class GrStrokeRectBatch : public GrVertexBatch {
-public:
- DEFINE_BATCH_CLASS_ID
-
- struct Geometry {
- GrColor fColor;
- SkMatrix fViewMatrix;
- SkRect fRect;
- SkScalar fStrokeWidth;
- };
-
- static GrDrawBatch* Create(const Geometry& geometry, bool snapToPixelCenters) {
- return new 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);
- }
-
-private:
- void onPrepareDraws(Target*) override;
- void initBatchTracker(const GrPipelineOptimizations&) override;
-
- 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, const GrCaps&) override {
- // if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(),
- // t->bounds(), caps)) {
- // 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;
-
- typedef GrVertexBatch INHERITED;
-};
-
-#endif
« no previous file with comments | « src/gpu/batches/GrRectBatchFactory.cpp ('k') | src/gpu/batches/GrStrokeRectBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698