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

Unified Diff: src/core/SkNormalBevelSource.cpp

Issue 2237963002: LightingShader and NormalSource comment and style fixes (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Addressed patch 1 comment Created 4 years, 4 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/core/SkLightingShader.h ('k') | src/core/SkNormalFlatSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNormalBevelSource.cpp
diff --git a/src/core/SkNormalBevelSource.cpp b/src/core/SkNormalBevelSource.cpp
index f4bd031c4c7dbccd1f433f646aa8c7ef3197d73d..4a08728a9819bf6616d73e02c21a52722bdaf425 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)) {
« no previous file with comments | « src/core/SkLightingShader.h ('k') | src/core/SkNormalFlatSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698