aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkNormalBevelSource.cpp
diff options
context:
space:
mode:
authorGravatar dvonbeck <dvonbeck@google.com>2016-08-11 14:17:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-11 14:17:59 -0700
commitee92063f9e1a28e301fe6cdc804dca0ccc837f67 (patch)
tree14498be020b15108253bcd8ebd1852eac4351950 /src/core/SkNormalBevelSource.cpp
parent5bf60adaaf76a102514b420a4acff6083902dabc (diff)
LightingShader and NormalSource comment and style fixes
Diffstat (limited to 'src/core/SkNormalBevelSource.cpp')
-rw-r--r--src/core/SkNormalBevelSource.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/SkNormalBevelSource.cpp b/src/core/SkNormalBevelSource.cpp
index f4bd031c4c..4a08728a98 100644
--- a/src/core/SkNormalBevelSource.cpp
+++ b/src/core/SkNormalBevelSource.cpp
@@ -245,6 +245,7 @@ private:
sk_sp<GrFragmentProcessor> SkNormalBevelSourceImpl::asFragmentProcessor(
const SkShader::AsFPArgs& args) const {
+ // This assumes a uniform scale. Anisotropic scaling might not be handled gracefully.
SkScalar maxScale = args.fViewMatrix->getMaxScale();
// Providing device-space width and height
@@ -260,7 +261,7 @@ SkNormalBevelSourceImpl::Provider::Provider() {}
SkNormalBevelSourceImpl::Provider::~Provider() {}
SkNormalSource::Provider* SkNormalBevelSourceImpl::asProvider(const SkShader::ContextRec &rec,
- void *storage) const {
+ void *storage) const {
return new (storage) Provider();
}
@@ -268,8 +269,9 @@ size_t SkNormalBevelSourceImpl::providerSize(const SkShader::ContextRec&) const
return sizeof(Provider);
}
+// TODO Implement feature for the CPU pipeline
void SkNormalBevelSourceImpl::Provider::fillScanLine(int x, int y, SkPoint3 output[],
- int count) const {
+ int count) const {
for (int i = 0; i < count; i++) {
output[i] = {0.0f, 0.0f, 1.0f};
}
@@ -297,7 +299,7 @@ void SkNormalBevelSourceImpl::flatten(SkWriteBuffer& buf) const {
////////////////////////////////////////////////////////////////////////////
sk_sp<SkNormalSource> SkNormalSource::MakeBevel(BevelType type, SkScalar width, SkScalar height) {
- /* TODO make sure this checks are tolerant enough to account for loss of conversion when GPUs
+ /* TODO make sure these checks are tolerant enough to account for loss of conversion when GPUs
use 16-bit float types. We don't want to assume stuff is non-zero on the GPU and be wrong.*/
SkASSERT(width > 0.0f && !SkScalarNearlyZero(width));
if (SkScalarNearlyZero(height)) {