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

Unified Diff: src/core/SkBitmapProcShader.cpp

Issue 1967283002: All source types working for linear pipeline. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use black const Created 4 years, 7 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 | « gm/SkLinearBitmapPipelineGM.cpp ('k') | 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 d230d147cbf00994a43f75c9bdedc9300f6a08b6..ae973a2a5902c31d7aa06158be1edb7652e8cc3c 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -132,9 +132,9 @@ public:
// Need to ensure that our pipeline is created at a 16byte aligned address
fShaderPipeline = (SkLinearBitmapPipeline*)SkAlign16((intptr_t)fShaderStorage);
new (fShaderPipeline) SkLinearBitmapPipeline(info->fRealInvMatrix, info->fFilterQuality,
- info->fTileModeX, info->fTileModeY,
- fAlpha,
- info->fPixmap);
+ info->fTileModeX, info->fTileModeY,
+ info->fPaintColor,
+ info->fPixmap);
// To implement the old shadeSpan entry-point, we need to efficiently convert our native
// floats into SkPMColor. The SkXfermode::D32Procs do exactly that.
@@ -223,16 +223,6 @@ 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.profileType() != kSRGB_SkColorProfileType) { return false; }
- if (srcInfo.colorType() != kRGBA_8888_SkColorType
- && srcInfo.colorType() != kBGRA_8888_SkColorType
- && srcInfo.colorType() != kIndex_8_SkColorType
- && srcInfo.colorType() != kRGBA_F16_SkColorType) {
- return false;
- }
-
// If we get here, we can reasonably use either context, respect the caller's preference
//
return SkShader::ContextRec::kPM4f_DstType == rec.fPreferredDstType;
@@ -264,12 +254,7 @@ SkShader::Context* SkBitmapProcShader::MakeContext(const SkShader& shader,
info->~SkBitmapProcInfo();
return nullptr;
}
- if (info->fPixmap.colorType() != kRGBA_8888_SkColorType
- && info->fPixmap.colorType() != kBGRA_8888_SkColorType
- && info->fPixmap.colorType() != kIndex_8_SkColorType
- && info->fPixmap.colorType() != kRGBA_F16_SkColorType) {
- return nullptr;
- }
+
return new (storage) LinearPipelineContext(shader, rec, info);
} else {
void* stateStorage = (char*)storage + sizeof(BitmapProcShaderContext);
« no previous file with comments | « gm/SkLinearBitmapPipelineGM.cpp ('k') | src/core/SkLinearBitmapPipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698