diff options
author | Mike Klein <mtklein@chromium.org> | 2017-08-03 10:22:42 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-03 15:37:37 +0000 |
commit | 16776dfb4b307c70d08e316f2ecf2a53953f2e0d (patch) | |
tree | b95896287b957f1286a8f99c872fda9673def4ae /src/core/SkRasterPipeline.h | |
parent | 073073e4a49993818a7fc4996a7fb42f3ec79640 (diff) |
funnel all constant colors through append_constant_color()
My next step is to change the uniform_color context to
struct {
float r,g,b,a;
uint32_t rgba;
};
so that it's trivial to load in both float and 8-bit pipelines.
Change-Id: If9bdde353ced3bf9eb0c63204b4770ed614ad16b
Reviewed-on: https://skia-review.googlesource.com/30481
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/core/SkRasterPipeline.h')
-rw-r--r-- | src/core/SkRasterPipeline.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/SkRasterPipeline.h b/src/core/SkRasterPipeline.h index ff7bada24c..2a041d3a1e 100644 --- a/src/core/SkRasterPipeline.h +++ b/src/core/SkRasterPipeline.h @@ -11,6 +11,7 @@ #include "SkArenaAlloc.h" #include "SkImageInfo.h" #include "SkNx.h" +#include "SkPM4f.h" #include "SkTArray.h" #include "SkTypes.h" #include <functional> @@ -18,7 +19,6 @@ struct SkJumper_constants; struct SkJumper_Engine; -struct SkPM4f; /** * SkRasterPipeline provides a cheap way to chain together a pixel processing pipeline. @@ -135,7 +135,14 @@ public: // Appends a stage for a constant uniform color. // Tries to optimize the stage based on the color. - void append_constant_color(SkArenaAlloc*, const SkPM4f& color); + void append_constant_color(SkArenaAlloc*, const float rgba[4]); + + void append_constant_color(SkArenaAlloc* alloc, const SkPM4f& color) { + this->append_constant_color(alloc, color.fVec); + } + void append_constant_color(SkArenaAlloc* alloc, const SkColor4f& color) { + this->append_constant_color(alloc, color.vec()); + } bool empty() const { return fStages == nullptr; } |