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

Unified Diff: src/core/SkBitmapProcShader.cpp

Issue 1829883002: Add index-8 sampler to the pipeline. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix MSVC again. Created 4 years, 9 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 | « no previous file | src/core/SkLinearBitmapPipeline.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index fb58f542cc7b7c708426ec129ac28e231bbce644..0a3c0eaeb7f0da2eb44f336077fc2de70bd3b895 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -176,9 +176,9 @@ private:
static bool choose_linear_pipeline(const SkShader::ContextRec& rec, const SkImageInfo& srcInfo) {
// These src attributes are not supported in the new 4f context (yet)
//
- if (srcInfo.bytesPerPixel() < 4 ||
- kRGBA_F16_SkColorType == srcInfo.colorType() ||
- kIndex_8_SkColorType == srcInfo.colorType()) {
+ if (srcInfo.colorType() != kRGBA_8888_SkColorType
+ && srcInfo.colorType() != kBGRA_8888_SkColorType
+ && srcInfo.colorType() != kIndex_8_SkColorType) {
return false;
}
@@ -230,7 +230,8 @@ SkShader::Context* SkBitmapProcShader::MakeContext(const SkShader& shader,
return nullptr;
}
if (info->fPixmap.colorType() != kRGBA_8888_SkColorType
- && info->fPixmap.colorType() != kBGRA_8888_SkColorType) {
+ && info->fPixmap.colorType() != kBGRA_8888_SkColorType
+ && info->fPixmap.colorType() != kIndex_8_SkColorType) {
return nullptr;
}
return new (storage) LinearPipelineContext(shader, rec, info);
« no previous file with comments | « no previous file | src/core/SkLinearBitmapPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698