aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLight.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-08-19 13:11:23 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-08-19 13:11:23 -0700
commitf7d602a458f156723ec1a086f0fd132b1a9cc0e8 (patch)
tree6fbe3eb08cebe671d75d56edfda48967c374412f /src/core/SkLight.h
parenta060eba0836f98902ca078d5f9fc6191ba0c0a52 (diff)
Revert "Update SkLightingShader to support rotation"
This reverts commit 45b59ed6e4e231814dbdb9f707b3d2a7ee50de84. TBR=herb@google.com Review URL: https://codereview.chromium.org/1304673002
Diffstat (limited to 'src/core/SkLight.h')
-rw-r--r--src/core/SkLight.h56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/core/SkLight.h b/src/core/SkLight.h
deleted file mode 100644
index 4a6e149c76..0000000000
--- a/src/core/SkLight.h
+++ /dev/null
@@ -1,56 +0,0 @@
-
-/*
- * Copyright 2015 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef SkLight_DEFINED
-#define SkLight_DEFINED
-
-#include "SkPoint3.h"
-
-class SK_API SkLight {
-public:
- enum LightType {
- kAmbient_LightType, // only 'fColor' is used
- kDirectional_LightType
- };
-
- SkLight() : fType(kAmbient_LightType) {
- fColor.set(0.0f, 0.0f, 0.0f);
- fDirection.set(0.0f, 0.0f, 1.0f);
- }
-
- SkLight(const SkColor3f& color)
- : fType(kAmbient_LightType)
- , fColor(color) {
- fDirection.set(0.0f, 0.0f, 1.0f);
- }
-
- SkLight(const SkColor3f& color, const SkVector3& dir)
- : fType(kDirectional_LightType)
- , fColor(color)
- , fDirection(dir) {
- if (!fDirection.normalize()) {
- fDirection.set(0.0f, 0.0f, 1.0f);
- }
- }
-
- LightType type() const { return fType; }
- const SkColor3f& color() const { return fColor; }
- const SkVector3& dir() const {
- SkASSERT(kAmbient_LightType != fType);
- return fDirection;
- }
-
-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).
-};
-
-
-#endif