aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkLights.h
diff options
context:
space:
mode:
authorGravatar vjiaoblack <vjiaoblack@google.com>2016-07-21 09:24:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-21 09:24:16 -0700
commit33d325890e549c113a258248002246b46e8040b2 (patch)
treeedb97ce0fe48078a14d82b2d1e8b3b5194025032 /include/core/SkLights.h
parent5fa7f30331585f78cf0f81ac185abbff1fee1152 (diff)
Revert of Creating framework for drawShadowedPicture (patchset #14 id:260001 of https://codereview.chromium.org/2146073003/ )
Reason for revert: Decided to re-wait for a final LGTM. Already found a bug in variable naming to fix. Original issue's description: > Creating framework for drawShadowedPicture > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003 > > Committed: https://skia.googlesource.com/skia/+/0ae097d116f4332be02a135ffc99c162473dee6a TBR=reed@google.com,robertphillips@google.com,bsalomon@google.com,jvanverth@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2167223002
Diffstat (limited to 'include/core/SkLights.h')
-rw-r--r--include/core/SkLights.h33
1 files changed, 1 insertions, 32 deletions
diff --git a/include/core/SkLights.h b/include/core/SkLights.h
index 0b23cc14aa..c5c54276a3 100644
--- a/include/core/SkLights.h
+++ b/include/core/SkLights.h
@@ -12,7 +12,6 @@
#include "SkPoint3.h"
#include "SkRefCnt.h"
#include "../private/SkTDArray.h"
-#include "SkImage.h"
class SK_API SkLights : public SkRefCnt {
public:
@@ -27,7 +26,6 @@ public:
: fType(kAmbient_LightType)
, fColor(color) {
fDirection.set(0.0f, 0.0f, 1.0f);
- fShadowMap.reset(nullptr);
}
Light(const SkColor3f& color, const SkVector3& dir)
@@ -37,7 +35,6 @@ public:
if (!fDirection.normalize()) {
fDirection.set(0.0f, 0.0f, 1.0f);
}
- fShadowMap.reset(nullptr);
}
LightType type() const { return fType; }
@@ -47,35 +44,11 @@ public:
return fDirection;
}
- void setShadowMap(sk_sp<SkImage> shadowMap) {
- fShadowMap = std::move(shadowMap);
- }
-
- sk_sp<SkImage> getShadowMap() const {
- return fShadowMap;
- }
-
- Light& operator= (const Light& b) {
- if (this == &b)
- return *this;
-
- this->fColor = b.fColor;
- this->fType = b.fType;
- this->fDirection = b.fDirection;
-
- if (b.fShadowMap) {
- this->fShadowMap = b.fShadowMap;
- }
-
- return *this;
- }
-
private:
LightType fType;
SkColor3f fColor; // linear (unpremul) color. Range is 0..1 in each channel.
SkVector3 fDirection; // direction towards the light (+Z is out of the screen).
// If degenerate, it will be replaced with (0, 0, 1).
- sk_sp<SkImage> fShadowMap;
};
class Builder {
@@ -84,7 +57,7 @@ public:
void add(const Light& light) {
if (fLights) {
- (void) fLights->fLights.append(1, &light);
+ *fLights->fLights.push() = light;
}
}
@@ -104,10 +77,6 @@ public:
return fLights[index];
}
- Light& light(int index) {
- return fLights[index];
- }
-
private:
SkLights() {}