aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkRasterPipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkRasterPipeline.cpp')
-rw-r--r--src/core/SkRasterPipeline.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/core/SkRasterPipeline.cpp b/src/core/SkRasterPipeline.cpp
index 5125476dde..46658969cd 100644
--- a/src/core/SkRasterPipeline.cpp
+++ b/src/core/SkRasterPipeline.cpp
@@ -90,7 +90,9 @@ void SkRasterPipeline::dump() const {
#endif
void SkRasterPipeline::append_constant_color(SkArenaAlloc* alloc, const float rgba[4]) {
- // r,g,b might be outside [0,1], but alpha should probably always be in [0,1].
+ SkASSERT(0 <= rgba[0] && rgba[0] <= 1);
+ SkASSERT(0 <= rgba[1] && rgba[1] <= 1);
+ SkASSERT(0 <= rgba[2] && rgba[2] <= 1);
SkASSERT(0 <= rgba[3] && rgba[3] <= 1);
if (rgba[0] == 0 && rgba[1] == 0 && rgba[2] == 0 && rgba[3] == 1) {
@@ -104,10 +106,6 @@ void SkRasterPipeline::append_constant_color(SkArenaAlloc* alloc, const float rg
Sk4f color = Sk4f::Load(rgba);
color.store(&ctx->r);
- // TODO: if any channel is out of [0,1], append a float-only stage
- // that can handle that, instead of this uniform_color that assumes
- // in-range values so it can work in lowp.
-
// To make loads more direct, we store 8-bit values in 16-bit slots.
color = color * 255.0f + 0.5f;
ctx->rgba[0] = (uint16_t)color[0];