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

Unified Diff: src/gpu/effects/GrRRectEffect.cpp

Issue 1287023009: Added tree structure to GrGLFragmentProcessor, i.e. GL instances (Closed) Base URL: https://skia.googlesource.com/skia@cs3_isequal_nonrecursive
Patch Set: moved onSetData from public to protected, onCreateGLInstance from public to private in subclasses 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/effects/GrOvalEffect.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrRRectEffect.cpp
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 271a997065993f31c87c1ec4935727b266671cea..519d72cb4e62042089ce8f1cd9700b4c287f1a77 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -49,8 +49,6 @@ public:
const char* name() const override { return "CircularRRect"; }
- GrGLFragmentProcessor* createGLInstance() const override;
-
const SkRRect& getRRect() const { return fRRect; }
uint32_t getCircularCornerFlags() const { return fCircularCornerFlags; }
@@ -60,6 +58,8 @@ public:
private:
CircularRRectEffect(GrPrimitiveEdgeType, uint32_t circularCornerFlags, const SkRRect&);
+ GrGLFragmentProcessor* onCreateGLInstance() const override;
+
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor& other) const override;
@@ -132,7 +132,8 @@ public:
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
- void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
+protected:
+ void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override;
private:
GrGLProgramDataManager::UniformHandle fInnerRectUniform;
@@ -280,7 +281,7 @@ void GLCircularRRectEffect::GenKey(const GrProcessor& processor, const GrGLSLCap
b->add32((crre.getCircularCornerFlags() << 3) | crre.getEdgeType());
}
-void GLCircularRRectEffect::setData(const GrGLProgramDataManager& pdman,
+void GLCircularRRectEffect::onSetData(const GrGLProgramDataManager& pdman,
const GrProcessor& processor) {
const CircularRRectEffect& crre = processor.cast<CircularRRectEffect>();
const SkRRect& rrect = crre.getRRect();
@@ -366,7 +367,7 @@ void CircularRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
GLCircularRRectEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* CircularRRectEffect::createGLInstance() const {
+GrGLFragmentProcessor* CircularRRectEffect::onCreateGLInstance() const {
return SkNEW_ARGS(GLCircularRRectEffect, (*this));
}
@@ -380,8 +381,6 @@ public:
const char* name() const override { return "EllipticalRRect"; }
- GrGLFragmentProcessor* createGLInstance() const override;
-
const SkRRect& getRRect() const { return fRRect; }
GrPrimitiveEdgeType getEdgeType() const { return fEdgeType; }
@@ -389,6 +388,8 @@ public:
private:
EllipticalRRectEffect(GrPrimitiveEdgeType, const SkRRect&);
+ GrGLFragmentProcessor* onCreateGLInstance() const override;
+
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
bool onIsEqual(const GrFragmentProcessor& other) const override;
@@ -477,7 +478,8 @@ public:
static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder*);
- void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
+protected:
+ void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override;
private:
GrGLProgramDataManager::UniformHandle fInnerRectUniform;
@@ -570,7 +572,7 @@ void GLEllipticalRRectEffect::GenKey(const GrProcessor& effect, const GrGLSLCaps
b->add32(erre.getRRect().getType() | erre.getEdgeType() << 3);
}
-void GLEllipticalRRectEffect::setData(const GrGLProgramDataManager& pdman,
+void GLEllipticalRRectEffect::onSetData(const GrGLProgramDataManager& pdman,
const GrProcessor& effect) {
const EllipticalRRectEffect& erre = effect.cast<EllipticalRRectEffect>();
const SkRRect& rrect = erre.getRRect();
@@ -614,7 +616,7 @@ void EllipticalRRectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
GLEllipticalRRectEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* EllipticalRRectEffect::createGLInstance() const {
+GrGLFragmentProcessor* EllipticalRRectEffect::onCreateGLInstance() const {
return SkNEW_ARGS(GLEllipticalRRectEffect, (*this));
}
« no previous file with comments | « src/gpu/effects/GrOvalEffect.cpp ('k') | src/gpu/effects/GrSimpleTextureEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698