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

Unified Diff: src/gpu/effects/GrEllipseEdgeEffect.h

Issue 12462008: Add GrEllipseEdgeEffect (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: rebase again Created 7 years, 9 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/GrTextContext.cpp ('k') | src/gpu/effects/GrEllipseEdgeEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrEllipseEdgeEffect.h
===================================================================
--- src/gpu/effects/GrEllipseEdgeEffect.h (revision 0)
+++ src/gpu/effects/GrEllipseEdgeEffect.h (working copy)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrEllipseEdgeEffect_DEFINED
+#define GrEllipseEdgeEffect_DEFINED
+
+#include "GrEffect.h"
+
+class GrGLEllipseEdgeEffect;
+
+/**
+ * The output of this effect is a modulation of the input color and coverage for an axis-aligned
+ * ellipse, specified as center_x, center_y, x_radius, x_radius/y_radius in window space (y-down).
+ */
+
+class GrEllipseEdgeEffect : public GrEffect {
+public:
+ static GrEffectRef* Create() {
+ // maybe only have one static copy?
+ AutoEffectUnref effect(SkNEW(GrEllipseEdgeEffect));
+ return CreateEffectRef(effect);
+ }
+
+ virtual ~GrEllipseEdgeEffect() {}
+
+ static const char* Name() { return "EllipseEdge"; }
+
+ virtual void getConstantColorComponents(GrColor* color, uint32_t* validFlags) const SK_OVERRIDE;
+
+ typedef GrGLEllipseEdgeEffect GLEffect;
+
+ virtual const GrBackendEffectFactory& getFactory() const SK_OVERRIDE;
+
+private:
+ GrEllipseEdgeEffect();
+
+ virtual bool onIsEqual(const GrEffect& other) const SK_OVERRIDE {
+ return true;
+ }
+
+ GR_DECLARE_EFFECT_TEST;
+
+ typedef GrEffect INHERITED;
+};
+
+#endif
« no previous file with comments | « src/gpu/GrTextContext.cpp ('k') | src/gpu/effects/GrEllipseEdgeEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698