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

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

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch 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/batches/GrBWFillRectBatch.h ('k') | src/gpu/batches/GrBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrBWFillRectBatch.cpp
diff --git a/src/gpu/batches/GrBWFillRectBatch.cpp b/src/gpu/batches/GrBWFillRectBatch.cpp
index c3ddc2b6cb536b1ed2d5e0b691321e77f8c33b22..000978998605dd19495ae8b696ed3150532f0c6f 100644
--- a/src/gpu/batches/GrBWFillRectBatch.cpp
+++ b/src/gpu/batches/GrBWFillRectBatch.cpp
@@ -17,7 +17,7 @@ class GrBatchTarget;
class SkMatrix;
struct SkRect;
-class BWFillRectBatch : public GrBatch {
+class BWFillRectBatch : public GrVertexBatch {
public:
struct Geometry {
SkMatrix fViewMatrix;
@@ -29,7 +29,7 @@ public:
bool fHasLocalMatrix;
};
- static GrBatch* Create(const Geometry& geometry) {
+ static GrDrawBatch* Create(const Geometry& geometry) {
return SkNEW_ARGS(BWFillRectBatch, (geometry));
}
@@ -134,13 +134,12 @@ private:
bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
- if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *t->pipeline(), t->bounds(),
- caps)) {
+ BWFillRectBatch* that = t->cast<BWFillRectBatch>();
+ if (!GrPipeline::CanCombine(*this->pipeline(), this->bounds(), *that->pipeline(),
+ that->bounds(), caps)) {
return false;
}
- BWFillRectBatch* that = t->cast<BWFillRectBatch>();
-
if (this->hasLocalRect() != that->hasLocalRect()) {
return false;
}
@@ -210,11 +209,11 @@ private:
};
namespace GrBWFillRectBatch {
-GrBatch* Create(GrColor color,
- const SkMatrix& viewMatrix,
- const SkRect& rect,
- const SkRect* localRect,
- const SkMatrix* localMatrix) {
+GrDrawBatch* Create(GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkRect* localRect,
+ const SkMatrix* localMatrix) {
BWFillRectBatch::Geometry geometry;
geometry.fColor = color;
geometry.fViewMatrix = viewMatrix;
@@ -244,7 +243,7 @@ GrBatch* Create(GrColor color,
#include "GrBatchTest.h"
-BATCH_TEST_DEFINE(RectBatch) {
+DRAW_BATCH_TEST_DEFINE(RectBatch) {
BWFillRectBatch::Geometry geometry;
geometry.fColor = GrRandomColor(random);
« no previous file with comments | « src/gpu/batches/GrBWFillRectBatch.h ('k') | src/gpu/batches/GrBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698