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

Unified Diff: src/effects/SkLightingImageFilter.cpp

Issue 189913021: Implement support for a Context parameter in image filters (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Revert all but the Context changes. Created 6 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/effects/SkDropShadowImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.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 ec33c2930c074eba0e7ad9b2e14e2cfaf0d5ef0e..206be1b62d847fdaa59b033e864f006538db9e6f 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -271,7 +271,7 @@ public:
protected:
explicit SkDiffuseLightingImageFilter(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
- virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
+ 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;
@@ -293,7 +293,7 @@ public:
protected:
explicit SkSpecularLightingImageFilter(SkReadBuffer& buffer);
virtual void flatten(SkWriteBuffer& buffer) const SK_OVERRIDE;
- virtual bool onFilterImage(Proxy*, const SkBitmap& src, const SkMatrix&,
+ 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;
@@ -933,13 +933,13 @@ void SkDiffuseLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy,
const SkBitmap& source,
- const SkMatrix& ctm,
+ const Context& ctx,
SkBitmap* dst,
SkIPoint* offset) const {
SkImageFilter* input = getInput(0);
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
- if (input && !input->filterImage(proxy, source, ctm, &src, &srcOffset)) {
+ if (input && !input->filterImage(proxy, source, ctx, &src, &srcOffset)) {
return false;
}
@@ -954,7 +954,7 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy,
SkIRect bounds;
src.getBounds(&bounds);
bounds.offset(srcOffset);
- if (!this->applyCropRect(&bounds, ctm)) {
+ if (!this->applyCropRect(&bounds, ctx.ctm())) {
return false;
}
@@ -967,7 +967,7 @@ bool SkDiffuseLightingImageFilter::onFilterImage(Proxy* proxy,
return false;
}
- SkAutoTUnref<SkLight> transformedLight(light()->transform(ctm));
+ SkAutoTUnref<SkLight> transformedLight(light()->transform(ctx.ctm()));
DiffuseLightingType lightingType(fKD);
offset->fX = bounds.left();
@@ -1026,13 +1026,13 @@ void SkSpecularLightingImageFilter::flatten(SkWriteBuffer& buffer) const {
bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy,
const SkBitmap& source,
- const SkMatrix& ctm,
+ const Context& ctx,
SkBitmap* dst,
SkIPoint* offset) const {
SkImageFilter* input = getInput(0);
SkBitmap src = source;
SkIPoint srcOffset = SkIPoint::Make(0, 0);
- if (input && !input->filterImage(proxy, source, ctm, &src, &srcOffset)) {
+ if (input && !input->filterImage(proxy, source, ctx, &src, &srcOffset)) {
return false;
}
@@ -1047,7 +1047,7 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy,
SkIRect bounds;
src.getBounds(&bounds);
bounds.offset(srcOffset);
- if (!this->applyCropRect(&bounds, ctm)) {
+ if (!this->applyCropRect(&bounds, ctx.ctm())) {
return false;
}
@@ -1065,7 +1065,7 @@ bool SkSpecularLightingImageFilter::onFilterImage(Proxy* proxy,
offset->fX = bounds.left();
offset->fY = bounds.top();
bounds.offset(-srcOffset);
- SkAutoTUnref<SkLight> transformedLight(light()->transform(ctm));
+ SkAutoTUnref<SkLight> transformedLight(light()->transform(ctx.ctm()));
switch (transformedLight->type()) {
case SkLight::kDistant_LightType:
lightBitmap<SpecularLightingType, SkDistantLight>(lightingType, transformedLight, src, dst, surfaceScale(), bounds);
« no previous file with comments | « src/effects/SkDropShadowImageFilter.cpp ('k') | src/effects/SkMagnifierImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698