Revert "Add function to GrDataUtils to handle color conversions."
This reverts commit 55091020435c876d12f2d74697b21edbc98e13fa.
Reason for revert: valgrind issues
Original change's description:
> Add function to GrDataUtils to handle color conversions.
>
> Like SkConvertPixels but knows about all GrColorTypes, origin, and can
> apply an arbitrary GrSwizzle.
>
> Use in GrSurfaceContext read/write pixels methods.
>
> Add support for '0' to GrSwizzle.
>
>
> Change-Id: Ib9dd215fcb0ee8b33c4020893c22b4ab7ce1f40b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220761
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
Change-Id: If50f3e26875787d9309009e9c701774fbad0afda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221538
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrSwizzle.cpp b/src/gpu/GrSwizzle.cpp
index 138b24f..21fe834 100644
--- a/src/gpu/GrSwizzle.cpp
+++ b/src/gpu/GrSwizzle.cpp
@@ -11,17 +11,11 @@
void GrSwizzle::apply(SkRasterPipeline* pipeline) const {
SkASSERT(pipeline);
switch (fKey) {
- case GrSwizzle("rgba").asKey():
+ case GrSwizzle::RGBA().asKey():
return;
- case GrSwizzle("bgra").asKey():
+ case GrSwizzle::BGRA().asKey():
pipeline->append(SkRasterPipeline::swap_rb);
return;
- case GrSwizzle("aaa1").asKey():
- pipeline->append(SkRasterPipeline::alpha_to_gray);
- return;
- case GrSwizzle("rgb1").asKey():
- pipeline->append(SkRasterPipeline::force_opaque);
- return;
default: {
GR_STATIC_ASSERT(sizeof(uintptr_t) >= 4 * sizeof(char));
// Rather than allocate the 4 control bytes on the heap somewhere, just jam them right