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

Unified Diff: src/effects/SkLightingImageFilter.cpp

Issue 26371002: Change SkImageFilter's cropRect from SkIRect to a CropRect struct (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Alternate version, using a single fFlags member. Created 7 years, 2 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/SkColorFilterImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.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 aac54625fee1a6197f125e4dee9f95eda7b0b704..c28b317e225c41bfcd04a338b3b59c789b1831db 100644
--- a/src/effects/SkLightingImageFilter.cpp
+++ b/src/effects/SkLightingImageFilter.cpp
@@ -260,7 +260,7 @@ void writePoint3(const SkPoint3& point, SkFlattenableWriteBuffer& buffer) {
class SkDiffuseLightingImageFilter : public SkLightingImageFilter {
public:
SkDiffuseLightingImageFilter(SkLight* light, SkScalar surfaceScale,
- SkScalar kd, SkImageFilter* input, const SkIRect* cropRect);
+ SkScalar kd, SkImageFilter* input, const CropRect* cropRect);
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkDiffuseLightingImageFilter)
#if SK_SUPPORT_GPU
@@ -282,7 +282,7 @@ private:
class SkSpecularLightingImageFilter : public SkLightingImageFilter {
public:
- SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const SkIRect* cropRect);
+ SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect);
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSpecularLightingImageFilter)
#if SK_SUPPORT_GPU
@@ -797,7 +797,7 @@ const SkScalar SkSpotLight::kSpecularExponentMax = SkFloatToScalar(128.0f);
///////////////////////////////////////////////////////////////////////////////
-SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkImageFilter* input, const SkIRect* cropRect)
+SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkImageFilter* input, const CropRect* cropRect)
: INHERITED(input, cropRect),
fLight(light),
fSurfaceScale(SkScalarDiv(surfaceScale, SkIntToScalar(255)))
@@ -809,7 +809,7 @@ SkLightingImageFilter::SkLightingImageFilter(SkLight* light, SkScalar surfaceSca
SkImageFilter* SkLightingImageFilter::CreateDistantLitDiffuse(
const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale,
- SkScalar kd, SkImageFilter* input, const SkIRect* cropRect) {
+ SkScalar kd, SkImageFilter* input, const CropRect* cropRect) {
return SkNEW_ARGS(SkDiffuseLightingImageFilter,
(SkNEW_ARGS(SkDistantLight, (direction, lightColor)), surfaceScale, kd,
input, cropRect));
@@ -817,7 +817,7 @@ SkImageFilter* SkLightingImageFilter::CreateDistantLitDiffuse(
SkImageFilter* SkLightingImageFilter::CreatePointLitDiffuse(
const SkPoint3& location, SkColor lightColor, SkScalar surfaceScale,
- SkScalar kd, SkImageFilter* input, const SkIRect* cropRect) {
+ SkScalar kd, SkImageFilter* input, const CropRect* cropRect) {
return SkNEW_ARGS(SkDiffuseLightingImageFilter,
(SkNEW_ARGS(SkPointLight, (location, lightColor)), surfaceScale, kd,
input, cropRect));
@@ -827,7 +827,7 @@ SkImageFilter* SkLightingImageFilter::CreateSpotLitDiffuse(
const SkPoint3& location, const SkPoint3& target,
SkScalar specularExponent, SkScalar cutoffAngle,
SkColor lightColor, SkScalar surfaceScale, SkScalar kd,
- SkImageFilter* input, const SkIRect* cropRect) {
+ SkImageFilter* input, const CropRect* cropRect) {
return SkNEW_ARGS(SkDiffuseLightingImageFilter,
(SkNEW_ARGS(SkSpotLight, (location, target, specularExponent,
cutoffAngle, lightColor)),
@@ -836,7 +836,7 @@ SkImageFilter* SkLightingImageFilter::CreateSpotLitDiffuse(
SkImageFilter* SkLightingImageFilter::CreateDistantLitSpecular(
const SkPoint3& direction, SkColor lightColor, SkScalar surfaceScale,
- SkScalar ks, SkScalar shininess, SkImageFilter* input, const SkIRect* cropRect) {
+ SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect) {
return SkNEW_ARGS(SkSpecularLightingImageFilter,
(SkNEW_ARGS(SkDistantLight, (direction, lightColor)),
surfaceScale, ks, shininess, input, cropRect));
@@ -844,7 +844,7 @@ SkImageFilter* SkLightingImageFilter::CreateDistantLitSpecular(
SkImageFilter* SkLightingImageFilter::CreatePointLitSpecular(
const SkPoint3& location, SkColor lightColor, SkScalar surfaceScale,
- SkScalar ks, SkScalar shininess, SkImageFilter* input, const SkIRect* cropRect) {
+ SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect) {
return SkNEW_ARGS(SkSpecularLightingImageFilter,
(SkNEW_ARGS(SkPointLight, (location, lightColor)),
surfaceScale, ks, shininess, input, cropRect));
@@ -854,7 +854,7 @@ SkImageFilter* SkLightingImageFilter::CreateSpotLitSpecular(
const SkPoint3& location, const SkPoint3& target,
SkScalar specularExponent, SkScalar cutoffAngle,
SkColor lightColor, SkScalar surfaceScale,
- SkScalar ks, SkScalar shininess, SkImageFilter* input, const SkIRect* cropRect) {
+ SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect) {
return SkNEW_ARGS(SkSpecularLightingImageFilter,
(SkNEW_ARGS(SkSpotLight, (location, target, specularExponent, cutoffAngle, lightColor)),
surfaceScale, ks, shininess, input, cropRect));
@@ -879,7 +879,7 @@ void SkLightingImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const {
///////////////////////////////////////////////////////////////////////////////
-SkDiffuseLightingImageFilter::SkDiffuseLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar kd, SkImageFilter* input, const SkIRect* cropRect = NULL)
+SkDiffuseLightingImageFilter::SkDiffuseLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar kd, SkImageFilter* input, const CropRect* cropRect = NULL)
: SkLightingImageFilter(light, surfaceScale, input, cropRect),
fKD(kd)
{
@@ -954,7 +954,7 @@ bool SkDiffuseLightingImageFilter::asNewEffect(GrEffectRef** effect, GrTexture*
///////////////////////////////////////////////////////////////////////////////
-SkSpecularLightingImageFilter::SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const SkIRect* cropRect)
+SkSpecularLightingImageFilter::SkSpecularLightingImageFilter(SkLight* light, SkScalar surfaceScale, SkScalar ks, SkScalar shininess, SkImageFilter* input, const CropRect* cropRect)
: SkLightingImageFilter(light, surfaceScale, input, cropRect),
fKS(ks),
fShininess(shininess)
« no previous file with comments | « src/effects/SkColorFilterImageFilter.cpp ('k') | src/effects/SkMergeImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698