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

Unified Diff: src/effects/SkLightingImageFilter.cpp

Issue 374923002: Goodbye GrEffectRef. (Closed) Base URL: https://skia.googlesource.com/skia.git@noref3
Patch Set: Address comments Created 6 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 | « src/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkLightingImageFilter.cpp
diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/SkLightingImageFilter.cpp
index 5fc3474e3d35c1a5c433278fdc83572dabb1feb4..f685bd6964da97ad0cb55427d20d85cfb81017ac 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -274,7 +274,8 @@ protected:
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
- virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
+ virtual bool asNewEffect(GrEffect** effect, GrTexture*, const SkMatrix& matrix,
+ const SkIRect& bounds) const SK_OVERRIDE;
#endif
private:
@@ -296,7 +297,8 @@ protected:
virtual bool onFilterImage(Proxy*, const SkBitmap& src, const Context&,
SkBitmap* result, SkIPoint* offset) const SK_OVERRIDE;
#if SK_SUPPORT_GPU
- virtual bool asNewEffect(GrEffectRef** effect, GrTexture*, const SkMatrix& matrix, const SkIRect& bounds) const SK_OVERRIDE;
+ virtual bool asNewEffect(GrEffect** effect, GrTexture*, const SkMatrix& matrix,
+ const SkIRect& bounds) const SK_OVERRIDE;
#endif
private:
@@ -334,11 +336,11 @@ private:
class GrDiffuseLightingEffect : public GrLightingEffect {
public:
- static GrEffectRef* Create(GrTexture* texture,
- const SkLight* light,
- SkScalar surfaceScale,
- const SkMatrix& matrix,
- SkScalar kd) {
+ static GrEffect* Create(GrTexture* texture,
+ const SkLight* light,
+ SkScalar surfaceScale,
+ const SkMatrix& matrix,
+ SkScalar kd) {
return SkNEW_ARGS(GrDiffuseLightingEffect, (texture,
light,
surfaceScale,
@@ -369,12 +371,12 @@ private:
class GrSpecularLightingEffect : public GrLightingEffect {
public:
- static GrEffectRef* Create(GrTexture* texture,
- const SkLight* light,
- SkScalar surfaceScale,
- const SkMatrix& matrix,
- SkScalar ks,
- SkScalar shininess) {
+ static GrEffect* Create(GrTexture* texture,
+ const SkLight* light,
+ SkScalar surfaceScale,
+ const SkMatrix& matrix,
+ SkScalar ks,
+ SkScalar shininess) {
return SkNEW_ARGS(GrSpecularLightingEffect, (texture,
light,
surfaceScale,
@@ -984,7 +986,8 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy,
}
#if SK_SUPPORT_GPU
-bool SkDiffuseLightingImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkMatrix& matrix, const SkIRect&) const {
+bool SkDiffuseLightingImageFilter::asNewEffect(GrEffect** effect, GrTexture* texture,
+ const SkMatrix& matrix, const SkIRect&) const {
if (effect) {
SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
*effect = GrDiffuseLightingEffect::Create(texture, light(), scale, matrix, kd());
@@ -1073,7 +1076,8 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy,
}
#if SK_SUPPORT_GPU
-bool SkSpecularLightingImageFilter::asNewEffect(GrEffectRef** effect, GrTexture* texture, const SkMatrix& matrix, const SkIRect&) const {
+bool SkSpecularLightingImageFilter::asNewEffect(GrEffect** effect, GrTexture* texture,
+ const SkMatrix& matrix, const SkIRect&) const {
if (effect) {
SkScalar scale = SkScalarMul(surfaceScale(), SkIntToScalar(255));
*effect = GrSpecularLightingEffect::Create(texture, light(), scale, matrix, ks(), shininess());
@@ -1229,10 +1233,10 @@ bool GrDiffuseLightingEffect::onIsEqual(const GrEffect& sBase) const {
GR_DEFINE_EFFECT_TEST(GrDiffuseLightingEffect);
-GrEffectRef* GrDiffuseLightingEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrDiffuseLightingEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
SkScalar surfaceScale = random->nextSScalar1();
SkScalar kd = random->nextUScalar1();
SkAutoTUnref<SkLight> light(create_random_light(random));
@@ -1435,10 +1439,10 @@ bool GrSpecularLightingEffect::onIsEqual(const GrEffect& sBase) const {
GR_DEFINE_EFFECT_TEST(GrSpecularLightingEffect);
-GrEffectRef* GrSpecularLightingEffect::TestCreate(SkRandom* random,
- GrContext* context,
- const GrDrawTargetCaps&,
- GrTexture* textures[]) {
+GrEffect* GrSpecularLightingEffect::TestCreate(SkRandom* random,
+ GrContext* context,
+ const GrDrawTargetCaps&,
+ GrTexture* textures[]) {
SkScalar surfaceScale = random->nextSScalar1();
SkScalar ks = random->nextUScalar1();
SkScalar shininess = random->nextUScalar1();
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/effects/SkLumaColorFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698