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

Unified Diff: src/gpu/GrBatch.h

Issue 1239073002: Revert of Give GrBatch a pointer to GrPipeline (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBatch.h
diff --git a/src/gpu/GrBatch.h b/src/gpu/GrBatch.h
index b77011268b5a23489deb55b76278a5f0e5620efd..21dc3d21c88fd75f3f33afaa184f1be78ba206cf 100644
--- a/src/gpu/GrBatch.h
+++ b/src/gpu/GrBatch.h
@@ -11,9 +11,9 @@
#include <new>
#include "GrBatchTarget.h"
#include "GrGeometryProcessor.h"
-#include "GrNonAtomicRef.h"
#include "GrVertices.h"
#include "SkAtomics.h"
+#include "SkRefCnt.h"
#include "SkTypes.h"
class GrGpu;
@@ -37,8 +37,9 @@
* information will be communicated to the GrBatch prior to geometry generation.
*/
-class GrBatch : public GrNonAtomicRef {
+class GrBatch : public SkRefCnt {
public:
+
GrBatch() : fClassID(kIllegalBatchClassID), fNumberOfDraws(0) { SkDEBUGCODE(fUsed = false;) }
virtual ~GrBatch() {}
@@ -54,10 +55,6 @@
bool combineIfPossible(GrBatch* that) {
if (this->classID() != that->classID()) {
- return false;
- }
-
- if (!this->pipeline()->isEqual(*that->pipeline())) {
return false;
}
@@ -97,13 +94,13 @@
SkDEBUGCODE(bool isUsed() const { return fUsed; })
- void setPipeline(const GrPipeline* pipeline) { fPipeline.reset(SkRef(pipeline)); }
-
protected:
template <typename PROC_SUBCLASS> void initClassID() {
static uint32_t kClassID = GenClassID();
fClassID = kClassID;
}
+
+ uint32_t fClassID;
// NOTE, compute some bounds, even if extremely conservative. Do *NOT* setLargest on the bounds
// rect because we outset it for dst copy textures
@@ -112,8 +109,6 @@
void joinBounds(const SkRect& otherBounds) {
return fBounds.joinPossiblyEmptyRect(otherBounds);
}
-
- const GrPipeline* pipeline() const { return fPipeline; }
/** Helper for rendering instances using an instanced index index buffer. This class creates the
space for the vertices and flushes the draws to the batch target.*/
@@ -153,7 +148,6 @@
typedef InstancedHelper INHERITED;
};
- uint32_t fClassID;
SkRect fBounds;
private:
@@ -172,10 +166,11 @@
enum {
kIllegalBatchClassID = 0,
};
- SkAutoTUnref<const GrPipeline> fPipeline;
static int32_t gCurrBatchClassID;
+
+ SkDEBUGCODE(bool fUsed;)
+
int fNumberOfDraws;
- SkDEBUGCODE(bool fUsed;)
typedef SkRefCnt INHERITED;
};
« no previous file with comments | « gm/convexpolyeffect.cpp ('k') | src/gpu/GrPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698