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

Unified Diff: include/core/SkLights.h

Issue 2167223002: Revert of Creating framework for drawShadowedPicture (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 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 | « include/core/SkCanvas.h ('k') | include/private/SkRecords.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkLights.h
diff --git a/include/core/SkLights.h b/include/core/SkLights.h
index 0b23cc14aa01fa742133e5dfdf332f24d8e6a334..c5c54276a39597909ff53a0465a6e97fee5a8743 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 @@
: 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 @@
if (!fDirection.normalize()) {
fDirection.set(0.0f, 0.0f, 1.0f);
}
- fShadowMap.reset(nullptr);
}
LightType type() const { return fType; }
@@ -47,35 +44,11 @@
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 @@
void add(const Light& light) {
if (fLights) {
- (void) fLights->fLights.append(1, &light);
+ *fLights->fLights.push() = light;
}
}
@@ -104,10 +77,6 @@
return fLights[index];
}
- Light& light(int index) {
- return fLights[index];
- }
-
private:
SkLights() {}
« no previous file with comments | « include/core/SkCanvas.h ('k') | include/private/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698