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

Unified Diff: src/gpu/effects/GrConvexPolyEffect.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/GrConvexPolyEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrConvexPolyEffect.cpp
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 9c73e473223fccfba7537339b7337c1bf6a5356a..6c477688c0ce4fa7eca41272c1b583e5207facc7 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -26,8 +26,6 @@ public:
void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
- GrGLFragmentProcessor* createGLInstance() const override;
-
private:
AARectEffect(GrPrimitiveEdgeType edgeType, const SkRect& rect)
: fRect(rect), fEdgeType(edgeType) {
@@ -35,6 +33,8 @@ private:
this->setWillReadFragmentPosition();
}
+ GrGLFragmentProcessor* onCreateGLInstance() const override;
+
bool onIsEqual(const GrFragmentProcessor& other) const override {
const AARectEffect& aare = other.cast<AARectEffect>();
return fRect == aare.fRect;
@@ -85,7 +85,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 fRectUniform;
@@ -136,7 +137,7 @@ void GLAARectEffect::emitCode(EmitArgs& args) {
(GrGLSLExpr4(args.fInputColor) * GrGLSLExpr1("alpha")).c_str());
}
-void GLAARectEffect::setData(const GrGLProgramDataManager& pdman, const GrProcessor& processor) {
+void GLAARectEffect::onSetData(const GrGLProgramDataManager& pdman, const GrProcessor& processor) {
const AARectEffect& aare = processor.cast<AARectEffect>();
const SkRect& rect = aare.getRect();
if (rect != fPrevRect) {
@@ -156,7 +157,7 @@ void AARectEffect::onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBui
GLAARectEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* AARectEffect::createGLInstance() const {
+GrGLFragmentProcessor* AARectEffect::onCreateGLInstance() const {
return SkNEW_ARGS(GLAARectEffect, (*this));
}
@@ -170,7 +171,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 fEdgeUniform;
@@ -219,7 +221,7 @@ void GrGLConvexPolyEffect::emitCode(EmitArgs& args) {
(GrGLSLExpr4(args.fInputColor) * GrGLSLExpr1("alpha")).c_str());
}
-void GrGLConvexPolyEffect::setData(const GrGLProgramDataManager& pdman, const GrProcessor& effect) {
+void GrGLConvexPolyEffect::onSetData(const GrGLProgramDataManager& pdman, const GrProcessor& effect) {
const GrConvexPolyEffect& cpe = effect.cast<GrConvexPolyEffect>();
size_t byteSize = 3 * cpe.getEdgeCount() * sizeof(SkScalar);
if (0 != memcmp(fPrevEdges, cpe.getEdges(), byteSize)) {
@@ -307,7 +309,7 @@ void GrConvexPolyEffect::onGetGLProcessorKey(const GrGLSLCaps& caps,
GrGLConvexPolyEffect::GenKey(*this, caps, b);
}
-GrGLFragmentProcessor* GrConvexPolyEffect::createGLInstance() const {
+GrGLFragmentProcessor* GrConvexPolyEffect::onCreateGLInstance() const {
return SkNEW_ARGS(GrGLConvexPolyEffect, (*this));
}
« no previous file with comments | « src/gpu/effects/GrConvexPolyEffect.h ('k') | src/gpu/effects/GrConvolutionEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698