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

Unified Diff: include/gpu/GrEffectStage.h

Issue 551083002: Make GrEffectStage copy constructor work correctly with pending execution refs. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ; Created 6 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 | « no previous file | include/gpu/GrProgramElementRef.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffectStage.h
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index ba4d95d3371e4b480a633574745b16d71e4cac54..44997901a4e050dbb250afbe1a597b3777cfb52e 100644
--- a/include/gpu/GrEffectStage.h
+++ b/include/gpu/GrEffectStage.h
@@ -17,6 +17,11 @@
#include "SkMatrix.h"
#include "SkShader.h"
+// TODO: Make two variations on this class: One for GrDrawState that only owns regular refs
+// and supports compatibility checks and changing local coords. The second is for GrOptDrawState,
+// is immutable, and only owns pending execution refs. This requries removing the common base
+// class from GrDrawState and GrOptDrawState called GrRODrawState and converting to GrOptDrawState
+// when draws are enqueued in the GrInOrderDrawBuffer.
class GrEffectStage {
public:
explicit GrEffectStage(const GrEffect* effect, int attrIndex0 = -1, int attrIndex1 = -1)
@@ -27,17 +32,12 @@ public:
}
GrEffectStage(const GrEffectStage& other) {
- *this = other;
- }
-
- GrEffectStage& operator= (const GrEffectStage& other) {
fCoordChangeMatrixSet = other.fCoordChangeMatrixSet;
if (other.fCoordChangeMatrixSet) {
fCoordChangeMatrix = other.fCoordChangeMatrix;
}
- fEffect.reset(SkRef(other.fEffect.get()));
+ fEffect.initAndRef(other.fEffect);
memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexAttribIndices));
- return *this;
}
static bool AreCompatible(const GrEffectStage& a, const GrEffectStage& b,
« no previous file with comments | « no previous file | include/gpu/GrProgramElementRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698